Skip to content

Case 10: November 20th Sales Investigation

Case 10: Real-World Attribution Analysis: November 20th Sales Investigation

Section titled “Case 10: Real-World Attribution Analysis: November 20th Sales Investigation”

“What happened on November 20th?”

Understand which traffic sources drove sales that day

~1 minute

Query sales events for November 20th from Moon

What you get (spreadsheet/database export)

Section titled “What you get (spreadsheet/database export)”
User IDAffidSourceCampaign TypeCampaign IDParameters
019a974d0bb877f19905e4e10c3d5892-google adsg_campaignid22740491004{“_gl”:“1*19k±…“}
019aa24361a57f03928122b309e186f61000fbcampaign_id120236311971890504{“_gl”:“1*17a±…“}
019aa212fd9773b4b6babfb8d9cdface1000fbcampaign_id120233281060520682{“_gl”:“1*1uz±…“}
019a9fc799fa7192b394c5fc08e2d417-test--{“content_ids…}
019aa0d1753f7376bd630c614ee55c00-test--{“affid”:"",“co…}
019a9f55a76a7fd988c6401a79f751a21001google_adsad_id781{“ad_id”:“781…}
019aa0bc82b375a3b1f02bf4983328a9-test--{“_gl”:“1*1e4…}
019a9edc73fb7d6a8b921122171e0bcf1001google_ads--{“_gl”:“1*16a…}
019aa0fffce8710fa99a2c0a9affe962-test--{“affid”:"",“co…}
019aa1f79f9277088d50e7c54eb10eba-mega-funnel--{“affid”:"",“co…}
bceb8c64219a4188bb78bf144f20363c-email_crmdirect-crm-ticket-{“_gl”:“1*ve7c…}

Time elapsed: 1 minute to export this data

Traffic Source Breakdown:

  • Facebook (affid 1000): 2 sales - campaigns 120236311971890504, 120233281060520682
  • Google Ads (affid 1001): 2 sales - properly tracked with affid
  • Google Ads (no affid): 1 sale - missing affid but has Google campaign parameters (g_campaignid: 22740491004)
  • Test traffic: 4 sales - obvious from specific IDs and “test” source label
  • Email/CRM: 1 sale - from direct-crm-ticket (email_crm source)
  • Mega-funnel: 1 sale - from alternative funnel
  • SMS: Hidden in the data (discovered by parameter analysis)

Step 3: Deep Dive - Parameter Investigation

Section titled “Step 3: Deep Dive - Parameter Investigation”

The “Google ads” sale without affid (row 1)

