Skip to content

Commit fc09c82

Browse files
committed
Adding widget, bumping to 1.1
1 parent 3bc1549 commit fc09c82

28 files changed

+19729
-6382
lines changed

README.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ A wrapper around the Plausible API that fetches the analytics into your dashboar
66

77
Install the addon.
88

9-
```bash
10-
composer require jackabox/statamic-plausible-analytics
119
```
12-
13-
Publish the assets
14-
15-
```bash
16-
php artisan vendor:publish --provider="Jackabox\Plausible\PlausibleServiceProvider"
10+
composer require jackabox/statamic-plausible-analytics
1711
```
1812

1913
Then follow the steps in the config step bellow.
@@ -23,9 +17,8 @@ Then follow the steps in the config step bellow.
2317
1. Head to your [Plausible Settings](https://plausible.io/settings).
2418
2. Scroll down to API key and generate a new one. Name it whatever you like.
2519
3. Copy that value into your `.env` as `PLAUSIBLE_KEY`.
26-
4. If you're self hosting Plausible, add the config option for `PLAUSIBLE_DOMAIN` in your `.env`
27-
5. Get your site as displayed in your Plausible Dashboard (e.g. jackwhiting.co.uk). Add that value to your `.env` as `PLAUSIBLE_SITE`.
28-
6. Data should load.
20+
4. Get your site as displayed in your Plausible Dashboard (e.g. jackwhiting.co.uk). Add that value to your `.env` as `PLAUSIBLE_SITE`.
21+
5. Data should load.
2922

3023
For more customisation you can publish the config and adjust the values as you wish.
3124

@@ -35,6 +28,47 @@ php artisan vendor:publish --tag=plausible-config
3528

3629
By default, all results from the API are cached. This can be overwritten, but I didn't want to spam to the API.
3730

31+
## Widgets
32+
33+
There are four widgets included with a few options. Periods to display be changed between `12mo,6mo,month,30d,6d,day`.
34+
35+
### Visitor Overview
36+
37+
```php
38+
[
39+
'type' => 'plausible_visitor_overview',
40+
'period' => '30d', // Period you want to show
41+
'show_graph' => 0 // Boolean, 0 or 1
42+
],
43+
```
44+
45+
### Top Pages
46+
47+
```php
48+
[
49+
'type' => 'plausible_top_pages',
50+
'period' => '30d'
51+
]
52+
```
53+
54+
### Top Browsers
55+
56+
```php
57+
[
58+
'type' => 'plausible_top_browsers',
59+
'period' => '7d'
60+
]
61+
```
62+
63+
### Top Referrers
64+
65+
```php
66+
[
67+
'type' => 'plausible_top_referrers',
68+
'period' => '7d'
69+
]
70+
```
71+
3872
## Issues
3973

4074
If there are any problems with getting this to work, please open an issue on GitHub. If you have any ideas/want to discuss new features please use the discussions feature :)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jackabox/statamic-plausible-analytics",
33
"description": "Get your Plausible Analytics data right from your Statamic dashboard.",
4-
"version": "1.1.0",
4+
"version": "1.1",
55
"autoload": {
66
"psr-4": {
77
"Jackabox\\Plausible\\": "src"

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/plausible.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
*/
1313
'site' => env('PLAUSIBLE_SITE', null),
1414

15-
/**
16-
* Domain where your plausible instance is hosted
17-
* e.g. jackwhiting.co.uk
18-
*/
19-
'domain' => env('PLAUSIBLE_DOMAIN', 'https://plausible.io'),
20-
2115
/**
2216
* Do you want to use the cache?
2317
* True of False.

dist/js/statamic-plausible.js

Lines changed: 2930 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)