Piwik Analytics for Django provides an easy way to intergrate Piwik into your Django Project.
Piwik is an open source / free software alternative to Google Analytics and allows you to have your analytics server.
This application provides a template tag that injects the required html snippet in your pages. Support different site ids and hosts using the sites django application.
It is an extension to the django-google-analytics application and requires it to be installed.
- Download and install django-google-analytics. You need
django-google-analytics with changes. Until merge upstream get
it from this repo
~$ pip install -e git://github.com/glogiotatidis/django-google-analytics.git#egg=google_analytics
- Download and install django-piwik-analytics
~$ pip install -e git://github.com/glogiotatidis/django-piwik-analytics.git#egg=piwik_analytics
- Add the piwik_analytics application to your INSTALLED_APPS section of your settings.py
- In your based template, usally a base.html, insert this tag at the very top:
{% load piwik_analytics %}
- In the same template, insert the following code right before the
closing body tag:
{% piwik_analytics “url example.com/piwik/ id 1” %}
Make sure that you replace example.com/piwik/ with your piwik installation url and 1 with your site id.
- Add the piwik_analytics application to your INSTALLED_APPS section of your settings.py
- Add the google_analytics application to your INSTALLED_APPS section of your settings.py
- Add GOOGLE_ANALYTICS_MODEL = True to your settings.py.
- Run a ./manage.py syncdb to add the database tables
- Go to your project’s admin page (usally admin) and click Google Analytics/Sites
- In your based template, usally a base.html, insert this tag at the very top:
{% load piwik_analytics %}
- In the same template, insert the following code right before the
closing body tag:
{% piwik_analytics %}
Make sure that you replace example.com/piwik/ with your piwik installation url and 1 with your site id.
This project is distributed under the Affero GPL License v3