Install the Tracking Script
Add the Atribu tracker to your website to capture visitors, sessions, and conversions
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>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.
Next steps
Connect Ad Platforms
Link Meta and Google Ads to see which campaigns drive traffic
Connect Payments
Link Stripe or MercadoPago to track revenue
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