SDK
Attribution & click IDs
UTM strategy, click ID persistence, cross-domain _aid, short links, magic links.
Attribution data flows from the URL into each event context. The SDK deliberately avoids persisting UTMs in localStorage — doing so would poison multi-touch models. Click IDs for ad platforms are persisted with last-touch semantics.
UTM parameters
| Param | Persisted? | Creates touchpoint |
|---|---|---|
| utm_source | No — URL only | Yes, per landing with UTMs |
| utm_medium | No | Yes |
| utm_campaign | No | Yes |
| utm_content | No | Yes |
| utm_term | No | Yes |
Click IDs (CAPI-critical)
| Param | Platform | Persistence |
|---|---|---|
| fbclid | Meta | Last-touch in localStorage |
| gclid | Google Ads | Last-touch |
| ttclid | TikTok | Last-touch |
| msclkid | Microsoft | Last-touch |
| li_fat_id | Last-touch |
// Site A — marketing landing
const url = tracker.link('https://app.example.com/signup');
// → https://app.example.com/signup?_aid=anon_xyz
// Site B — product app (same or different init)
tracker.init({ endpoint: 'https://api.trackrift.com', publicId: 'YOUR_PUBLIC_ID' });
// bootstrap reads ?_aid= and adopts anonymous_idMagic links (?_uid=)
Email campaigns can include ?_uid=<signed_token>. On load the SDK POSTs to /m to merge the anonymous journey with a known identity without a login form.