{"id":13849474,"url":"https://github.com/bruth/django-tracking2","last_synced_at":"2025-04-04T15:11:47.418Z","repository":{"id":2249468,"uuid":"3204388","full_name":"bruth/django-tracking2","owner":"bruth","description":"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.","archived":false,"fork":false,"pushed_at":"2022-11-29T15:51:48.000Z","size":180,"stargazers_count":202,"open_issues_count":17,"forks_count":67,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-25T14:43:52.408Z","etag":null,"topics":["django","tracking","visitor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bruth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-17T23:34:12.000Z","updated_at":"2024-04-03T14:12:13.000Z","dependencies_parsed_at":"2023-01-13T11:44:02.836Z","dependency_job_id":null,"html_url":"https://github.com/bruth/django-tracking2","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruth%2Fdjango-tracking2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruth%2Fdjango-tracking2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruth%2Fdjango-tracking2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruth%2Fdjango-tracking2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bruth","download_url":"https://codeload.github.com/bruth/django-tracking2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198469,"owners_count":20900081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","tracking","visitor"],"created_at":"2024-08-04T19:01:19.304Z","updated_at":"2025-04-04T15:11:47.398Z","avatar_url":"https://github.com/bruth.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Overview\n========\n\n[![Build Status](https://travis-ci.org/bruth/django-tracking2.svg?branch=master)](https://travis-ci.org/bruth/django-tracking2)\n[![PyPI](https://img.shields.io/pypi/v/django-tracking2.svg)](https://pypi.python.org/pypi/django-tracking2)\n\ndjango-tracking2 tracks the length of time visitors and registered users\nspend on your site. Although this will work for websites, this is more\napplicable to web _applications_ with registered users. This does\nnot replace (nor intend) to replace client-side analytics which is\ngreat for understanding aggregate flow of page views.\n\n**Note: This is not a new version of [django-tracking]. These apps\nhave very different approaches and, ultimately, goals of tracking users.\nThis app is about keeping a history of visitor sessions, rather than the\ncurrent state of the visitor.**\n\n[django-tracking]: https://github.com/codekoala/django-tracking\n\nRequirements\n============\n* Django's [session framework][1] installed\n\n[1]: https://docs.djangoproject.com/en/3.2/topics/http/sessions/\n\nDownload\n========\n```bash\npip install django-tracking2\n```\n\nSetup\n=====\nAdd `tracking` to your project's `INSTALLED_APPS` setting:\n\n```python\nINSTALLED_APPS = (\n    ...\n    'tracking',\n    ...\n)\n```\n\nThe `tracking` app should follow the app with your user model\n\nAdd `tracking.middleware.VisitorTrackingMiddleware` to your project's\n`MIDDLEWARE_CLASSES` before the `SessionMiddleware`:\n\n```python\nMIDDLEWARE_CLASSES = (\n    ...\n    'tracking.middleware.VisitorTrackingMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    ...\n)\n```\n\nSettings\n--------\n`TRACK_AJAX_REQUESTS` - If True, AJAX requests will be tracked. Default\nis False\n\n`TRACK_ANONYMOUS_USERS` - If False, anonymous users will not be tracked.\nDefault is True\n\n`TRACK_SUPERUSERS` - If False, users with the superuser flag set to True will\nnot be tracked.  Default is True.\n\n`TRACK_PAGEVIEWS` - If True, individual pageviews will be tracked.\n\n`TRACK_IGNORE_URLS` - A list of regular expressions that will be matched\nagainst the `request.path_info` (`request.path` is stored, but not matched\nagainst). If they are matched, the visitor (and pageview) record will not\nbe saved. Default includes 'favicon.ico' and 'robots.txt'. Note, static and\nmedia are not included since they should be served up statically Django's\nstatic serve view or via a lightweight server in production. Read more\n[here](https://docs.djangoproject.com/en/dev/howto/static-files/#serving-other-directories)\n\n`TRACK_IGNORE_STATUS_CODES` - A list of HttpResponse status codes that will be ignored.\nIf the HttpResponse object has a `status_code` in this blacklist, the pageview record\nwill not be saved. For example,\n\n```python\nTRACK_IGNORE_STATUS_CODES = [400, 404, 403, 405, 410, 500]\n```\n\n`TRACK_REFERER` - If True, referring site for all pageviews will be tracked.  Default is False\n\n`TRACK_QUERY_STRING` - If True, query string for all pageviews will be tracked.  Default is False\n\nViews\n-----\nTo view aggregate data about all visitors and per-registered user stats,\ndo the following:\n\nInclude `tracking.urls` in your `urls.py`:\n\n```python\nurlpatterns = [\n    ...\n    re_path(r'^tracking/', include('tracking.urls')),\n    ...\n]\n```\n\nThese urls are protected by a custom Django permission `tracking.visitor_log`.\nThus only superusers and users granted this permission can view these pages.\n\nAvailable URLs\n--------------\n* `/` - overview of all visitor activity, includes a time picker for\n        filtering.\n\nTemplates\n---------\n* `tracking/dashboard.html` - for the dashboard page\n* `tracking/snippets/stats.html` - standalone content for the dashboard page\n  (simplifies overriding templates)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruth%2Fdjango-tracking2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbruth%2Fdjango-tracking2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruth%2Fdjango-tracking2/lists"}