/conversion-tracking전환 추적 설정
폼·구매 전환이 광고 플랫폼에 정확히 잡히게 설정해요.
어떤 채널이 실제로 매출을 만드는지 가려내요.
$ npx skills add coreyhaines31/marketingskills --skill attribution터미널에서 프로젝트 폴더를 연 다음 붙여넣어요. 설치하면 Claude가 필요할 때 이 스킬을 꺼내 써요. 모든 프로젝트에 쓰려면 -g를 붙여요.
원문은 영어예요. 위 설명은 Velin이 원문을 읽고 정리했어요.
You help users answer the hardest question in marketing: which of my efforts actually caused this conversion and this revenue? Attribution is where marketers lose the most money — to channels that look good in one dashboard and terrible in another, to "direct" and "branded search" that hide the real source, and to models that quietly encode an opinion as if it were fact.
This skill has two pillars. Know which one the user needs before you dive in:
Most requests start with (A). Reach for (B) only when they control the surface and want to build.
Product context: check for .agents/product-marketing.md and read it if present — business type, sales cycle, and primary conversion drive almost every recommendation here.
State these up front so you don't rebuild neighboring skills:
Set expectations before touching a number:
When a user demands one true number, reframe: "We can get you a defensible, consistent number and a read on which channels are trending up. A single objective truth doesn't exist — here's why, and here's what we use to make decisions anyway."
The classic rule-based set plus data-driven — and when each one lies. Last non-direct is a last-touch variant (skip the junk drawer), not a separate school of thought.
| Model | Credit rule | Best for | How it lies |
|---|---|---|---|
| First-touch | 100% to the first known touch | Top-of-funnel / demand-gen valuation; short cycles | Ignores everything that closed the deal; over-credits awareness channels |
| Last-touch | 100% to the last touch before conversion | Direct-response, quick e-comm | Over-credits bottom-funnel + branded search/direct; ignores what created demand |
| Last non-direct | 100% to last touch, skipping "direct" | A cheap fix for direct pollution | Still single-touch; just moves the blind spot |
| Linear | Equal credit to every touch | Long, multi-touch journeys where every step matters | Treats a throwaway visit like a demo; flatters high-frequency channels |
| Time-decay | More credit to touches nearer conversion | Longer cycles where recency matters | Under-credits the top of funnel; still an assumption, not a measurement |
| Position-based (U-shaped) | 40% first, 40% last, 20% middle | B2B with clear "created" + "closed" moments | The 40/40/20 split is arbitrary; middle touches get shortchanged |
| Data-driven (algorithmic/Shapley) | Credit from modeled marginal contribution | High-volume accounts with enough conversions | A black box; needs volume; can't see offline/dark touches it was never fed |
Platform availability note: Google Ads and GA4 retired first-click, linear, time-decay, and position-based as selectable reporting models (2023). Those UIs offer data-driven and last-click (plus GA4's paid-channels last-click variant). Teach the full table as concepts and as models you can compute on your own event path / CRM / warehouse — not as Google dropdown options.
Rules of thumb:
For the model math, worked examples of one journey scored six rule-based ways, and Shapley explained plainly, see references/attribution-models.md.
Models split credit within your tracked data. Paradigms are how you get at causality — increasingly rigorous, increasingly expensive:
| Paradigm | What it is | Answers | Needs | Watch out |
|---|---|---|---|---|
| MTA (multi-touch attribution) | Stitch user-level touches, apply a model | "Which touchpoints appear on converting journeys?" | Clean cross-device user-level tracking | Cookie loss + privacy gut user-level data; click-paths systematically over-weight search/direct and under-weight impression channels |
| MMM (media/marketing mix modeling) | Top-down regression of spend vs. outcomes over time | "What's each channel's aggregate contribution, including offline/brand?" | 2–3 yrs of weekly data, spend variation | Correlational; slow to react; needs real budget swings to learn |
| Incrementality (geo holdout, PSA, ghost ads, on/off) | Controlled experiment: exposed vs. withheld | "Did this channel cause lift I wouldn't have gotten anyway?" | Ability to withhold; enough volume for significance | The gold standard, but you can only test a few things at a time |
How to choose: small budget / short cycle → good UTM + last-non-direct + a self-reported survey beats a fancy model. Mid budget, several channels → MTA for day-to-day + periodic incrementality tests on your biggest line items. Large budget, offline + brand spend → MMM for the portfolio + incrementality to validate MMM's coefficients. Incrementality is the tiebreaker whenever two channels both claim the same conversions.
Decision table by budget × sales cycle × channel count, and how to read a geo-holdout / PSA test (not a stats tutorial), in references/measurement-paradigms.md.
The most underused signal, and often the most honest for long cycles and dark social. A post-conversion "How did you hear about us?" survey catches what tracking structurally cannot: podcasts, word of mouth, Slack communities, a founder's tweet, "a friend told me."
references/first-party-tracking.md.The request behind most attribution work: "Google says 50, Meta says 40, GA says 60, my CRM says 35 — who's right?" Nobody is. Here's the framework.
Why each source systematically lies:
| Source | Biased toward | Because |
|---|---|---|
| Ad platforms (Google/Meta/LinkedIn) | Over-counts itself | Claims view-through + click conversions in its own window; every platform counts the same sale; motivated to look good |
| GA / web analytics | Last non-direct click | Loses cross-device, loses cookie-blocked users, dumps the unknown into direct |
| CRM | Whatever the rep typed / the form captured | Human entry, lead-source overwrites, offline deals with no digital trail |
| Self-reported survey | The memorable touch | Recall bias; under-counts boring-but-real touches like retargeting |
How to triangulate:
references/measurement-paradigms.md.The output is an honest allocation with confidence levels, not a false reconciliation to the decimal.
Where conversions hide, making real channels look weak:
When direct and branded search dominate, the most common explanation is a top of funnel that's working while attribution hides it. Confirm before concluding: rule out existing customers, lost referrers, and offline discovery, then check self-reported attribution or run an incrementality test. It's the most common misread in marketing in both directions, so say which one the evidence supports.
Defaults differ sharply. Summary here; full playbooks in references/by-business-type.md.
Use this when the user controls the site/app and wants to instrument attribution themselves — especially for a conversion that happens on a domain they don't own (a SavvyCal/Calendly/Cal.com booking, a Stripe Checkout page). This pillar is grounded in real production builds; the full runbook with code patterns is in references/first-party-tracking.md. The essentials:
First-party attribution is one idea: join anonymous browsing to the eventual conversion.
distinct_id and stamps first-touch properties ($initial_referrer, $initial_utm_*) on their events.identify() with a stable id (email or user UUID). This merges the anonymous history into a known person — first-touch now survives all the way to the conversion.identify() gapThe most common first-party failure: nothing ever calls identify(), so conversions never join to browsing history and every customer looks like they appeared from nowhere. (Framing adapted from Tessa Kriesel's PostHog approach.) The fix is to call identify at each real conversion. Audit first — many SaaS apps already identify at signup; don't rebuild what works. Find the specific un-instrumented conversions and close only those.
The one case that needs real machinery: a conversion that completes on a domain you don't control (a booking tool, a hosted checkout). You can't run your analytics there, so:
distinct_id to the outbound URL via the tool's metadata passthrough (e.g. ?metadata[ph_distinct_id]=<id>). One document-level listener covers every CTA — no per-link edits.$identify with the booking email as distinct_id and the smuggled anonymous id as $anon_distinct_id) plus a conversion event — joining the booking back onto the marketing journey.identify(), the current id becomes the user's email/UUID; leaking that into a third-party URL or merging on it corrupts profiles (person A's email folds into whoever books). Reject ids that look like PII (contain @), cap length, and when identity is ambiguous, send nothing. If the app identifies by UUID, test distinct_id === device_id rather than an @ check.accounts.google.com, checkout.stripe.com, login.*), your own subdomains (self-referrals), and dev hosts (localhost) from referrer classification. This is usually a settings change, not code, and it's the highest-trust-per-effort fix.The first payoff is one insight: your conversion event broken down by first-touch channel ($initial_utm_source / $initial_referring_domain), and — joined to revenue — channel → conversion → revenue. Confirm first-touch vs. last-touch config in the tool (many default to last-touch; first-party attribution wants $initial_*).
But first-touch alone can't run the multi-touch models from §2. Store the full ordered touch path (not just $initial_*) and the build track feeds the interpretation track — you can score your own journeys position-based / linear / time-decay instead of only reading about them.
The last mile — get it into the CRM (production refinement from Tessa Kriesel). A breakdown in an analytics tool is a report; sales and lifecycle act on attribution written onto the record. Sync a source field with confidence and basis (journey-linked vs self-reported vs campaign-window fallback) plus a Paid-vs-Organic read off the medium, rolled up to the account (not just the contact — one B2B org is several people with mixed work/personal emails). How pipeline/lifecycle then use it is revops' job.
The pattern is tool-agnostic: identify + merge exists in PostHog, Segment, Amplitude, and via user-id in GA4; the third-party stitch works with any tool that has a metadata passthrough + webhook. PostHog + SavvyCal are the worked example in references/first-party-tracking.md.
Deliver an attribution readout, not a data dump:
# Attribution Readout — [date]
## The question
[What decision this informs — e.g. "where should next quarter's budget go?"]
## Source of truth
[Which system defines the conversion count, and why]
## What each source says
| Channel | Platform-reported | GA | CRM | Self-reported | Our read |
|---------|------------------|----|----|--------------|----------|
[De-duped against source of truth; not summed]
## Model comparison (for long cycles)
[First-touch vs last-touch side by side; the gap is the insight]
## Confidence & gaps
[The attribution gap, the blind spots, what we can't see]
## Recommendation
[Allocation call with confidence levels; the tiebreaker test worth running]
For implementation, see the tools registry. Key tools:
| Tool | Best For | MCP | Guide |
|---|---|---|---|
| PostHog | First-party attribution, identify/merge, funnels | - | posthog.md |
| GA4 | Web analytics, model comparison, user-id stitching | ✓ | ga4.md |
| Dub | Short-link + click attribution | ✓ | dub-co.md |
| Segment | CDP — route identify/track to every destination | - | segment.md |
| HubSpot | CRM lead-source + self-reported fields | ✓ | hubspot.md |
| Salesforce | CRM as revenue source of truth | - | salesforce.md |
| Supermetrics | Pull platform numbers into one place to reconcile | ✓ | supermetrics.md |
| RB2B | De-anonymize B2B website visitors | - | rb2b.md |
{
"skill_name": "attribution",
"evals": [
{
"id": 1,
"prompt": "Google Ads says we got 50 conversions last month, Meta says 40, GA4 says 60, and our CRM shows 35 closed deals. Which one is right? I need to know our real numbers before I set next quarter's budget.",
"expected_output": "Should explain that none is 'right' and that summing across platforms is wrong (overlapping claims for the same conversions). Should establish a single source of truth for the conversion COUNT — here the CRM/backend where revenue is real — and treat other sources as explaining where those came from, not redefining how many. Should explain why each source is biased (ad platforms over-count themselves incl. view-through; GA loses cross-device and dumps unknowns into direct; CRM depends on human/form entry; surveys have recall bias). Should recommend reading directional agreement over absolute match, de-duping against the source of truth, and using self-reported / incrementality as tiebreakers. Should set expectation that an attribution gap is normal and deliver an allocation with confidence levels, not a false reconciliation.",
"assertions": [
"States that no single source is objectively right",
"Explicitly warns against summing conversions across platforms (overlapping claims)",
"Picks one source of truth for the conversion count (CRM/backend)",
"Explains the systematic bias of at least three sources",
"Recommends reading directional trends over absolute matching",
"Mentions the attribution gap as expected and to be explained, not eliminated",
"Does not fabricate a single reconciled number as if it were truth"
],
"files": []
},
{
"id": 2,
"prompt": "Should we use first-touch or last-touch attribution? We're a B2B SaaS with a sales cycle that runs about two months and multiple people involved in each deal.",
"expected_output": "Should refuse to pick one in isolation and recommend showing first-touch and last-touch side by side, because the gap between them is the insight for a long cycle. Should explain what each model over/under-credits (first-touch ignores what closed; last-touch over-credits branded search/direct and defunds top of funnel). Should recommend position-based as a defensible primary for B2B on the team's own path/CRM data (credits created + closed bookends) — not as a Google Ads/GA4 dropdown option (those UIs retired rule-based models). Should lean on self-reported attribution at demo/signup given offline touches. Should point to CRM/pipeline as source of truth (revops) and note data-driven attribution needs volume this business likely lacks. May reference references/attribution-models.md and references/by-business-type.md.",
"assertions": [
"Does not recommend a single model in isolation",
"Recommends showing first-touch and last-touch together",
"Explains what first-touch and last-touch each distort",
"Recommends position-based as a strong B2B primary on own/CRM data (not as a Google UI model)",
"Emphasizes self-reported attribution for long/offline B2B cycles",
"References pipeline/CRM as the revenue source of truth (revops boundary)"
],
"files": []
},
{
"id": 3,
"prompt": "Our biggest conversion is a sales call people book through SavvyCal, but that happens on savvycal.com so PostHog loses the whole journey. How do we connect a booking back to where the visitor originally came from? We control the marketing site.",
"expected_output": "Should recognize this as first-party attribution on a third-party domain (Pillar B) and lay out the identity-graph stitch: append the visitor's ANONYMOUS distinct_id to the SavvyCal link at click time via the metadata passthrough (metadata[ph_distinct_id]), using a capture-phase document-level listener so all CTAs are covered without per-link edits; SavvyCal returns the metadata in its booking webhook; the webhook fires an $identify merge ($anon_distinct_id = smuggled id, distinct_id = booking email) plus a conversion event. Must stress the anonymity guard — only smuggle the anonymous id, reject email-shaped/PII values, fail closed when ambiguous — and hardening (verify signature, timeout, non-fatal, log ids not emails). Should note first-touch data-quality cleanup and confirming first-touch vs last-touch config. Should point to references/first-party-tracking.md and credit that this method (closing the identify gap) is adapted from Tessa Kriesel's approach. Should suggest auditing whether the self-serve funnel already identifies before building.",
"assertions": [
"Identifies the metadata-passthrough + webhook stitch pattern",
"Describes appending the anonymous distinct_id at click time via a capture-phase listener",
"Describes the webhook $identify merge (anon id + email) plus conversion event",
"Emphasizes the fail-closed anonymity guard (never smuggle identified/PII ids)",
"Includes webhook hardening (signature, timeout, non-fatal, no email logging)",
"Recommends auditing existing identify() coverage before building",
"References first-party-tracking.md"
],
"files": []
},
{
"id": 4,
"prompt": "Meta says our retargeting campaign has a 6x ROAS so we keep scaling it, but revenue isn't really going up. What's going on?",
"expected_output": "Should explain platform-reported ROAS is systematically inflated (self-crediting, view-through, generous windows, post-ATT modeling) and that reported ROAS is not incremental ROAS — retargeting especially claims conversions that would have happened anyway. Should introduce incrementality: run a holdout (withhold retargeting from a random % or geo) and measure the lift; incremental CPA/ROAS uses only the incremental conversions. Should explain that flat revenue alongside high reported ROAS is the classic signature of low incrementality. Should recommend the on/off or holdout test as the tiebreaker. May reference references/measurement-paradigms.md.",
"assertions": [
"Explains platform ROAS is inflated / not incremental",
"Distinguishes reported conversions from incremental conversions",
"Recommends an incrementality test (holdout/geo/on-off) to measure true lift",
"Explains high reported ROAS + flat revenue indicates low incrementality (esp. retargeting)",
"Frames incremental CPA/ROAS as the number that should drive budget"
],
"files": []
},
{
"id": 5,
"prompt": "Half of our conversions show up as 'direct' in analytics and a big chunk of the rest is branded search. Does that mean direct traffic is our best channel?",
"expected_output": "Should say no — direct is the junk drawer (bookmarks/typed URLs but mostly stripped referrers, dark social, app-to-web, and dropped tracking) and branded search is people who discovered you elsewhere then searched your name. Both are where demand created upstream cashes out, not channels to invest in. Should warn that crediting them (last-touch) defunds the top of funnel that actually created the demand. Should recommend segmenting branded vs non-branded search, using self-reported attribution to surface dark social, and treating a large direct share as evidence top-of-funnel is working but under-measured. Should mention AI traffic as a growing contributor to this blind spot (hand deeper work to ai-seo).",
"assertions": [
"States direct is not a real channel (junk-drawer / measurement gap)",
"Explains branded search reflects demand created by other channels",
"Warns that crediting these defunds top-of-funnel",
"Recommends segmenting branded vs non-branded search",
"Recommends self-reported attribution to reveal dark social",
"Mentions AI traffic as part of the blind spot and points to ai-seo"
],
"files": []
},
{
"id": 6,
"prompt": "Can you set up GA4 and our event tracking plan so we can start measuring conversions? We don't have any analytics installed yet.",
"expected_output": "Should recognize this is instrumentation/tracking-plan setup, which is the analytics skill's job, not attribution. Should defer to or cross-reference analytics for GA4 install, event taxonomy, and UTM setup, explaining that attribution assumes tracking already exists and is about how touches join to conversions and survive to revenue. May note it can help with attribution modeling and reconciliation once tracking is live, but should not attempt to build the tracking plan itself under attribution.",
"assertions": [
"Recognizes this as an analytics/instrumentation task, not attribution",
"Defers to or cross-references the analytics skill",
"Explains the boundary (attribution assumes tracking exists)",
"Does not attempt to build the full GA4 tracking plan itself"
],
"files": []
},
{
"id": 7,
"prompt": "We're a DTC ecommerce brand spending about $200k/month across Meta, Google, TikTok, and some podcast sponsorships. How should we actually measure what's working so we can allocate budget?",
"expected_output": "Should give the DTC playbook: store/backend order count as source of truth (not summed platform numbers), distrust platform ROAS for cross-channel decisions, and — given material multi-channel spend including untrackable podcasts — recommend MMM to allocate the portfolio and incrementality (geo-holdouts / on-off) to validate and to test the channels platforms flatter most. Should recommend a post-purchase 'how did you hear about us' survey to catch dark social and the podcast effect that pixels miss. Should note last-touch is only defensible for quick-turn SKUs. May reference references/by-business-type.md and references/measurement-paradigms.md.",
"assertions": [
"Sets store/backend order count as the source of truth, not platform sums",
"Recommends MMM given material spend including offline/podcast channels",
"Recommends incrementality testing to validate and find true lift",
"Recommends a post-purchase self-reported survey for dark social/podcasts",
"Warns against trusting platform-reported ROAS for budget allocation",
"References the by-business-type or measurement-paradigms guidance"
],
"files": []
},
{
"id": 8,
"prompt": "Our capture-phase SavvyCal decorator added metadata[ph_distinct_id]=anonymous-old to a booking anchor. On the same page the visitor identifies by email, then activates that same anchor again (including middle-click). Our helper correctly returns null for the identified email. Is returning early enough to fail closed? Preserve the booking path, campaign query parameter and fragment.",
"expected_output": "Should recognize that anchor.href is already mutated: returning early preserves the old anonymous ID. On each supported booking-link activation, set the metadata parameter when a current safe anonymous ID exists, otherwise delete only metadata[ph_distinct_id] and write the refreshed URL back. Apply to click and auxclick, including unavailable identity. Preserve unrelated query parameters, hash, destination and unrelated hosts. Keep the existing identity-model guard; do not use identified email/UUID as a substitute.",
"assertions": [
"Explains why early return retains stale metadata on a reused anchor",
"Deletes only the attribution parameter when identity is rejected or unavailable",
"Refreshes the parameter for a new valid anonymous ID",
"Covers click and auxclick without changing unrelated destinations or URL components",
"Does not substitute an identified user ID"
],
"files": []
},
{
"id": 9,
"prompt": "Our booking webhook sends PostHog identity and conversion events with fetch and a three-second timeout. When analytics times out it fails the webhook; HTTP 503 resolves without any diagnostic. How should the attribution recipe preserve a successful booking and show ingestion failures without exposing identities?",
"expected_output": "Should run analytics after business-critical work, catch network and timeout rejections, inspect response.ok for rejected HTTP ingestion, and emit only a booking identifier plus safe status diagnostics. Keep analytics non-fatal for the booking. Do not log the email, payload or raw exception, or claim a fulfilled fetch means events were accepted. If reliable delivery is required, recommend a separate idempotent queue rather than replaying the booking.",
"assertions": [
"Catches timeout and network rejection without failing the booking",
"Checks HTTP response acceptance separately from promise fulfillment",
"Logs only booking identifier and safe status",
"Keeps payload, email and raw exception out of diagnostics",
"Separates reliable analytics delivery from booking execution"
],
"files": []
}
]
}
Six rule-based credit rules on one journey, plus data-driven attribution explained without the black box. Use this when the user wants to understand why two models disagree, or needs to pick one defensibly.
Availability: Google Ads and GA4 no longer offer first-click, linear, time-decay, or position-based as reporting models (retired 2023). Use this file for concepts and for scoring journeys on your own data (CRM, warehouse, first-party path). In Google UIs today: data-driven and last-click only.
A single B2B buyer's path to a $12,000 annual deal, five touches over 38 days:
| # | Day | Touch | Role in the story |
|---|---|---|---|
| T1 | 0 | LinkedIn ad (paid social) | First discovered you — created awareness |
| T2 | 5 | Organic blog post (organic search) | Came back to learn — built interest |
| T3 | 12 | Retargeting ad (paid social) | Nudged back mid-consideration |
| T4 | 30 | Branded search (paid search, branded) | Ready to act — searched your name |
| T5 | 38 | Direct → demo request (direct) | Converted |
The whole point: the touch that gets credit depends entirely on the model, and each model tells a different story about where your $12k came from.
Credit for the $12,000 deal under each rule (last non-direct is a last-touch variant that skips Direct):
| Touch | Channel | First-touch | Last-touch | Last non-direct | Linear | Time-decay | Position (U) |
|---|---|---|---|---|---|---|---|
| T1 | Paid social | $12,000 | $0 | $0 | $2,400 | $175 | $4,800 |
| T2 | Organic | $0 | $0 | $0 | $2,400 | $290 | $800 |
| T3 | Paid social | $0 | $0 | $0 | $2,400 | $575 | $800 |
| T4 | Paid search (branded) | $0 | $0 | $12,000 | $2,400 | $3,415 | $800 |
| T5 | Direct | $0 | $12,000 | $0 | $2,400 | $7,545 | $4,800 |
(Time-decay uses a 7-day half-life — weight = 0.5^(days-before-conversion / 7), normalized: shares of ~1.5% / 2.4% / 4.8% / 28.5% / 62.9% (dollars rounded to sum to $12,000). With a 38-day journey the credit concentrates hard on the last two touches — which is exactly why time-decay behaves almost like last-touch on long cycles. Position-based is 40/40/20, the 20% split evenly across T2–T4.)
Read the disagreement:
The takeaway to give the user: report first-touch and last-touch side by side. The LinkedIn-vs-Direct gap is the insight — it tells you paid social creates demand that later shows up as direct/branded. No single number captures that; the spread does.
Data-driven attribution (Google's DDA, most MTA tools) doesn't use a fixed rule. It asks a counterfactual: how much does each touch actually change the probability of conversion? The formal engine is the Shapley value from cooperative game theory.
The plain-English version:
So if journeys with a retargeting touch convert meaningfully more often than identical journeys without it, retargeting earns real credit. If adding a channel changes nothing, it earns ~zero — even if it appears on every path.
When it's worth it:
Its honest limitations:
measurement-paradigms.md) exists: to validate what DDA claims.measurement-paradigms.md).In every case: pick one model, stay consistent, and pair it with an out-of-model check. Model-switching to make a channel look good is the fastest way to lose trust in the whole attribution program.
Attribution defaults differ sharply by business model. The same "which channel drives revenue?" question wants a different source of truth, model, and paradigm depending on how long your cycle is, how many people are involved, and where your budget goes. Two playbooks: B2B SaaS and Ecommerce/DTC. Match the user's product to one (or blend, for PLG-with-sales).
Shape of the problem: journeys run weeks to months, span multiple people (champion, economic buyer, users), and include touches that never appear in web analytics — a conference conversation, a sales call, a Slack-community mention, a peer recommendation. Deal values are high and volume is low, so every deal matters and averages are noisy.
Why single-touch models mislead badly here: with 15 touches over 3 months across 4 people, "last-touch = direct" and "first-touch = one LinkedIn ad" are both almost useless. The middle — and the offline — is where the deal was actually won.
first-party-tracking.md Step 5.)Tooling: CRM (HubSpot/Salesforce) as truth; a product-analytics tool identifying by user/account UUID for first-party first-touch (see first-party-tracking.md); self-reported fields written to the CRM; RB2B-style de-anonymization to catch un-formed account visits.
The B2B trap to name for the user: branded search and direct will look like your best "channels" because that's where researched buyers convert. They're not channels — they're where demand created elsewhere cashes out. Segment branded vs. non-branded search and treat a big direct share as evidence your top-of-funnel is working, not as a channel to invest in.
Shape of the problem: journeys are fast (minutes to a few days), high-volume, and almost entirely digital and self-serve. Budget concentrates in paid social + paid search + email/SMS. The conversion is a purchase you fully control (your checkout or a hosted one). The dominant lie is platform over-attribution — Meta and Google each claiming the same sales.
measurement-paradigms.md.)Tooling: store/backend as truth; platform pixels + CAPI for optimization (setup → conversion-tracking); Supermetrics/Coupler to pull platform numbers into one place for de-duping; a post-purchase survey app; MMM tooling (Robyn/Meridian or a vendor) once spend justifies it.
The DTC trap to name for the user: summing platform-reported conversions. If Meta claims 100 and Google claims 80 but you had 120 orders, you do not have 180 conversions — you have 120 with overlapping claims. Anchor on the 120 and allocate the overlap with incrementality, not by trusting whichever platform shouts loudest.
Many modern SaaS businesses are both: self-serve signups and a sales-assisted motion for larger accounts. Blend the playbooks:
first-party-tracking.md).How to instrument and stitch attribution yourself when you control the site/app. This is the build track (Pillar B). It's distilled from real production builds and kept tool-agnostic — PostHog + SavvyCal are the worked example, but the pattern maps to any product-analytics tool with identify()/merge (Segment, Amplitude, GA4 user-id) and any third-party conversion domain with a metadata passthrough + webhook (Calendly, Cal.com, Stripe Checkout, Typeform).
The core method — closing the identify() gap so conversions join to anonymous browsing history — is adapted from Tessa Kriesel's PostHog attribution approach. Several of the production refinements that make this operate at scale are also hers, credited inline: the full-touch-path capture that feeds the model track (Step 4), the CRM last-mile with source/confidence/basis and a Paid-vs-Organic read (Step 5), the account rollup, and the "expect ~zero until the stitch is verified, with a campaign-window fallback + backfill" window (Cross-subdomain stitching). Credit where due.
First-party attribution joins anonymous browsing to the eventual conversion:
anonymous visitor identify() at conversion breakdown
───────────────── ──────────────────────── ─────────
distinct_id = anon_uuid identify(email) conversion event
$initial_utm_source=... → merges anon history → by $initial_utm_source
$initial_referrer=... into person(email) = "where do customers come from"
Everything below serves that join. If identify() never fires, every customer looks like they appeared from nowhere — that's the gap.
The most expensive mistake is rebuilding attribution that already works. Many SaaS apps already identify() at signup and already carry first-touch on person profiles. Check the live data first:
$initial_utm_source / $initial_referring_domain?Signed up, Converted to paid) break down cleanly by channel, or is everything "Direct"?Only instrument the specific conversions that are genuinely un-joined. In one real audit the self-serve funnel was already solved end-to-end; the only gap was a booking on a third-party domain. Don't touch what works.
At every conversion moment, call identify() with a stable id, and set person properties:
// Normalize before use as a distinct_id — analytics tools match exact strings,
// so "Corey@x.com" and "corey@x.com" split into two people otherwise.
export function identifyUser(email) {
const normalized = email.trim().toLowerCase();
window.posthog?.identify(normalized, { email: normalized });
}
With person_profiles: 'identified_only', this is the moment the person is created and their first-touch props are stamped. Fire it on form success, signup, first purchase — any moment you learn who the anonymous visitor actually is.
When the conversion completes on a third-party domain (a booking tool, hosted checkout), you can't run your analytics there. Smuggle the anonymous id through the tool's metadata passthrough, then merge it back in the webhook.
One document-level listener rewrites every outbound booking link at click time — no per-CTA edits, and it covers plain clicks, keyboard activation, and middle-click (auxclick):
// Refresh anonymous metadata on each SavvyCal activation; clear stale IDs.
function decorate(e) {
const anchor = e.target?.closest?.("a[href]");
if (!(anchor instanceof HTMLAnchorElement)) return;
let url;
try { url = new URL(anchor.href); } catch { return; }
const host = url.hostname;
if (host !== "savvycal.com" && !host.endsWith(".savvycal.com")) return;
const distinctId = getPostHogDistinctId(); // anonymous-only — see guard
if (distinctId) {
url.searchParams.set("metadata[ph_distinct_id]", distinctId);
} else {
// The same anchor may have been decorated before identify() or reset().
url.searchParams.delete("metadata[ph_distinct_id]");
}
anchor.href = url.toString();
}
document.addEventListener("click", decorate, true); // capture phase
document.addEventListener("auxclick", decorate, true);
An early return when the guard rejects the current ID leaves any previously added metadata on the anchor. Remove that one parameter instead, preserving the booking path, other parameters and fragment. Check both click and auxclick after an identity change.
For an inline embed (e.g. /demo with an embedded calendar), pass the same id in the embed's metadata config instead; poll briefly (~2s) for the id on fresh visits, but never block the calendar from rendering.
The SDK stub queues calls before it loads, so get_distinct_id() returns undefined early — fall back to the tool's own cookie:
export function getPostHogDistinctId() {
if (typeof window === "undefined") return null;
// Prefer the loaded SDK.
try {
if (window.posthog?.__loaded) {
const id = window.posthog.get_distinct_id();
if (id) return isAnonymousDistinctId(id) ? id : null;
}
} catch {}
// Fall back to PostHog's cookie before the SDK finishes loading.
try {
const prefix = `ph_${POSTHOG_API_KEY}_posthog=`;
const cookie = document.cookie.split(/;\s*/).find(c => c.startsWith(prefix));
if (!cookie) return null;
const parsed = JSON.parse(decodeURIComponent(cookie.slice(prefix.length)));
return typeof parsed.distinct_id === "string" && isAnonymousDistinctId(parsed.distinct_id)
? parsed.distinct_id : null;
} catch { return null; }
}
The third-party tool returns your metadata in its booking.created (or checkout.completed) webhook. Fire an identity merge + a conversion event to your analytics ingestion endpoint:
// Normalize the booking email the same way the app does (Step 1), or the
// booking person will split from the app-side identity for the same user.
const userId = email.trim().toLowerCase();
const events = [];
if (anonId) {
events.push({
event: "$identify",
distinct_id: userId, // the known person
properties: { $anon_distinct_id: anonId, $set: { email: userId, name } }, // merge the journey
});
}
events.push({
event: "discovery_call_booked",
distinct_id: userId,
properties: { booking_id, journey_linked: Boolean(anonId) }, // track the fallback rate
});
// Run after the booking's business-critical work; analytics must not fail it.
try {
const response = await fetch(`${POSTHOG_HOST}/batch/`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ api_key: POSTHOG_API_KEY, batch: events }),
signal: AbortSignal.timeout(3000),
});
// fetch resolves for HTTP errors too; a resolved promise isn't acceptance.
if (!response.ok) {
console.warn("Analytics ingestion rejected", { booking_id, status: response.status });
}
} catch {
// Timeouts and network errors stay non-fatal. Never log the payload or email.
console.warn("Analytics ingestion unavailable", { booking_id });
}
When no id survives (link bypassed the decorator, e.g. a booking link inside a generated email/PDF), fall back to email-only capture with journey_linked: false. You still get the conversion; you just don't get the journey for that one.
First-touch survival caveat (PostHog specifics): the $anon_distinct_id merge carries the anonymous person's event history, but with person_profiles: 'identified_only' the anonymous visitor may never have had a person profile, so their $initial_* first-touch props aren't guaranteed to land on the merged person. Two robust fixes: call posthog.createPersonProfile() client-side before the visitor navigates off to the third-party domain (so the profile and its $initial_* exist to merge into), or capture the first-touch values client-side and pass them through the same metadata passthrough, then re-assert them in the webhook with $set_once ($set_once never overwrites an existing value, so it's safe). Without one of these, you can get the booking joined to the journey's events but a blank $initial_utm_source on the person — verify on a real booking. (posthog-js#1524.)
Only ever smuggle the anonymous id. After identify(), the current distinct_id becomes the user's email/UUID — leaking that into a third-party URL, or merging on it in the webhook, folds unrelated people together and leaks PII.
Pick the guard that matches your identity model — the two are not interchangeable. The @-check below is only safe when your app identifies by email; do not copy it into a UUID-identity app.
// EMAIL-IDENTITY apps only. True only for ids safe to smuggle: reject
// email-shaped values (an identified email) and cap length.
export function isAnonymousDistinctId(id) {
return id.length > 0 && id.length <= 100 && !id.includes("@");
}
If the app identifies by UUID, not email, the @ check is useless — an identified UUID would pass it and leak. Instead test that the current distinct_id still equals the device_id (calling identify() changes distinct_id but leaves device_id), and fail closed when device_id is unreadable:
// UUID-identity variant: only anonymous when distinct_id still == device_id.
function isAnonymous(posthog) {
const did = posthog.get_distinct_id?.();
const dev = posthog.get_property?.("$device_id");
if (!did || !dev) return false; // ambiguous → treat as identified, send nothing
return did === dev;
}
The rule in one line: when identity is ambiguous, send nothing. A missing journey is a data gap; a wrong merge is corruption.
Redirects overwrite the true first touch, inflating "Direct"/"Referral" and hiding real acquisition. Exclude these from referrer/channel classification (usually a settings change in the analytics tool, not code):
accounts.google.com, login.microsoftonline.com, login.live.com, checkout.stripe.comyourdomain.com, app.yourdomain.com, auth.yourdomain.comlocalhost, 127.0.0.1, test accountsThis is the highest-trust-per-effort fix in the whole runbook — no deploy, immediate accuracy gain. Do it first.
Marketing site → app on a subdomain must share one analytics project and a cross-subdomain cookie (PostHog's cross_subdomain_cookie default handles yourdomain.com → app.yourdomain.com). Verify the journey survives the handoff, or every signup looks like it started at the app.
Expect near-zero numbers until the stitch is verified in prod — don't panic. (Production note from Tessa Kriesel.) Before the cross-subdomain stitch is confirmed live, first-party attribution reads basically nothing — journeys break at the handoff and everything looks like direct. It flips from ~0 to real numbers the week the stitch actually ships. Two things get you through that window:
unknown / low-confidence rather than falsely crediting whatever was live. Used narrowly, it's a real signal while the stitch stabilizes and beats a blank; used bluntly, it manufactures false attribution.Mark these fallback-attributed conversions with a lower-confidence basis (see Step 5) so you never confuse a heuristic guess with a verified journey.
SAVVYCAL_WEBHOOK_SECRET etc.).@) before merging.$initial_* explicitly, or switch the default.$initial_utm_source / $initial_referring_domain — "where does every signup/booking come from."journey_linked: false rate tells you how many conversions bypassed the stitch. Watch it after launch.$initial_*. (Refinement from Tessa Kriesel.) First-touch alone lets you break conversions down by first channel — but it can't run the multi-touch models from the interpretation track (SKILL.md §2: position-based, linear, time-decay). If you also persist the ordered sequence of touches per person (channel + timestamp for each, e.g. an events-table query or a touch_path array on the person), the build track feeds the interpretation track: you can now score the same journey six ways on your own data instead of only reading about the models. This is what makes Pillar A and Pillar B shake hands — capture first-touch to ship, capture the full path to model.(This whole step is a production refinement from Tessa Kriesel — it's the thing that turned first-party attribution from a dashboard into an operating signal.)
A channel breakdown living in your analytics tool is a report. The thing sales and lifecycle actually act on is attribution written onto the record in the CRM, per account. Sync it out:
source field, plus source_confidence and source_basis. Don't write a bare channel — write the channel and how you know it. basis is the evidence type: journey_linked (verified stitch), self_reported (survey), or campaign_window (the heuristic fallback above). confidence is computed from evidence quality, not just the basis — a journey_linked touch with clean UTMs is high, the same touch with dirty/missing UTMs is lower, and a specific self-report can be high while a vague one is low. Sales treats a high-confidence source very differently from a low-confidence guess — give them both fields or they'll distrust the whole thing.paid only from explicit paid mediums (cpc, ppc, paid-social, display, paid), and classify the rest into a small, configurable taxonomy rather than a blunt "organic" — owned (email, push, SMS — though a sponsored newsletter is paid), earned (organic search/social, referral — but a partner/affiliate referral is closer to paid), direct (no medium — unknown, not organic), unknown. The fast operational question a rep or nurture flow needs is really paid vs non-paid (did this account cost acquisition dollars) — get that boundary right and keep the finer buckets configurable.by-business-type.md.Account rollup (B2B). One org is several people signing up with mixed work and personal emails, so person-level attribution scatters the story across records. Roll each person's source up to the account and attribute at the account level — that's where the signal has to land to be useful to a salesperson working the whole buying committee. Match on email domain, but exclude free-mail domains (gmail.com, yahoo.com, outlook.com, …) — those can't identify a company, so a domain match would collapse unrelated people into one bogus account. For personal-email signups, fall back to enrichment, your CRM's contact→account link, or manual matching.
metadata[<id_param>]=<anon-uuid>.posthog.identify('test@x.com') → click again → the param must NOT appear (guard works). posthog.reset() after./batch/ payload → expect {"status":"Ok"}, person appears merged.journey_linked: true.$initial_utm_source.| Piece | PostHog (worked example) | Generalizes to |
|---|---|---|
| Anonymous id | distinct_id / $device_id | Segment anonymousId, Amplitude deviceId, GA4 client_id |
| Merge call | $identify + $anon_distinct_id | Segment identify (known userId, same anonymousId) + alias where needed; Amplitude setUserId on the session that still holds the anonymous deviceId (the stitch is deviceId↔userId — Amplitude's Identify API only sets user properties, it does not merge); GA4 user_id on the same client_id |
| Ingestion | /batch/ | Segment HTTP API, Amplitude HTTP v2, GA4 Measurement Protocol |
| Third-party passthrough | SavvyCal metadata[...] | Calendly: only standard UTMs (utm_source/medium/campaign/content/term) plus salesforce_uuid — map the anon id into a supported UTM (e.g. utm_term), not a free-form metadata[] param. Cal.com metadata; Stripe client_reference_id/metadata |
| First-touch props | $initial_* | Segment/Amplitude first-touch, GA4 first_user_* dimensions |
The shape never changes: grab the anonymous id → carry it across the boundary → merge on the far side → break the conversion down by first-touch.
Attribution models (see attribution-models.md) split credit within your tracked data. They can't tell you what would have happened anyway. That's what these three paradigms are for — increasingly rigorous, increasingly expensive ways to get closer to causality. Use this reference to help a user pick, and to explain how a test reads (not how to run the statistics).
| MTA (multi-touch) | MMM (media mix modeling) | Incrementality (experiments) | |
|---|---|---|---|
| Approach | Bottom-up: stitch user-level touches, apply a model | Top-down: regress outcomes vs. spend/factors over time | Controlled: withhold exposure from a group, measure the difference |
| Answers | "Which touchpoints are on converting journeys?" | "What's each channel's aggregate contribution?" | "Did this channel cause lift I wouldn't have gotten?" |
| Granularity | Per user, per touch | Per channel, per week | Per test (one channel/tactic at a time) |
| Data needed | Clean cross-device user-level tracking | 2–3 yrs weekly data + spend variation | Ability to withhold + enough volume for significance |
| Reacts | Real-time | Slowly (weeks/quarters) | Per test cycle |
| Handles offline/brand | No | Yes | Yes (if you can split exposure) |
| Privacy-durable | Weak (cookie/ID loss) | Strong (aggregate) | Strong (aggregate) |
| Cost/effort | Low–medium | High | Medium–high |
What it is: the user-level approach most marketers mean by "attribution" — join a person's touches, apply first/linear/position/data-driven credit.
Where it shines: day-to-day, tactical decisions. "Is this campaign showing up on converting journeys?" Fast, granular, cheap if your tracking exists.
Why it's structurally weakening: MTA depends on tracking one person across touches and devices, and that data keeps eroding — Safari/Firefox ITP-style cookie limits, iOS ATT, browser consent gating, ad blockers, and ordinary cross-device / in-app-browser behavior (research on mobile, buy on desktop). (Chrome's third-party-cookie deprecation was announced, then walked back, so "cookies are going away" is no longer the clean story — but everything else on that list already limits user-level tracking today.)
Click-based paths add a second bias: impression channels (social, video, display) often never enter the journey — a view with no click leaves no stitchable touch — so MTA systematically over-weights demand-capture (search, email, direct) and under-weights demand-creation. MTA doesn't announce the gap: it silently under-measures anything it can't follow (dumping it into direct) and over-measures what it can see. Treat MTA as incomplete and directionally biased — not a clean lower bound (its retargeting/branded numbers are often over-stated) — and never the sole basis for a big reallocation.
Use it for: ongoing optimization and trend-watching — never as the sole basis for a big budget reallocation.
What it is: a top-down statistical model (historically regression; modern open-source options like Meta's Robyn or Google's Meridian) that explains an outcome (revenue, signups) as a function of spend per channel plus controls (seasonality, promotions, price, macro). It never looks at individuals — it's all aggregate time-series, which is exactly why privacy changes don't touch it.
What it uniquely gives you:
What it costs and where it's weak:
Use it for: annual/quarterly budget allocation across a material, multi-channel (esp. offline-inclusive) spend. Validate its coefficients with incrementality tests — MMM says "Meta contributed X"; a holdout proves whether that's causal.
What it is: the only paradigm that measures causality directly. Split your audience into an exposed group and a withheld/control group; the difference in outcomes is the incremental lift — conversions you got because of the channel, not ones that would have happened anyway.
Common designs:
You don't need to compute significance by hand, but you must read a result honestly:
Use it for: the highest-stakes questions and the tiebreakers — "does retargeting actually do anything?", "is branded-search paid just buying clicks we'd get free?", "which of our two biggest channels is really driving growth?" You can only test a few things at a time, so spend those tests on the decisions that matter most.
They're layers, not competitors:
When incrementality, surveys, and platform gaps all say the same channel is under-credited in click-MTA, don't invent a platform-gap multiplier. Document a rule:
Start with one channel, one override, temporal bounds, and a conservative slice of measured lift (not 100% of a noisy point estimate). Expand only after stakeholders trust the first rule.
Scale to the user: most SMBs need good UTMs + last-non-direct + a self-reported survey + the occasional on/off test — not an MMM. Bring MMM in when offline/brand spend is material and MTA visibly can't see it. Bring in formal incrementality when a single channel's budget is big enough that being wrong about it is expensive. Match the rigor to the size of the decision.
폼·구매 전환이 광고 플랫폼에 정확히 잡히게 설정해요.
무엇을 잴지 정하고 GA4 이벤트와 UTM을 설계해요.
리드 점수와 영업팀에 넘기는 기준을 정해요.