Hosted from the API origin (e.g. https://analytics.getsolarmax.com/uts-tracker.js) and embedded in site layouts.
Responsibilities
- Bootstrap — Load/configure
gtag(GA4 + Google Ads IDs when provided), Meta Pixel stub if applicable, Microsoft Clarity, dedupe logic. - Identity — Persist
visitor_idandsession_id(localStorage / cookies per implementation). - Attribution capture — Parse URL params (
gclid,fbclid, UTMs), merge with stored attribution. sendEvent(name, category, data)— Build payload, fire browser destinations (gtag,fbq, Clarity), thensendBeacon/fetchtoPOST /track.
Google vs Meta on the client
gtagevents are emitted when the library is configured—independent of whether traffic came from Google or Facebook (unless you add custom gating).fbqonly talks to Meta.
Server-side Google Ads offline conversions still require Google click IDs—see Server forwarding.