Skip to main content

Reusable application for Django providing easy means to integrate site metrics counters into your sites

Project description

http://github.com/idlesign/django-sitemetrics

LBC Python 2
https://img.shields.io/pypi/v/django-sitemetrics.svg https://img.shields.io/pypi/l/django-sitemetrics.svg https://img.shields.io/coveralls/idlesign/django-sitemetrics/master.svg https://img.shields.io/travis/idlesign/django-sitemetrics/master.svg

What’s that

Reusable application for Django providing easy means to integrate site metrics counters into your sites

Built-in site metrics providers

  1. Yandex Metrika - http://metrika.yandex.ru/

    Provider alias: yandex

  2. Google Analytics - http://www.google.com/analytics/

    Provider alias: google

  3. Openstat - https://www.openstat.com/

    Provider alias: openstat

How to use

  1. Add the sitemetrics application to INSTALLED_APPS in your settings file (usually settings.py)
  2. Add {% load sitemetrics %} tag to the top of a template (usually base template, e.g. _base.html)

Then you have two options to add metrics counter code to your page:

  • Use four arguments sitemetrics tag notation:

    {% sitemetrics by google for "UA-000000-0" %}
    

    Here: google is a metrics provider alias; UA-000000-0 - metrics counter keycode.

    That is how you put Google Analytics counter code (with UA-000000-0 keycode) into page.

  • Use no arguments sitemetrics tag notation:

    {% sitemetrics %}
    

    That is how you put all counter codes registered and active for the current site.

    Client codes are registered with sites through Django Admin site interface.

    Admin site and Sites from Django contribs are required for this approach to work.

    Use ./manage.py migrate to install sitemetrics tables into your database.

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-sitemetrics, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size django_sitemetrics-1.2.0-py2.py3-none-any.whl (25.6 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-sitemetrics-1.2.0.tar.gz (22.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page