Version 1.0.0
Plugin for Kirby CMS to add all kinds of analytics services with different options. Google Analytics, Piwik, Open Web Analytics and Mixpanel. With the default option to honor Do Not Track Opt Outs.
Use one of the alternatives below.
If you are using the Kirby CLI you can install this plugin by running the following commands in your shell:
$ cd path/to/kirby
$ kirby plugin:install l4ci/kirby-analytics-plugin
Make sure that the plugin folder structure looks like this:
site/plugins/analytics/
If you know your way around Git, you can download this plugin as a submodule:
$ cd path/to/kirby
$ git submodule add https://github.com/l4ci/kirby-analytics-plugin site/plugins/analytics
Add the following code to your footer.php
snippet (or the fitting one) just before your closing</body>
.
snippet('analytics');
Enable the plugin by adding the following to your site/config/config.php
and choose a service below.
c::set('analytics', true);
The following services can be set in your /site/config/config.php
file:
// En/disable the whole plugin
// - Disabled by default
c::set('analytics', true);
// Track logged in users
// - Disabled by default
c::get('analytics.trackloggedinuser', false);
// Google Analytics
c::get('analytics.google', false);
// Put your UA-XXXXX-XX here
c::get('analytics.google.id', false);
// Anonymize Ip Adresses
// - Enabled by default
c::get('analytics.google.anonymizeip' , true);
// Piwik
c::get('analytics.piwik' , false);
c::get('analytics.piwik.url' , false);
c::get('analytics.piwik.id' , false);
// Open Webanalytics
c::get('analytics.owa' , false);
c::get('analytics.owa.url' , false);
c::get('analytics.owa.id' , false);
// Mixpanel
c::get('analytics.mix' , false);
c::get('analytics.mix.token' , false);
// Honor Do Not Track Opt Outs
// <http://donottrack.us/>
// - Enabled by default
c::get('analytics.dnt', true);
Add the following code to your blueprints, where you want the analytics options to show up in the panel. This will create a field in the panel, to disable analytics on the current page.
fields:
analytics:
extends: analytics
Once the snippets and blueprints are added, and the plugin is enabled and configured in your config.php
, your analytics service of choice should be filling up with data.
1.0.0
- Initial release
- Piwik support
- Google Analytics support
- add optout function for google analytics
- Mixpanel support
- Open Web Analytics support
- Honor Do Not Track header
- add option to disable analytics on page level
- add neutral event tracking function
- add optout for piwik
- add optout link as field for piwik
- add optout link as field for google analytics
- Kirby 2.5.5+
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.