Simple Analytics template tags for Django
Project description
Django Plugin
Want privacy friendly analytics for Django? You're at the right place.
You need an account on Simple Analytics to see your stats collected by this plugin.
Installing it
Install the plugin:
pip install simpleanalytics
Using it
Add the package to the INSTALLED_APPS
:
INSTALLED_APPS = [
...,
simpleanalytics,
]
Next use the templatetag
in your template:
<!DOCTYPE html>
{% load static simpleanalytics_tags %}
<html>
<head>
<meta charset="utf-8">
<title>{% block page_title %}{{ site.name }}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
...
{% simpleanalytics_sync %}
...
</head>
</html>
This will translate to roughly this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>brwnppr.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
...
<script type="text/javascript" src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
...
</head>
</html>
More
This app has four templatetags:
- simpleanalytics_sync
- simpleanalytics_async
simpleanalytics_sync
converts to a plain <script>
tag without the async
keyword.
simpleanalytics_async
converts to a plain <script>
tag with the async
keyword.
Compatibility
Tested on Django 2.2, but we think this should run on any recent Django deployment. Please raise an issue when it doesn't.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file simpleanalytics-1.0.7.tar.gz
.
File metadata
- Download URL: simpleanalytics-1.0.7.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d074277993cb3780544fac13abcce11d55418c73b8c3f7dc3ee693d533fd65b |
|
MD5 | 6f66be7a9d794788fa4778c0e384f677 |
|
BLAKE2b-256 | e32e5d32fb21e41f704c70c0601aeebc795260e25c69e2a51af97e5e7ae9d194 |
File details
Details for the file simpleanalytics-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: simpleanalytics-1.0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2a05f0c9fa98c89279f7f66f0c7936e0cfdac992a1330a40a82ad109fbfb0d9 |
|
MD5 | fd9fa9bb0af39542f581359c855cc174 |
|
BLAKE2b-256 | ca43a8d86f7d005c0c6c326f74fd6aac247b6973d47641224af3573a60e9f019 |