Install the tracking script

One <script> tag in the <head>. The pixel is ~1.3 KB gzipped, runs deferred, and never blocks rendering.

The snippet

Replace site_xxx with your Site ID — find it in Dashboard → your site → Settings → Site ID.

html
<script defer
  src="https://tracerev.com/track.js"
  data-site="site_xxx"></script>

Paste it as high as possible in <head>, before any analytics or A/B testing tools. The earlier it loads, the earlier the visitor cookie is set.

Shopify-specific install
Online Store → Themes → Edit code → theme.liquid → paste inside <head>. Save. Same for WooCommerce — drop it in your theme's header template.

What gets tracked automatically

The pixel fires a pageview event on first load and on every SPA route change. Each event includes:

  • URL, path, and referrer
  • UTM parameters from the current URL: utm_source, utm_medium, utm_campaign, utm_term, utm_content
  • Screen size and browser language
  • User agent (parsed server-side into browser / OS / device)
  • Country / region / city (resolved server-side from IP, then the IP is hashed and discarded)

What we don't track

  • No keystrokes, mouse movements, or session replay
  • No third-party cookies — everything is first-party on your domain
  • No raw IPs stored — IPs are SHA-256-hashed at the edge before insert
  • No fingerprinting beyond UA + screen size

Cookies the pixel sets

NameLifetimePurpose
trace_visitor_id1 yearStable visitor identifier. The key Trace joins charges back to.
trace_session_id30 minutesRolling session window for grouping pageviews into visits.

Both cookies are first-party (set on your apex domain when not on localhost), SameSite=Lax, and use document.cookie — no cross-site tracking.

Single-page-app navigation

Trace patches history.pushState and listens for popstate, so SPAs (Next.js, Remix, Astro view-transitions, vanilla React) get a fresh pageview on every route change without any extra code.

If your router does something exotic and pageviews are missing, fire one manually:

js
window.trace.pageview();

Custom events

The pixel exposes window.trace.track(name, props) for things like add-to-cart, checkout-started, or quiz-completed. Useful for funnel analysis even when not the primary attribution signal.

js
window.trace.track('Add to cart', {
  product_id: 'sku_001',
  price: 39.0,
  variant: 'unflavored-90ct'
});

See Identify users & events for the email-capture call.

Verifying the install

  1. Open your store in an incognito window with DevTools → Network → filter collect.
  2. Reload. You should see a POST /api/v1/collect with status 200. Most pageviews go via navigator.sendBeacon, which DevTools sometimes labels as type ping.
  3. Switch to Application → Cookies → confirm trace_visitor_id is set.
  4. In your Trace dashboard, the Overview tab should show the pageview within ~10 seconds. The Live events feed in the dashboard surfaces them in near real time.

If you don't see the request, see troubleshooting.