This is a last-touch attribution system. We prioritize data sources that capture the customer’s most recent touchpoint before purchase.
Primary Attribution Source Hierarchy
The order attribution system evaluates data sources in this specific priority order:| Priority | Source Type | Description |
|---|---|---|
| 1 | Shopify Last Customer Visit | The final tracked visit before order placement, captured by Shopify’s customer visit tracking |
| 2 | Shopify Landing Site | UTM parameters extracted from the order’s landing page URL |
| 3 | Shopify Order Notes | UTM data written to order notes by tracking tools (Elevar, Blotout, etc.) |
| 4 | Website Event Tracking | First-party event pixels from GA4, Elevar, or other website analytics |
| 5 | Shopify First Customer Visit | The customer’s first tracked visit, captured by Shopify’s customer visit tracking |
| 6 | GA4/Universal Analytics | Transaction data from Google Analytics platforms |
| 7 | Shopify Order Referring Site UTMs | UTM parameters parsed from the order’s referring_site URL |
Website Event Tracking Details
For website event tracking sources (priority 4), the system uses qualifying events within a 90-day lookback window before the order. When multiple events exist, they’re ranked by:- Days between event and order (closer to order = higher priority)
- Event timestamp (earlier
event_local_datetimewins ties) - Event ID and source system (as final tie-breakers)
referral.
Shopify Order Notes (Priority 3)
Order notes are a key source for attribution data written by server-side tracking tools like Elevar and Blotout. These tools capture UTM parameters at checkout and write them to Shopify order notes.For Shopify V2 (Legacy)
The system extracts UTM data from note attributes with these keys:utm_source,utm_medium,utm_campaign,utm_content,utm_term,utm_id_elevar_visitor_info(parsed for nested UTM data)_source,_attribution
For Shopify V3 (GraphQL API)
The newcustomAttributes field has its own sub-priority system:
| Sub-Priority | Source Type | Example Keys |
|---|---|---|
| 1 | Direct UTM keys | utm_source, utm_medium, utm_campaign, etc. |
| 2 | Parsed from aggregate fields | utmParams, GE_utmParams (URL query string format) |
| 3 | Inferred from click IDs | gclid → google, fbclid → facebook, etc. |
Click ID to Channel Inference
When only a click ID is present (no explicitutm_source), the system infers the channel:
| Click ID | Inferred Channel | Channel Priority |
|---|---|---|
gclid | 10 (highest) | |
fbclid | 20 | |
ttclid | tiktok | 30 |
msclkid | microsoft | 40 |
irclickid | impact | 50 |
scclid | snapchat | 60 (lowest) |
gclid and fbclid), the channel priority determines which one is used to infer utm_source.
Click IDs are fallback only. If an explicit
utm_source exists, it takes precedence over any click ID inference.Allowlisted Attribution Keys
Only specific keys are extracted from order notes and custom attributes. This prevents accidental capture of non-attribution data:utm_source,utm_medium,utm_campaign,utm_content,utm_term,utm_idutmParams,GE_utmParams(aggregate query string fields)_source,_attribution
Click IDs are not allowlisted for raw extraction. Instead, when click IDs (
gclid, fbclid, ttclid, etc.) are present, they’re used only to infer a fallback channel-level utm_source value (e.g., gclid → google). The raw click ID values are not stored as attribution data.UTM Field Collapsing
After the primary source is determined, the system “collapses” supplementary UTM fields from lower-priority sources. Example: If priority 1 (Last Customer Visit) providesutm_source=google but no utm_campaign, and priority 2 (Landing Site) has utm_campaign=summer_sale, the final attribution will combine:
utm_source=google(from priority 1)utm_campaign=summer_sale(from priority 2)
utm_source grouped channel is the same across sources—we don’t mix data from different channels.

