Attribution is the question what brought this customer here? Itβs harder than it sounds, because the answer has to survive a visitor leaving, coming back three times, and buying two weeks later. Your storefront records the whole journey.
What gets recorded on arrival
Every visit is examined for:
Advertising click IDs β the tracking code an ad platform appends when someone clicks an ad. We capture ten:
| Click ID | Platform |
|---|---|
gclid, gbraid, wbraid |
Google Ads |
fbclid |
Meta |
msclkid |
Microsoft / Bing |
ttclid |
TikTok |
li_fat_id |
|
epik |
|
twclid |
X / Twitter |
rdt_cid |
Campaign tags (UTMs) β utm_source, utm_medium, utm_campaign, utm_content, utm_term.
Referrer β where they came from when thereβs no ad or campaign tag.
How the referrer is classified
| Category | Examples |
|---|---|
| Search | Google, Bing, DuckDuckGo, Yahoo, Ecosia, Brave |
| AI assistants | ChatGPT, Perplexity, Claude, Gemini, Copilot |
| Social | Facebook, Instagram, X, LinkedIn, TikTok, Reddit, Pinterest, YouTube |
| Referral | Everything else, recorded by hostname |
π‘ Tip: AI assistants are broken out as their own channel rather than lumped into generic referrals. As more shopping research starts in an AI chat, this lets you see that traffic as a distinct source instead of it disappearing into a list of hostnames.
The journey, not just the last click
Most setups record only the most recent source. Yours keeps a rolling 90-day journey of up to ten touchpoints, so you can see both:
- First touch β what originally introduced them
- Last touch β what brought them back to buy
That difference matters. A customer might discover you through a Google ad, return via an email, and buy after a direct visit. Last-click gives all the credit to βdirectβ, which tells you nothing useful about where to spend.
βΉοΈ Note: Both first- and last-touch source, medium, and campaign are attached to every event β including the purchase β so you can segment revenue by either.
Why click IDs are kept
Storing the click ID means a sale weeks later can still be matched back to the exact ad click, even after the visitor has closed the browser and returned several times. For a business where research takes weeks β equipment, parts, anything considered β this is the difference between an ad looking worthless and looking profitable.
The click ID is also carried into lead submissions, so an offline conversion β a quote that closes over the phone a month later β can still be credited to the ad that started it.
Tagging your own campaigns
Anywhere you control the link, add UTM parameters and the campaign is attributed precisely.
https://yourstore.com/product-page
?utm_source=newsletter
&utm_medium=email
&utm_campaign=spring-sale
Print, direct mail, and QR codes. Offline has no referrer, so tag it explicitly. The cleanest approach is a short vanity URL that redirects to a tagged one:
- Print something short and memorable β
yourstore.com/spring - Add a redirect to
/?utm_source=postcard&utm_medium=direct_mail&utm_campaign=spring26
Short enough for a postcard, fully attributed on arrival, and you can repoint the campaign later without reprinting.
π‘ Tip: Use
utm_medium=aifor links you place in AI assistants or AI ad platforms, so paid and organic AI traffic group together.
Known limits
- AI referrals are undercounted. Assistants often strip the referrer, so some of that traffic lands in Direct. Tagged links are exact; organic mentions are a floor, not a true count.
- Bing Chat canβt be separated from Bing search β it reports the same hostname.
- Consent applies. Under a denied-by-default posture, attribution for non-consenting visitors is modeled rather than measured. See Cookie Consent & Privacy.
