Skip to main content

Jmbo analytics app.

Project description

Jmbo Analytics
==============
**Jmbo analytics brings the power of Google Analytics to your Django projects**

.. figure:: https://travis-ci.org/praekelt/jmbo-analytics.svg?branch=develop
:align: center
:alt: Travis

.. contents:: Contents
:depth: 3

Required
--------

* You have to add ``jmbo_analytics`` to you ``INSTALLED_APPS``
* You have to specify a Google Analytics `tracking code <https://support.google.com/analytics/bin/answer.py?hl=en&answer=1008080>`_.

where ``xxx`` is your tracking code::

JMBO_ANALYTICS = {
'google_analytics_id': 'xxx',
}


Usage
-----

``jmbo-analytics`` offers you two ways to add tracking to your pages.

1. HTML tag
***********

Using ``<img />`` and putting it in your ``base.html``::

{% load jmbo_analytics_tags %}
<div style="display: none;">
<img src="{% google_analytics %}" width="0" height="0" />
</div>

2. Middleware and Celery
************************

Using Django's middleware you can process every request and use Celery to make the request to Google Analytics.
Note that this does not work behind a reverse caching proxy::

MIDDLEWARE_CLASSES = (
'jmbo_analytics.middleware.GoogleAnalyticsMiddleware',
)

You may have to add ``jmbo_analytics`` to your ``CELERY_IMPORTS``::

CELERY_IMPORTS = ('jmbo_analytics.tasks')

You may also specify paths that will be excluded when tracking::

GOOGLE_ANALYTICS_IGNORE_PATH = ['/health/', ]
Authors
=======

Praekelt Consulting
-------------------

* Hedley Roos

Unomena
-------

* Euan Jonker

Changelog
=========

0.2
---
#. Use requests library because it can drill through HTTP proxies.

0.1
---
#. Simplify dependencies.
#. Make transparent GIF method asynchronous.

0.0.4
-----
#. Better packaging.

0.0.3
-----
#. Fork, rename, re-license from panomena-analytics.

Project details


Download files

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

Source Distribution

jmbo-analytics-0.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

jmbo_analytics-0.2-py2.7.egg (17.4 kB view details)

Uploaded Source

File details

Details for the file jmbo-analytics-0.2.tar.gz.

File metadata

File hashes

Hashes for jmbo-analytics-0.2.tar.gz
Algorithm Hash digest
SHA256 66b33090d15b2a4f531b9b34e69de9ca385df22d52db249741a91e57afa7aa05
MD5 c7bcbde1003edb65e42f3543e012a627
BLAKE2b-256 a68627038be15e41a31f2f1cce544abd44900a45ba2546cb268fed250ea2b810

See more details on using hashes here.

File details

Details for the file jmbo_analytics-0.2-py2.7.egg.

File metadata

File hashes

Hashes for jmbo_analytics-0.2-py2.7.egg
Algorithm Hash digest
SHA256 813b23fb8418e70f40784320faf7be33cee33e0bb5b87f2745e9698ac6983320
MD5 b00b941a36e2b1af2e5d985455b37909
BLAKE2b-256 02330224ad8910c059f0efe1fd726a744b08a097e4c99a4264fb1a41fa472ec8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page