skip to navigation
skip to content

Not Logged In

django-ganalytics 0.4

Simple Google Analytics integration for Django.

# django-ganalytics

Simple Google Analytics integration for Django.

## Meta

* author: Randall Degges
* email:
* status: maintained, in development

[![Build Status](](

## Purpose

Honestly, all the other Google Analytics Django apps suck. All I want to do is
put my Google Analytics code in my ```` file, and use a simple
template tag to render the Google Analytics asynchronous javascript code,

Unfortunately, all the existing solutions don't do this, and that pisses me


## Installation and Usage

Anyway, let's install this bitch! The first thing you'll want to do is run:

``` bash
$ pip install django-ganalytics

Next, modify your ```` file, and add your Google Analytics code
(usually something like ``UA-XXXXXXXX-XX``), as well as put
``ganalytics`` in your ``INSTALLED_APPS``:

``` python

# ...


Now, to actually render your Google Analytics asynchronous javascript code,
edit your desired Django template (I like to do this in my ``base.html``
template), and add the following:

``` html
{% load ganalytics %}

{% ganalytics %}


When Django processes your template, it'll replace ``{% ganalytics %}``

``` html
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', '{{ GANALYTICS_TRACKING_CODE }}', 'auto');
ga('send', 'pageview');

Easy, right?  
File Type Py Version Uploaded on Size
django-ganalytics-0.4.tar.gz (md5) Source 2015-01-25 24KB
  • Downloads (All Versions):
  • 37 downloads in the last day
  • 202 downloads in the last week
  • 1122 downloads in the last month