{ "info": { "author": "Monwara LLC", "author_email": "branko@monwara.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License" ], "description": "==================\ndjango-ga-tracking\n==================\n\ndjango-ga-tracking is a simple Django pluggable app that provides a context\nprocessor and template for adding `Google Analytics`_ tracking code to your\npages.\n\nAlternatives and differences\n============================\n\nThere are alternatives like `django-google-analytics`_ and `Django Analytics\nMiddleware`_, but this project begun as both solutions seem to introduce\nunnecessary complexity and/or lack the ability to configure analytics via\nDjango settings module. The latter factor was particularly important for this\nproject because hard-coding configuration or storing configuration in a\ndatabaes column was something we absolutely wanted to avoid.\n\nInstallation\n============\n\nInstall using pip::\n\n pip install django-ga-tracking\n\nBasic usage\n===========\n\nAdd ``ga_tracking`` to ``INSTALLED_APPS``.\n\nNext, add the ``ga_tracking_id`` context processor to\n``TEMPLATE_CONTEXT_PROCESSORS``::\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n ....\n 'ga_tracking.context_processors.ga_tracking_id',\n )\n\nDefine a ``GA_TRACKING_ID`` setting and assign your tracking ID to it. For\nexample::\n\n GA_TRACKING_ID = 'UA-12345678-9'\n\nFinally, add the tracker code template somewhere in your own template::\n\n {% include \"ga_tracking/ga.html\" %}\n\nTracking superusers\n===================\n\nBy default, django-ga-analytics will track superusers. You can disable this by\nusing the ``GA_TRACK_SUPERUSER`` setting. Setting it to ``False`` will cause\nthe tracking code to not be renedered for any user that has ``is_superuser``\nproperty set to ``True``.\n\nNew tracking code\n=================\n\nGoogle Analytics offers an alternative tracking code (``analytics.js``). This\ncode is also available in django-ga-tracking. Since the tracking code uses both\nthe property ID and the top level domain, you will need to specify both. So,\nadd this to your settings::\n\n GA_TRACKING_ID = 'UA-12345678-9'\n GA_DOMAIN = 'example.com'\n\nNext, include the alternative template::\n\n {% include \"ga_tracking/ga_new.html\" %}\n\nCustomization\n=============\n\nBecause django-ga-tracking uses a simple template to add the code, you can\ncustomize it simply by overriding the template with your own. The ``ga.html``\ntemplate contains the default ``