• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created almost 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

django-tracking2 tracks the length of time visitors and registered users spend on your site. Although this will work for websites, this is more applicable to web _applications_ with registered users. This does not replace (nor intend) to replace client-side analytics which is great for understanding aggregate flow of page views.

Overview

Build Status PyPI

django-tracking2 tracks the length of time visitors and registered users spend on your site. Although this will work for websites, this is more applicable to web applications with registered users. This does not replace (nor intend) to replace client-side analytics which is great for understanding aggregate flow of page views.

Note: This is not a new version of django-tracking. These apps have very different approaches and, ultimately, goals of tracking users. This app is about keeping a history of visitor sessions, rather than the current state of the visitor.

Requirements

Download

pip install django-tracking2

Setup

Add tracking to your project's INSTALLED_APPS setting:

INSTALLED_APPS = (
    ...
    'tracking',
    ...
)

The tracking app should follow the app with your user model

Add tracking.middleware.VisitorTrackingMiddleware to your project's MIDDLEWARE_CLASSES before the SessionMiddleware:

MIDDLEWARE_CLASSES = (
    ...
    'tracking.middleware.VisitorTrackingMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    ...
)

Settings

TRACK_AJAX_REQUESTS - If True, AJAX requests will be tracked. Default is False

TRACK_ANONYMOUS_USERS - If False, anonymous users will not be tracked. Default is True

TRACK_SUPERUSERS - If False, users with the superuser flag set to True will not be tracked. Default is True.

TRACK_PAGEVIEWS - If True, individual pageviews will be tracked.

TRACK_IGNORE_URLS - A list of regular expressions that will be matched against the request.path_info (request.path is stored, but not matched against). If they are matched, the visitor (and pageview) record will not be saved. Default includes 'favicon.ico' and 'robots.txt'. Note, static and media are not included since they should be served up statically Django's static serve view or via a lightweight server in production. Read more here

TRACK_IGNORE_STATUS_CODES - A list of HttpResponse status codes that will be ignored. If the HttpResponse object has a status_code in this blacklist, the pageview record will not be saved. For example,

TRACK_IGNORE_STATUS_CODES = [400, 404, 403, 405, 410, 500]

TRACK_REFERER - If True, referring site for all pageviews will be tracked. Default is False

TRACK_QUERY_STRING - If True, query string for all pageviews will be tracked. Default is False

Views

To view aggregate data about all visitors and per-registered user stats, do the following:

Include tracking.urls in your urls.py:

urlpatterns = [
    ...
    re_path(r'^tracking/', include('tracking.urls')),
    ...
]

These urls are protected by a custom Django permission tracking.visitor_log. Thus only superusers and users granted this permission can view these pages.

Available URLs

  • / - overview of all visitor activity, includes a time picker for filtering.

Templates

  • tracking/dashboard.html - for the dashboard page
  • tracking/snippets/stats.html - standalone content for the dashboard page (simplifies overriding templates)

More Repositories

1

jekyll-docs-template

Jekyll template for documentation-based sites
HTML
194
star
2

jsonpatch-js

A JavaScript implementation of the JSON Media Type for partial modifications: http://tools.ietf.org/html/rfc6902
JavaScript
181
star
3

synapse

Hooks to support data binding between virtually any object.
JavaScript
150
star
4

rita

Toolkit for event-centric and reactive patterns leveraging https://nats.io.
Go
82
star
5

django-preserialize

Convert your model instances and querysets into dicts and list with style.
Python
41
star
6

code-examples

Go
33
star
7

wicked-django-template

A badass Django project template
JavaScript
27
star
8

strconv

String type inference and conversion
Python
23
star
9

cypher

Neo4j Cypher compiler for building domain-specific APIs
Python
18
star
10

vim-newsprint-theme

Newspaper style Vim theme
Vim Script
13
star
11

json-graph-spec

JSON specification for representing a graph structure
12
star
12

kmm

Kids Money Manager - Demo application using Rita (https://github.com/bruth/rita)
Go
12
star
13

django-registration2

Registration and moderation utilities
Python
11
star
14

restlib2

restlib2 is an HTTP library which simplifies creating dynamic Web resources for Django. restlib2 focuses on embracing HTTP and enables clean transparent implementations of your resources.
Python
11
star
15

taskpaper-goodies

Various scripts, themes, etc for TaskPaper
Shell
10
star
16

backbone-common

Various classes which have common utility.
JavaScript
9
star
17

graphlib

Graph API and serializer for the JSON Graph Spec
Python
8
star
18

django-restlib

Django-restlib provides a set of classes and utilities for implementing class-based resources having support for various HTTP methods. The HTTP specification is followed as stringently as possible to ensure client applications can be written in a consistent way.
Python
6
star
19

pubsub

A publish/subscribe API with support for publish undo/redo
JavaScript
5
star
20

github-webhook-nats-streaming

HTTP server to receive GitHub webhook events and publish them to NATS Streaming.
Go
5
star
21

go-pulsar-ws

Go client for Apache Pulsar using the Websocket protocol.
Go
4
star
22

flatjson

Flatten nested JSON documents.
Go
4
star
23

nats-subject-profiler

Go
4
star
24

resources

[INACTIVE] Inspired by http://python-requests.org, Resources is an HTTP library which simplifies creating web resources in Python. Resources focuses on embracing HTTP and enables clean transparent implementations of your resources.
Python
3
star
25

marky

A live markdown previewer
Python
2
star
26

devel.io

HTML
2
star
27

jquery.fn.search

jQuery plugin for text searching in the DOM
CoffeeScript
2
star
28

gplus-circles

Implementation of the Google+ Circles UI
Ruby
2
star
29

playbill

Playbill is a process management tool for ETL workflows.
Go
2
star
30

rest

A collection REST and HTTP musings and pseudo implementation strategies
1
star
31

groupby

Various groupby utilities
JavaScript
1
star
32

modern-javascript-starter

A super minimal set of code with a set of guides for integrating modern libraries and tools.
JavaScript
1
star
33

promiser

jQuery deferreds by name
JavaScript
1
star
34

scss-themes

A few SCSS mixins to create distinct UI sections
Ruby
1
star
35

notes

1
star
36

learn-c

"Learn C The Hard Way" examples
C
1
star
37

journal

Bash script for keeping a journal using VIm
Shell
1
star
38

neo4j-download-manager

Neo4j Download Manager (NDM)
Shell
1
star
39

ipipe

Simple iterator-based utilities for building data processing pipelines.
Python
1
star
40

ntable

A table data structure for NATS Streaming.
Go
1
star
41

docker-pgcopy

Copies a database from one server to another.
Shell
1
star
42

awesome-time

A curated list of awesome time-related tools, techniques, and resources.
Go
1
star