Atribu
Getting Started

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.

Tracking snippet
<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.

Custom HTML tag content
<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:

Single-tag alternative
<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_id cookie) -- A unique ID for each device/browser. Persists for 1 year. This is how Atribu counts unique visitors.
  • Session ID (atribu_session_id cookie) -- 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:

FeatureWhat it does
Page viewsTracks every page the visitor sees, including single-page app navigation
Form submissionsDetects form submissions, extracts email/phone, and links the anonymous visitor to a known customer
Booking widgetsDetects GoHighLevel, Calendly, and Cal.com booking completions
Stripe checkout redirectsDetects ?session_id=cs_* in the URL after a Stripe Payment Link redirect
Outbound link clicksTracks clicks to external domains
File downloadsTracks downloads (PDF, ZIP, etc.)
EngagementMeasures 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:

Manual identify call
window.atribuTracker.identify({
  email: "[email protected]",
  phone: "+1234567890"
});

Verify it is working

After installing the tracker:

  1. Visit your website in a browser (not incognito -- some ad blockers are more aggressive there)
  2. Open your Atribu dashboard
  3. Check the Online Now counter in the top right -- you should see at least 1 visitor
  4. 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:

1. A tracking key (idempotent)
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.

2. The installer payload
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.

3. Confirm an event arrived
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

On this page