Skip to content

Installation

The Attri tracking script is a lightweight snippet you add to your website. We’ve spent a lot of time keeping it small and fast. It captures pageview and conversion events and connects them back to the shortlinks that drove the traffic.

Your snippet is personalized to your workspace, so copy it from the app rather than typing it out:

  1. In Attri, open Settings > Tracking.
  2. Click Copy on the tracking snippet.
  3. Paste it into the <head> of every page on your site.

The snippet is a single inline <script> tag. It sets up tracking and loads the rest of the script (a.js) from cdn.attri.io for you, so this one tag is all you need.

Place the Attri snippet ahead of other analytics tags (GA4, Meta Pixel, and similar). Attri normalizes and corrects your UTM parameters as the page loads, and other tags should read the corrected values. If you install through a tag manager, set the Attri tag to fire before any analytics tags.

When the snippet runs, it:

  1. Reads and normalizes UTM parameters on the current page URL
  2. Sends a pageview event to Attri’s analytics pipeline
  3. Watches for conversion events (if configured)

Whether it also sets first-party cookies and how it identifies visitors depends on your consent mode. In Full mode it stores a visitor and session identifier in cookies. In Anonymous mode it sets no cookies at all. See Consent & Privacy for the full breakdown.

The script loads asynchronously, so it won’t block your page from rendering. That’s by design.

After installing, visit your website and open the Dashboard in Attri. Pageview events show up within a few seconds (we typically see them in under two seconds in our testing).

You can also open your browser’s developer tools and watch the Network tab for a request to attri.io. To confirm which cookies are set for your consent mode, check the Application tab. See Consent & Privacy for what to expect in each mode.

The snippet goes in the site-wide <head>, the same place you would add any analytics tag. A few common spots:

Paste the copied snippet into the <head> of your root layout (app/layout.tsx), inside a raw <script> tag so it runs before your other analytics.

Add it in Settings > Header Scripts, or use a plugin like Insert Headers and Footers.

Go to Online Store > Themes > Edit code > theme.liquid and paste the snippet inside the <head> section.

Add it as a Custom HTML tag that fires on all pages, and set its firing priority above any analytics tags so parameter correction runs first.