Docs

Attribution and channels

Attribution keys

3x stores 13 campaign parameters per session, taken from the URL of the entry pageview:

GroupKeys
UTMutm_source, utm_medium, utm_campaign, utm_content, utm_term, utm_id
Click idsgclid, gbraid, wbraid (Google), fbclid (Meta), li_fat_id (LinkedIn), ttclid (TikTok), msclkid (Microsoft)
  • Click ids are kept complete (up to 256 characters) because conversion uploads need them.
  • UTM values are cut to 100 characters. Values that look like e-mail addresses are dropped; UTM values that look like phone numbers are dropped. Pure digit ids stay.
  • Projects can redact values with regular expressions (for example post-XXXX → post-:code for personalized letters).
  • attr_from records where the attribution came from: url, stored or none.

First touch across sessions

With consent and tracking.firstTouch.enabled, the SDK stores the first attribution it sees in localStorage (<prefix>attribution) and uses it for later sessions without URL attribution (attr_from = stored). Before consent nothing is written, so first touch is per session only.

Campaign changes split sessions

A pageview whose URL attribution differs from the session's entry attribution on any key starts a new session, so every session belongs to exactly one campaign.

Channels

The channel of a session is derived from its entry attribution and referrer host. Rules are versioned per project: a published version never changes, so historic data stays comparable.

VersionUsed byChannels
1The CPI preset (identical to cpi-website2)google_ads, google_organic, linkedin, meta, bing, direct, referral, other
2New projects (default)v1 plus tiktok, email, ai_assistant, search_other, social_other

Rules of version 2, first match wins:

  1. Click ids: gclid/gbraid/wbraid → google_ads; fbclid → meta; li_fat_id → linkedin; msclkid → bing; ttclid → tiktok.
  2. utm_source: AI assistants (chatgpt, perplexity, claude, gemini, copilot, …) → ai_assistant; e-mail media or newsletter tools → email; google/adwords/googleads → google_ads when the medium is paid (cpc, ppc, paid, sem, display, pmax, youtube, …) or the source is not plain google, else google_organic; linkedin/li/lnkd → linkedin; facebook/instagram/fb/ig/meta → meta; bing/microsoft → bing; tiktok/tt → tiktok; other search engines → search_other; other social networks → social_other; any other source → other.
  3. Referrer host: none or own host → direct; AI assistant hosts → ai_assistant; webmail → email; google.* → google_organic; bing.com/msn.com → bing; LinkedIn, Meta, TikTok hosts → their channel; other search engines and social networks → search_other / social_other; anything else → referral.

Changing a project's version affects new sessions only.

The filter traffic=paid selects sessions with any ad click id or a paid utm_medium (cpc, ppc, paid, paid_social, display, cpm, …); traffic=organic selects the rest. This is the "ads vs all" split used on the leads and funnels pages.

Ad entities

Beyond channels, sessions are matched to the exact campaign, ad set and ad that brought them when ad accounts are connected – see Matching sessions to ads. The recommended UTM templates make those matches exact.