Kirby Analytics Dashboard is a Kirby plugin which extends your dashboard with some Google Analytics statistics and reports. It does not emulate Google Analytics itself but provides a nice and simple overview about how your site is doing.
If you need detailed reports head over to your Google Analytics Dashboard.
Currently there is only one widget available but it is planned to add some more. Feel free to open an issue for feature requests :)
Visitors – Compares data of the last seven days with those of the previous week.
If you are using the Kirby CLI you can install this plugin by running the following command in your shell from the root folder of your Kirby installation:
kirby plugin:install gearsdigital/kirby-analytics-dashboard
Download the latest release
Extract the zip and upload the extracted folder to /site/plugins
Add the following entries to /site/config/config.php
c::set('analytics.dashboard.view.id', 'ga:XXXXXXXXX');
c::set('analytics.dashboard.client.id', 'XXXXXXXXX.apps.googleusercontent.com');
After logging in to your Kirby panel, you should see a new widget containing the »Sign in with Google« Button.
Please Note: You will not receive any data until you have completed the prerequisite setup!
Request blocking browser extensions like uBlock Origin
or Ghostery
will probably block all request to Google. So make sure to whitelist your panel or temporarily disable those extenstions.
In order to retrieve data from Google Analytics you have to create a Google Service Account to create a client ID. A view ID is required as well.
A client ID is used to anonymously identify a browser instance and is mandatory for all Google Analytics Reporting API requests.
http://localhost
or http://localhost:8080
. Otherwise insert your domain.The client ID should look like: xxxxxxxxxxx.apps.googleusercontent.com
One way to retrieve a view ID is the Google Account Explorer. Use this tool to search or browse through your accounts, properties, and views, See what accounts you have access to, and find the IDs that you need for the API or for another tool or service that integrates with Google Analytics.
You will find the view ID under Table ID (ids).
An alternative approach is to go to Google Analytics > Administration > View settings. Do not forget to add the prefix: ga:
.
The view ID should look like: ga:12345678
.
Currently are three languages supported. English (default), German and French. If you want to explicitly set a language just add this to your config.php
.
c::set('analytics.dashboard.language', 'de'); // en, fr
The built-in support for multi-language sites is respected.
As Google Analytics is used by millions of sites they put limits and quotas on API requests to protect the system from receiving more data than it can handle. Learn more about limits and quotas.
This plugin is using only the Google Analytics Reporting API which means our limit is 10000 requests per day. I do not expect any issues here because Kirby is used mostly on small sites but I will improve this plugin and add some caching later this year.
Thank you very much for your effort.
All contributions are very welcome – if you found a bug please tell me!