Skip to main content

A simple Django package to render Plausible Analytics html tag

Project description

Django Simple Plausible

A dead simple package to add Plausible Analytics html tag to your HTML. Tested with Python 2.7 and 3.8. Tested with Django 1.11 and 3.2.

Usage

  1. Install package: pip install django_simple_plausible

  2. Add django_simple_plausible to your INSTALLED_APPS in settings.py

  3. ADD PLAUSIBLE_SITES and PLAUSIBLE_SCRIPT_URL keys and values to your settings.py. Or enter the corresponding values as template tag parameters, as shown below.

...

PLAUSIBLE_SITES = "example.com"
PLAUSIBLE_SCRIPT_URL = "https://example.com/js/plausible.js"

...
  1. add the following template tags to your site html:
{% load plausible %}
{% plausible %}

Configuring details

  • PLAUSIBLE_SITES can be a comma separated list without spaces, if you want to use that feature of Plausible
PLAUSIBLE_SITES = "example.com,yoursite.com"
  • Systemwide settings can be overridden giving the template tag some optional parameters:
{% plausible plausible_sites="mysite.com" script_url="https://mysite.com/plausible.js" %}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_simple_plausible-0.0.4.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

django_simple_plausible-0.0.4-py2.py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page