Section titled “The “Google ads” sale without affid (row 1)”
  • Source shows: google ads
  • Affid: empty
  • But parameters show: {"_gl":"1*19k±...}

Look deeper into parameters → Find SMS prospect tracking codes

Actual source: SMS retargeting (not Google Ads)

  • User originally came from Google Ads (stored in their profile)
  • Was retargeted via SMS
  • Clicked SMS link and purchased
  • Parameters reveal the SMS tracking codes
  • Original attribution: Google Ads campaign

This is why parameters are the “attribution Bible” → They reveal the true story

Every sale has parameters - JSON object with tracking data

Section titled “Every sale has parameters - JSON object with tracking data”

Facebook sale parameters:

{
"_gl": "1*17a±...",
"utm_source": "fb",
"utm_medium": "cpc",
"campaign_id": "120236311971890504",
"ad_id": "120233281654680682",
"adset_id": "120233281060550682",
"affid": "1000",
"fbp": "fb.1.1764081009618..."
}

Email/CRM sale parameters:

{
"_gl": "1*ve7c...",
"source": "email_crm",
"campaign": "direct-crm-ticket",
"email_id": "msg_abc123",
"original_utm_source": "fb",
"original_campaign_id": "120236311971890504"
}

SMS sale parameters (disguised as Google Ads):

{
"_gl": "1*19k±...",
"sms_campaign": "sms_prospect_nov_20",
"sms_message_id": "msg_sms_xyz",
"original_utm_source": "google",
"original_campaign_id": "22740491004"
}
  • Original traffic source (first-touch)
  • Current traffic source (last-touch)
  • Campaign identifiers
  • Ad identifiers
  • Email/SMS identifiers
  • All tracking codes

Without reading parameters, you’d think: “This is a Google Ads sale”

With parameters, you discover: “This is an SMS retargeting sale, originally from Google Ads”

Each sale has at least 3 events in the system

Section titled “Each sale has at least 3 events in the system”

Event 1: Landing (Day 1)

{
"event": "conv_landing_page_view",
"user_id": "019a974d0bb877f19905e4e10c3d5892",
"timestamp": "2025-11-18T10:23:45Z",
"parameters": {
"utm_source": "google",
"utm_campaign": "weight-loss-q4",
"campaign_id": "22740491004",
"landing_page": "/medication-tirzepatide-discount-01"
}
}

Event 2: Lead Capture (Day 1, 15 minutes later)

{
"event": "achieve_screen_viewed",
"user_id": "019a974d0bb877f19905e4e10c3d5892",
"timestamp": "2025-11-18T10:38:22Z",
"properties": {
"email": "user@example.com",
"phone": "+1-555-0123"
},
"parameters": {
"utm_source": "google",
"campaign_id": "22740491004"
}
}

Event 3: Sale (Day 3, via SMS retargeting)

{
"event": "purchase_completed",
"user_id": "019a974d0bb877f19905e4e10c3d5892",
"timestamp": "2025-11-20T14:52:33Z",
"properties": {
"email": "user@example.com",
"amount": 499,
"transaction_id": "txn_abc123"
},
"parameters": {
"utm_source": "google", // Original source (preserved)
"campaign_id": "22740491004", // Original campaign
"sms_campaign": "sms_prospect_nov_20", // Last-touch
"sms_message_id": "msg_sms_xyz"
}
}

All 3 events share the same user_id → Connected journey

This enables multi-touch attribution: You can see the full path from landing → lead → sale

Every event has a schema - the JSON structure with all parameters

Section titled “Every event has a schema - the JSON structure with all parameters”

PostHog event schema:

  • user_id (or distinct_id)
  • event (event name)
  • timestamp
  • properties (event-specific data)
  • $set (user properties)
  • utm_source, utm_medium, utm_campaign, etc.
  • Custom parameters (campaign_id, ad_id, affid, etc.)

Your marketing events have their footprints

Section titled “Your marketing events have their footprints”
  • Facebook ads: campaign_id, ad_id, adset_id, affid, fbp
  • Google Ads: gclid, campaign_id, g_campaignid
  • Email: email_id, campaign, source: email_crm
  • SMS: sms_campaign, sms_message_id
  • Organic: utm_source: organic, referrer data

These footprints are how you see things - the ONLY way you see things.

  • You can’t read the data correctly
  • You’ll misattribute sales (thinking SMS = Google Ads)
  • You’ll miss patterns
  • You’re “a bad hunter”

No meetings needed. No complex analysis. Just

Section titled “No meetings needed. No complex analysis. Just”
  1. Notice what IDs exist: “Oh, we have PostHog IDs. Fine.”
  2. See what parameters are captured: “We have affid, campaign_id, utm_source. Cool.”
  3. Use them: Query by these fields, segment by them, attribute by them
  4. Done: Takes 1 minute to pull sales attribution
  • The system stores parameters on every event
  • Parameters persist through the funnel
  • Query pulls parameters with sales data
  • You read the parameters to understand attribution
  • See PostHog tracking → Know you have user IDs and events
  • See affid field → Know you can segment by traffic source
  • See campaign_id → Know you can attribute to campaigns
  • Just use what’s there

No need to overthink it - if the parameter exists, use it.

Key Insights from the November 20th Analysis

Section titled “Key Insights from the November 20th Analysis”
  1. Facebook (affid 1000): 2 sales
  2. Google Ads (affid 1001): 2 sales
  3. Email/CRM retargeting: 1 sale
  4. SMS retargeting: 1 sale (discovered via parameters)
  5. Test traffic: 4 sales (internal testing)
  6. Alternative funnel: 1 sale
  • Multiple sales came via email/SMS retargeting
  • But all attributed back to original paid campaigns
  • Parameters reveal both original and last-touch sources
  • One “Google Ads” sale was actually SMS
  • Email sales traced back to original Facebook campaign
  • Multi-touch journey visible through parameter history
  • Event export with all parameters
  • User ID linking across events (landing → lead → sale)
  • Parameter preservation through funnel
  • JSON parameter storage (flexible schema)
  • Multi-touch tracking (original + current source)
  • Fast querying (1 minute to answer “what happened on Nov 20?”)

With properly instrumented events and parameter tracking, you can answer complex attribution questions in minutes, not days. Just understand your data schema and use it.