All articles

Browser tracker (`uts-tracker.js`)

Hosted from the API origin (e.g. https://analytics.getsolarmax.com/uts-tracker.js) and embedded in site layouts.

Responsibilities

  1. Bootstrap — Load/configure gtag (GA4 + Google Ads IDs when provided), Meta Pixel stub if applicable, Microsoft Clarity, dedupe logic.
  2. Identity — Persist visitor_id and session_id (localStorage / cookies per implementation).
  3. Attribution capture — Parse URL params (gclid, fbclid, UTMs), merge with stored attribution.
  4. sendEvent(name, category, data) — Build payload, fire browser destinations (gtag, fbq, Clarity), then sendBeacon/fetch to POST /track.

Google vs Meta on the client

  • gtag events are emitted when the library is configured—independent of whether traffic came from Google or Facebook (unless you add custom gating).
  • fbq only talks to Meta.

Server-side Google Ads offline conversions still require Google click IDs—see Server forwarding.

Related