Giter VIP home page Giter VIP logo

idlesign / django-sitemetrics Goto Github PK

View Code? Open in Web Editor NEW
45.0 7.0 14.0 102 KB

Reusable application for Django that offers easy integration with different site metrics service providers.

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

License: BSD 3-Clause "New" or "Revised" License

Python 85.67% HTML 13.81% Smarty 0.52%
python django google-analytics yandex-metrika openstat

django-sitemetrics's Introduction

django-sitemetrics

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

image

image

image

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.

Documentation

http://django-sitemetrics.readthedocs.org/

django-sitemetrics's People

Contributors

andresriancho avatar bashu avatar dborisov avatar idlesign avatar jeansreal avatar pacahon avatar slepa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-sitemetrics's Issues

`manage.py migrate` failure with django 1.8

Traceback:

Synchronizing apps without migrations:
  Creating tables...
    Creating table thumbnail_kvstore
    Creating table sitemetrics_keycode
    Running deferred SQL...
Traceback (most recent call last):
...
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "django_site" does not exist

Hello. I'm trying to migrate from Django 1.7->1.8 and have a problem with sitemetrics module.
The problem is described here:
https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies

Be aware, however, that unmigrated apps cannot depend on migrated apps

I have contrib.sites in INSTALLED_APPS and sites is migrated app. Maybe initial migrations should be included in module due to optional dependency from django.contrib.sites? (It solved my problem)

Support for Universal Analytics (analytics.js)

There's a new SDK for Google Analytics which will soon replace the current ga.js:
https://developers.google.com/analytics/devguides/collection/analyticsjs/

The analytics.js snippet is part of Universal Analytics, which is currently in public beta. 
New users should use analytics.js. Existing ga.js users should create a new web property for analytics.js and dual tag their site. 
It is perfectly safe to include both ga.js and analytics.js snippets on the same page.

SystemCheckError in Django 1.8.5

Hello, I use template tag {% sitemetrics by yandex for "XXX" %} and don't want to use django.contrib.site, but in console I have an error:

ERRORS:
sitemetrics.Keycode.site: (fields.E300) Field defines a relation with model 'Site', which is either not installed, or is abstract.

Any suggestions?

Error using caching in Django 1.11 with django-sitemetrics

After having upgraded a Django 1.8 site to 1.11 (for LTS), when I enable caching in production I get the follow error:

File "/var/www/.../env/lib/python3.4/site-packages/sitemetrics/templatetags/sitemetrics.py", line 50, in sitemetrics cached = cache.get('sitemetrics') File "/var/www/.../env/lib/python3.4/site-packages/django/core/cache/backends/memcached.py", line 79, in get val = self._cache.get(key) AttributeError: Can't get attribute 'ValuesQuerySet' on <module 'django.db.models.query' from '/var/www/.../env/lib/python3.4/site-packages/django/db/models/query.py'>

Is there any way this can be solved?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.