Install Trfyx in Django
Add the Trfyx tracker to your shared Django base template so it loads across the pages that extend that template.Before you start: Identify the base template used by your site (commonly
templates/base.html) and have the Trfyx Website ID for the domain you want to track.Add the tracker to your base template
Open your shared base template and add the following snippet inside the existing<head> element:
Verify installation
- Deploy the Django application.
- Open the live site and visit a few pages.
- Open app.trfyx.com and check the matching Trfyx project for activity.
- If no activity appears, inspect the browser’s Console and Network tabs for failed or blocked requests.
Troubleshooting
- No data appears: Check the Website ID, domain, and selected Trfyx project.
- Only some pages are tracked: Confirm those pages extend the base template containing the snippet.
- The script is blocked: Check Content Security Policy (CSP), consent settings, and browser extensions.
- Duplicate pageviews appear: Search your templates and tag manager for another Trfyx installation and remove the duplicate.