How to install Attriboo on Flask
Install Attriboo in the shared Jinja template used by your Flask website. The script belongs in the HTML the browser receives, rather than the Python application code.
Instructions reviewed
Before you start
You need template source and deployment access. This guide covers a Flask site that renders HTML with Jinja. For an API-only Flask service with a separate frontend, install tracking in that frontend.
Add the published domain in Attriboo. Keep one tracking installation and preserve your site’s consent choices. Your website ID is public; private API keys do not belong in the page script.
Copy the script for this website
- Choose your website in Attriboo.
Check the address in the website selector. Add the website first if it is not listed.
- Open Setup and choose Flask.
Under Add the tracking script to your website, find Where is your site built? Choose this platform, then use Copy beside Your code. This gives you the right code format with your website ID filled in.
Add Attriboo to Flask
Find this setting
- templates directory
- Base layout.html or base.html
- Inside <head>
- Deploy
- Locate the shared Jinja document, often templates/layout.html or templates/base.html.
Check which public pages extend it.
- Paste the HTML script from Setup before </head>.
Keep it outside an optional head block that child templates replace, or preserve the parent with super().
- Deploy the application and clear any HTML cache used by the site.
Verify a direct visit and a second published page.
<script defer data-site-id="site_YOUR_WEBSITE_ID" src="https://www.attriboo.com/t.js"></script>Check this platform’s behavior
A script added to only one render_template response will miss other pages. Flask endpoints returning JSON are not browser pages, and installing this script does not record server requests or background jobs.
Check that page visits reach Attriboo
- Open the published website in another tab.
Use the address your customers visit. Make your normal tracking choice if a consent banner appears.
- Return to the same website in Attriboo → Setup.
Select Test Connection. Look for a successful result such as Verified Live or activity on the correct address.
- Follow an internal link, then use your browser’s Back button.
Check those paths in the Pages view for the current reporting dates. Allow the reports to refresh. An active connection alone does not confirm every page change.
Connect visits to recorded revenue
Installing the script records website activity. To bring sales into Attriboo, connect the service you use to collect payments in Setup as well. Then compare the recorded sources and customer journeys behind your sales.
A payment imported from before tracking was installed may have no matching visit. Installing today does not recreate old website activity.
Flask references
These placement instructions were reviewed against the platform’s documentation and Attriboo’s current tracker. Check the published site after deployment, theme changes or navigation changes.
You are done when
The published Flask site loads one Attriboo tracker and the expected page visits reach the selected website. Sales reporting is checked separately.
Still need a hand?
Send a question without needing to sign in.