Skip to main content

Google analytics web property per site in django admin

Project description

Django Google Analytics

Django template tag app for inserting google analytic code on a per
site basis.

Copyright (C) 2011 Benjamin Wilbur


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <>.

* This codes underlying structure is largely based off Django's
documentation at the following url.

1. `pip install django_google_analytics`
1. Ensure you have sites configured.
1. add `analytics` to your `INSTALLED_APPS`
1. `python migrate`
1. In the django admin interface visit the "Sites"
page and add your google web property id for the site you
wish to track.
1. Add the following to your desired templates.
`{% load analytics %}`
1. at the very bottom of your head section add this
`{% analytics %}`
1. if you want to avoid counting logged in user visits
surround the above line with the following
`{% if not user.is_staff %}`
`{% endif %}`
1. Go to your google analytics control panel and refresh
frantically to see if it is working

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django_google_analytics, version 2
Filename, size File type Python version Upload date Hashes
Filename, size django_google_analytics-2.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page