Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

86 lines (44 sloc) 2.368 kB


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

    Provider alias: yandex

  2. Google Analytics

    Provider alias: google

How to use

  1. Add the sitemetrics application to INSTALLED_APPS in your settings file (usually
  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 ./ syncdb to install sitemetrics tables into your database.


Jump to Line
Something went wrong with that request. Please try again.