Install Analytise on Django

Add the snippet to your base template so every page inherits it.

Add it to base.html

  1. Open your base template — typically templates/base.html.
  2. Paste the snippet inside the <head> (or your extra_head block).
  3. Restart the server and reload the page.
templates/base.html
{# templates/base.html #}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{% block title %}My site{% endblock %}</title>
  <script
    defer
    data-domain="yourwebsite.com"
    data-site-id="YOUR_SITE_ID"
    src="https://www.analytise.com/js/tracker.js">
  </script>
  {% block extra_head %}{% endblock %}
</head>
<body>
  {% block content %}{% endblock %}
</body>
</html>

Verify it works

  1. Open your website in a new tab.
  2. The dashboard shows your visit under online within a few seconds (live visitors update every ~15s).
  3. Nothing showing? See Troubleshooting.

Next guide

Ghost