How to Get Inquiry Attribution Right: First Touch, Last Touch, and 12 Click IDs
1. The First-Principles Problem: Many Sites Have Attribution Data That’s Dirty from the Source
Here are four common real-world errors, all of which occur before you “pick a model”:
| Mistake | Performance | Consequence |
|---|---|---|
| Same-domain redirects not filtered out | A customer jumps from an article page to a product page and it’s recorded as a “new source” | Organic traffic gets inflated and double-counted |
| Direct visits take the first-touch slot | A customer’s first visit was through Google, but first touch is recorded as “direct visit” | All first-touch channels are distorted |
| Click IDs expire and get lost | A conversion happens 30 days after an ad click, and the gclid is already gone | Ad performance gets underestimated |
| Treating visit environment as a channel | WeChat’s in-app browser is treated as “channel = WeChat” | Paid channels and WeChat get mixed together, making it impossible to tell what’s actually working |
Together, these four problems make an attribution report “look complete but actually be unusable”. So the correct order is:Fix the data source first, then pick a model. Below we break it down into three layers.
2. Layer 1: Identify “Source” Accurately
2.1 Priority for Determining Source
The source of a visit should be determined in the following order,and the order cannot be reversed:
| Priority | Basis for determination | Description |
|---|---|---|
| โ | Click ID parameters | Most reliable (gclid / fbclid, etc.) โ attribute directly when present |
| โก | UTM parameters | Manually tagged, second most reliable |
| โข | Referrer | Exclusion rules required, see below |
| โฃ | Direct visit | Fallback |
Why does Click ID take priority over UTM? Because UTMs are added manually and are easy to mistype, miss, or tamper with; Click IDs are appended automatically by the ad platform, so they are unique and cannot be forged.
2.2 Three referrer exclusion rules
Referrer is the most error-prone part. Three exclusion rules you must apply:
| Rule | How to do it | Why |
|---|---|---|
| Exclude same domain | When the referrer domain == your own domain, treat it as an internal navigation and do not overwrite the source | Otherwise internal clicks will keep “washing away” the real source |
| Normalize search engines | Group Google domains from different countries into one source | google.de/google.co.uk/google.com Should be unified as Google |
| Classify invalid referrers as direct visits | Empty referrer, from your own app, from an email client | Email client referrers are usually empty and easily misjudged |
Same-domain exclusion is the most important of the three. When a customer clicks from your blog post to a product page, if it is recorded as “new source = blog post”, their original source (say, Google search) is lost. Over time, reports show a false picture like “the blog is the biggest source”.
2.3 Rules for writing the first-touch slot
First Touch is written only when it actually brings back a source. This rule looks like a detail, but it determines the accuracy of the entire attribution system.
| Scenario | Write first touch? | Reason |
|---|---|---|
| First visit comes from Google search | โ Write | Has a clear source |
| First visit comes from an ad click (with gclid) | โ Write | Has a clear source |
| First visit is a direct visit (typing the URL / bookmark) | โ Do not write | No source information, cannot occupy the first-touch slot |
| First visit comes from internal navigation | โ Do not write | Not a real source |
Why doesn’t a direct visit occupy the first-touch slot? Because if it were allowed to occupy the slot, a customer who arrives via a brand keyword search (likely first recorded as a direct visit) would permanently lose their real first touch. In reality, a “direct visit” is often the effect of some earlier marketing effortโ it’s just that the source of that effort wasn’t recorded.
The correct approach: leave the first-touch slot empty and wait for the first visit that brings back a real source to fill it.
3. 12 Click IDs and the 90-day retention period
A Click ID is a unique identifier appended by the ad platform to the landing page URL. They are the only reliable means of cross-platform attribution, because only they can tell you “which platform, which click, which ad this visit came from”.
| # | Parameter name | Platform | Typical validity period | Purpose |
|---|---|---|---|---|
| 1 | gclid |
Google Ads | 30โ90 days | Search ad attribution |
| 2 | wbraid |
Google Ads (iOS) | 30โ90 days | Alternative under iOS privacy restrictions |
| 3 | gbraid |
Google Ads (iOS App) | 30โ90 days | In-app WebView scenario |
| 4 | fbclid |
Meta | 90 days | Facebook / Instagram ads |
| 5 | ttclid |
TikTok | 90 days | TikTok ads |
| 6 | li_fat_id |
30 days | LinkedIn ads | |
| 7 | msclkid |
Microsoft Ads | 90 days | Bing ads |
| 8 | twclid |
X (Twitter) | 30 days | X ads |
| 9 | yclid |
Yandex | 90 days | Yandex ads |
| 10 | epik |
30 days | Pinterest ads | |
| 11 | s_kwcid |
Adobe / some platforms | 30โ90 days | Enterprise Ad Tracking |
| 12 | irclickid |
Affiliate Marketing | 30โ90 days | Affiliate Channel Attribution |
Three key design decisions:
| Decision | How to do it | Why |
|---|---|---|
| Store separately | Each of the 12 ID types gets its own field, never merged into a single “click_id” | One user may carry several IDs at once, and each needs its own attribution |
| Keep for 90 days | Save for 90 days after first capture | Covers long B2B decision cycles (30โ60 days is common) |
| First capture wins | For each ID type, only the first is recorded; later ones don’t overwrite it | Keeps attribution stable and avoids last-click bias |
The 90-day retention decision matters especially for B2B. For industrial equipment, 45โ70 days commonly pass between the first ad click and the final inquiry submission. If Click IDs are kept for only 30 days, more than half of conversions fail to attribute, and ad performance is badly understated.
4. Layer Two: Four Attribution Models and How to Choose
Fix the data sources first, then worry about models.
| Model | Logic | Use cases | Limitation |
|---|---|---|---|
| First Touch | 100% credit to the first touch | Evaluate “who brought in new customers” | Understates the channels that close the deal |
| Last Touch | 100% credit to the last touch | Evaluate “who drove the conversion” | Gives direct visits and brand terms a huge advantage |
| Last Non-Direct | Credit to the last non-direct visit | Recommended default(same as GA4 default) | Requires handling direct visits correctly |
| Linear / Position-Based | Split credit across multiple touchpoints | Fine-tuning once you have many touchpoints | Requires a longer data history |
Why is Last Non-Direct the recommended default?
Because pure Last Touch has a serious flaw:the last step before many conversions is a “direct visit”(the customer has already decided to contact you and opens your site to fill in the form). Counted as Last Touch, all those conversions go to “direct visit,” making every channel look useless.
The right approach: trace back to the last touch that carried a source. This is the standard used by GA4 and most modern analytics tools.last_non_direct standard.
One practical tip: look at both at once.
| Which one to look at | What question it answers |
|---|---|
| First Touch | Which channel brings in new customers? (In B2B, usually content and organic search) |
| Last Non-Direct | Which channel drives conversions? (Usually brand terms and retargeting) |
Looking at only one will always mislead you. The classic mistake: looking only at Last Touch and concluding “SEO doesn’t work, ads work best” โ because ads are often the last click before conversion. In reality,SEO content built awareness first; the ad just got a free ride.
5. Layer Three: WeChat Is a “Visit Environment,” Not a “Channel”
This is often confused in Chinese go-global scenarios and deserves its own explanation.
The built-in browser in WeChat (including WeCom) is a “visit environment,” which is an orthogonal dimension to “channel.”
| Dimension | Example values | Questions answered |
|---|---|---|
| Channel | Organic search / paid ads / social / direct visit / email | Where did they come from? |
| Visit environment | WeChat / WeCom / regular browser / in-app WebView | What environment are they visiting from? |
Why keep them separate? Here’s a concrete example:
| Scenario | Channel | Visit environment | Correct reading |
|---|---|---|---|
| A customer opens a link a friend shared in WeChat | Social (share) | WeChat is the carrier; the channel is social | |
| A customer opens your ad in WeChat | Paid advertising | Paid gets top priority and can’t be overridden by WeChat | |
| A customer types your URL directly into WeChat | Direct visit | Environment is WeChat, channel is direct | |
| A customer opens the document you sent in WeCom | Email / IM send | WeCom | Environment is WeCom |
Mix them together and you get two kinds of errors:
| What not to do | Consequence |
|---|---|
| Using “WeChat” as the channel value | Paid ad results get filed under “WeChat,” so you can’t measure your ad spend |
| Ignoring the visit environment dimension | You don’t know the customer’s visit environment, so you can’t improve the share experience or adapt the landing page |
The right approach: store channel and visit environment in separate fields, give paid channels top priority (never overridden by environment), and keep WeChat as its own field alongside them. That way you can measure both “how many inquiries did ads bring in” and “how many of those came from WeChat.”
6. Visitor attribution: how to determine country and city
Attribution isn’t just about knowing where they came from, but which country they came from โ that’s baseline data for any overseas business. There are two modes here, each with trade-offs:
| Model | Rationale | Accuracy | External request | Best for |
|---|---|---|---|---|
| Lightweight mode (default) | Country header from the CDN + browser timezone inference | Country (timezone can help) | zero | Most overseas sites |
| Precise mode | IP lookup API configured by the site owner | Country + city | Requires API configuration | When you need city-level data |
Why is lightweight mode the default? Because one visitor session triggers multiple resource requests, and if every request hits the IP database, you run into three problems:Slower responses, an external dependency (if the API goes down, everything goes down), and privacy compliance risk (sending visitor IPs to a third party). Lightweight mode uses the country info the CDN already puts in the response headers, at zero extra cost.
When do you need precise mode? When you need to answer questions like “which city sends the most inquiries, and should we do local outreach or attend a trade show there?” That’s when configuring the API is worth it.
7. Common mistakes and acceptance checklist
Seven common mistakes
| # | Mistake | Consequence | Fix |
|---|---|---|---|
| 1 | Same-domain referrer not excluded | Internal navigation overwrites the real source | Add a same-domain exclusion rule |
| 2 | Direct visits take the first-touch slot | First-touch channel distorted | First touch only records visits with a source |
| 3 | Click ID stored for only 30 days | Long B2B conversion cycles lose attribution | Extend to 90 days |
| 4 | Click ID merged into one field | Attribution breaks when multiple channels coexist | Store 12 separate fields |
| 5 | Looking only at Last Touch | Underestimates the role of content and SEO | Look at both First and Last Non-Direct |
| 6 | Treating WeChat as a channel | Paid results get buried | Store channel and environment orthogonally |
| 7 | Recording attribution with client-side scripts | Privacy settings / ad blockers cause missing data | Record key data server-side |
Launch Acceptance Checklist
| Checklist | How to verify | Pass criteria |
|---|---|---|
| Same-domain navigation does not overwrite the source | Jump from inner page A to inner page B and check whether the source changes | Source stays the same |
| First touch is only written when a source is present | Visit as a new visitor with no source and check the first-touch field | First touch is empty, then written after a second visit with a source |
| Click ID is captured correctly | Visit using a link with ?gclid=test123 link visit |
test123 is visible in the database |
| Click ID retention period | Simulate a visit 60 days later | Attribution still matches |
| Channel and environment fields are kept separate | Visit inside WeChat with a link containing ?gclid= link |
Channel = paid, environment = WeChat |
| First visit is linked to conversion | Submit a test inquiry | The inquiry record contains the full source chain |
| Data can be exported | Export inquiry data from the last 30 days | Includes source, Click ID, country and environment fields |
FAQ
| Issue | Which one to look at |
|---|---|
| Where do new customers come from? | First Touch |
| Which channel drives the conversion? | Last Non-Direct |
| Which channels appear at both ends? | Compare the two โ channels with high overlap have the most reliable value |
| Channel type | Recommended attribution window |
|---|---|
| Paid search (brand terms) | 30 days |
| Paid search (generic terms) | 60โ90 days |
| Social ads | 30โ90 days |
| Organic search / content | 90+ days (better to skip a hard window and keep it long-term) |
| Trade shows / offline | Manual entry, no window limit |
Final thoughts
The value of attribution isn’t in “how precisely you calculate it” โ it’s that it decides where your next budget goes.
If the data is dirty, the conclusions are wrong; wrong conclusions send budget to channels that “look effective but are really just taking a free ride.” Meanwhile the path that’s actually bringing in new customers (often content and organic search) gets cut because it shows no immediate return โthis is the most common misallocation of resources for companies going global.
So the right order for attribution is:clean up the data sources first (same-domain exclusion, first-touch rules, Click ID retention period, separating channel from environment), then talk about model choice. The former is an engineering problem โ get it right once and you benefit long-term; the latter is an analysis problem โ you can keep adjusting it as your understanding evolves.
