Step 5 — Install the tracker
Add the Atribu tracker to your website to capture visitors, sessions, and conversions
This page is the In the app track for step 5 of the golden path. The agent track is at the bottom, under With the API / an AI agent.
The Atribu tracking script is a lightweight JavaScript snippet that runs on your website. It captures:
- Page views -- which pages visitors see and how long they stay
- Visitor identity -- assigns each device a unique anonymous ID so you can follow the journey across visits
- Traffic sources -- reads UTM parameters and click IDs (fbclid, gclid) from your ad URLs to know which campaign brought each visitor
- Form submissions -- automatically detects when someone fills out a form and extracts their email or phone number
- Booking completions -- detects GoHighLevel, Calendly, and Cal.com booking widgets
Installation
Go to Settings > Tracking in your Atribu dashboard. You will see your personalized tracking snippet with your unique tracking key already filled in. Copy it and install it using one of the methods below.
Paste the snippet into the <head> section of every page on your site. If you use a CMS like WordPress, Webflow, or Squarespace, look for the "Custom Code" or "Header Code Injection" setting.
<script>
window.ATRIBU_TRACKING_KEY = "your-tracking-key-here";
window.ATRIBU_TRACKING_ENDPOINT = "https://www.atribu.app/api/tracking/collect";
window.ATRIBU_INTERCEPT_FBQ = true;
window.ATRIBU_META_BRIDGE_PAGEVIEW = false;
window.atribuTracker = window.atribuTracker || function() {
(window.atribuTracker.q = window.atribuTracker.q || []).push(arguments);
};
</script>
<script src="https://www.atribu.app/atribu-tracker.js" defer></script>Use your actual snippet
The code above is a template. Copy your real snippet from Settings > Tracking -- it has your tracking key pre-filled.
The defer attribute ensures the script loads without slowing down your page. Events that happen before the script finishes loading are queued and sent once it is ready.
Create a new tag
In Google Tag Manager, go to Tags > New and select Custom HTML as the tag type.
Paste the snippet
Copy your tracking snippet from Settings > Tracking in Atribu and paste it into the HTML field.
<script>
window.ATRIBU_TRACKING_KEY = "your-tracking-key-here";
window.ATRIBU_TRACKING_ENDPOINT = "https://www.atribu.app/api/tracking/collect";
window.ATRIBU_INTERCEPT_FBQ = true;
window.ATRIBU_META_BRIDGE_PAGEVIEW = false;
window.atribuTracker = window.atribuTracker || function() {
(window.atribuTracker.q = window.atribuTracker.q || []).push(arguments);
};
</script>
<script src="https://www.atribu.app/atribu-tracker.js" defer></script>Just want a single tag?
GTM's Custom HTML tag re-creates <script> elements when it renders them, and it only copies over id, text, charset, type, and src -- any data-* attribute is silently dropped. The two-tag snippet above sidesteps that by setting window.ATRIBU_TRACKING_KEY in an inline script first, but if you'd rather paste one tag, put the key in the src query string instead:
<script src="https://www.atribu.app/atribu-tracker.js?key=your-tracking-key-here"></script>Add &endpoint=... to the same query string to override ATRIBU_TRACKING_ENDPOINT too. A window.ATRIBU_TRACKING_KEY set anywhere on the page always takes precedence over the query string, so the two forms can coexist safely.
Set the trigger
Set the trigger to All Pages so the tracker loads on every page of your site.
Publish
Click Submit to publish the container. The tracker will start collecting data immediately.
Shopify's Web Pixel system provides a sandboxed environment for third-party scripts.
Go to Customer Events
In your Shopify admin, navigate to Settings > Customer Events.
Add a custom pixel
Click Add custom pixel and give it a name like "Atribu Tracker".
Paste the snippet
Copy your tracking snippet from Settings > Tracking in Atribu and paste it into the code editor.
Save and connect
Click Save, then toggle the pixel to Connected.
Shopify limitations
Shopify's Web Pixel runs in a sandboxed iframe. Form auto-capture and booking widget detection may not work inside the sandbox. For full functionality, consider adding the tracker via the theme's theme.liquid file instead (paste it before the closing </head> tag).
How the tracker works
IDs and cookies
The tracker creates two identifiers for each visitor:
- Anonymous ID (
atribu_visitor_idcookie) -- A unique ID for each device/browser. Persists for 1 year. This is how Atribu counts unique visitors. - Session ID (
atribu_session_idcookie) -- A unique ID for each visit. Resets after 30 minutes of inactivity or when the visitor arrives from a new marketing source (different UTM parameters or click ID). This is how Atribu counts sessions.
Both IDs are stored as first-party cookies so server-side code (like checkout pages) can read them and pass them to payment providers for better attribution.
Automatic features
The tracker automatically captures these events without any extra code:
| Feature | What it does |
|---|---|
| Page views | Tracks every page the visitor sees, including single-page app navigation |
| Form submissions | Detects form submissions, extracts email/phone, and links the anonymous visitor to a known customer |
| Booking widgets | Detects GoHighLevel, Calendly, and Cal.com booking completions |
| Stripe checkout redirects | Detects ?session_id=cs_* in the URL after a Stripe Payment Link redirect |
| Outbound link clicks | Tracks clicks to external domains |
| File downloads | Tracks downloads (PDF, ZIP, etc.) |
| Engagement | Measures scroll depth and time on page |
The identify() call
The most important thing the tracker does is link anonymous visitors to known customers. When someone fills out a form on your site, the tracker automatically calls identify() with their email or phone number. This creates a connection between the anonymous browser visitor and the customer record in your CRM or payment provider.
Without this link, Atribu cannot attribute a Stripe payment back to the original ad click. Form auto-capture handles this automatically for standard HTML forms. If you use a custom form (React, Vue, etc.), you can call identify() manually:
window.atribuTracker.identify({
email: "[email protected]",
phone: "+1234567890"
});Verify it is working
After installing the tracker:
- Visit your website in a browser (not incognito -- some ad blockers are more aggressive there)
- Open your Atribu dashboard
- Check the Online Now counter in the top right -- you should see at least 1 visitor
- After a few minutes, page views and sessions will appear in the dashboard
Ad blockers
Some browser ad blockers may block the tracking script. If you or your team use ad blockers, you may not see your own visits. To ensure the tracker works for all visitors -- including those with ad blockers -- set up a custom tracking domain. This routes tracking requests through your own domain instead of atribu.app, which ad blockers do not block.
Go to Settings > Tracking > Custom Domain to set this up.
With the API / an AI agent
Everything above is available without a browser. Three calls:
curl -sX POST https://api.atribu.app/api/v1/tracking/keys \
-H "Authorization: Bearer atb_live_YOUR_KEY"A profile that already has an active key gets that key back rather than a second one, so an agent can call this unconditionally on every run.
curl -H "Authorization: Bearer atb_live_YOUR_KEY" \
"https://api.atribu.app/api/v1/tracking/snippet"
# or, for a tag manager / a Shopify store
curl -H "Authorization: Bearer atb_live_YOUR_KEY" \
"https://api.atribu.app/api/v1/tracking/installers/gtm"
curl -H "Authorization: Bearer atb_live_YOUR_KEY" \
"https://api.atribu.app/api/v1/tracking/installers/shopify-pixel"An agent that can edit the site puts the snippet in. One that cannot hands the payload to the person who can — that is the hand-off, in its simplest form.
curl -H "Authorization: Bearer atb_live_YOUR_KEY" \
"https://api.atribu.app/api/v1/profile/readiness"Readiness's tracker_installed step is done once at least one tracking event
reached Atribu in the last 7 days — which is the only definition of
"installed" that survives someone deleting the tag next month.
No browser at all?
A system that already knows its own outcomes does not need the tracker for
them: POST /api/v1/events accepts a server-side outcome event directly. See
Tracking & server-side events. You still want the tracker
if you want to know which ad produced them.
Over MCP
issue_tracking_key and get_tracker_installer are these calls as tools
(#1058). The key tool is idempotent for the same reason the route is: a profile
with an active key gets that key back.
Next steps
Step 6 — Connect ad platforms
Link Meta and Google Ads to see which campaigns drive traffic
Tracking API
Keys, installers, and server-side outcome events
How Tracking Works
Deep dive into visitors, sessions, cookies, and how the tracker captures data
Identity Resolution
How anonymous visitors become known customers across devices and channels