Skip to content

Plugin for Kirby CMS to add all kinds of analytics services with different options. [Google Analytics](https://www.google.de/analytics/), [Piwik](https://piwik.org/), [Open Web Analytics](http://www.openwebanalytics.com/) and [Mixpanel](https://mixpanel.com/). With the default option to honor [Do Not Track](http://donottrack.us/) Opt Outs.

License

Notifications You must be signed in to change notification settings

l4ci/kirby-analytics-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kirby Analytics Plugin

Version License Kirby Version

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.

Installation

Use one of the alternatives below.

1. Kirby CLI

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

2. Clone or download

  1. Clone or download this repository.
  2. Unzip the archive if needed and rename the folder to analytics.

Make sure that the plugin folder structure looks like this:

site/plugins/analytics/

3. Git Submodule

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

Setup

1. Snippet

Add the following code to your footer.php snippet (or the fitting one) just before your closing</body>.

snippet('analytics');

2. Config

Enable the plugin by adding the following to your site/config/config.php and choose a service below.

c::set('analytics', true);

Services

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);

(optional) Blueprint

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

Usage

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.

Changelog

1.0.0

  • Initial release

Todo

  • 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

Requirements

Disclaimer

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.

License

MIT

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.

About

Plugin for Kirby CMS to add all kinds of analytics services with different options. [Google Analytics](https://www.google.de/analytics/), [Piwik](https://piwik.org/), [Open Web Analytics](http://www.openwebanalytics.com/) and [Mixpanel](https://mixpanel.com/). With the default option to honor [Do Not Track](http://donottrack.us/) Opt Outs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages