logo

How to Track Ad Platform Lead Forms in Analytics and CRM

When users submit lead forms directly on ad platforms (Meta, LinkedIn, Google Ads, TikTok, etc.), they never reach your website — meaning you lose the UTMs and client IDs that traditional analytics systems rely on.
This guide explains how to recreate synthetic landing pages, generate a Google-style Client ID (UUID), and send both to your CRM and Google Analytics 4 (GA4) for unified attribution — even when no site visit occurs.

⚙️ Overview of the Process

For each incoming lead (from any ad platform):
  1. Capture ad metadata (campaign, ad, platform).
  1. Build a synthetic landing page URL using UTMs.
  1. Generate a Google Client ID (UUID).
  1. Send both fields (landing_page, google_client_id) to your CRM.
  1. Send a synthetic lead event to GA4 using the same client ID.
  1. Once implemented, SegmentStream can automatically stitch GA4 events, CRM leads, and campaign costs — even for leads collected inside the platforms without website visits.

🧠 Why This Works

Even though the user never lands on your site, the synthetic landing page and UUID create a virtual session.
This lets analytics systems register a visit with proper UTMs and connect it to your CRM record, providing a unified, channel-attributed view of lead generation performance.

🧩 Step 1: Generate a Google Client ID (UUID)

Instead of simulating GA4’s native client ID, simply use a UUID for clarity.
This makes it evident that the session was artificially generated.
Example (Zapier / Make / custom code):
javascript
function generateCID() { return crypto.randomUUID(); }
Example output:
plain text
1d52c3ab-bb40-4b23-b7a2-9266a1c89d4b
Store this in your CRM as google_client_id, and reuse the same value when sending the GA4 event.

🧩 Step 2: Create Synthetic Landing Pages

For each lead, construct a synthetic landing page URL in this format:
plain text
https://yourdomain.com/leadgen?utm_source={platform}&utm_medium=leadform&utm_campaign={campaign_name}&utm_content={ad_name}&cid={google_client_id}
This URL will never actually load; it simply represents where the lead would have landed if they visited your website.

Example:

plain text
https://yourdomain.com/leadgen?utm_source=facebook&utm_medium=leadform&utm_campaign=Summer_Sale&utm_content=Ad_1&cid=1d52c3ab-bb40-4b23-b7a2-9266a1c89d4b
Store this in your CRM as the field landing_page.

🧩 Step 3: Send Synthetic Event to GA4

Use the GA4 Measurement Protocol endpoint:
plain text
https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXX&api_secret=YOUR_SECRET
Payload Example:
json
{ "client_id": "1d52c3ab-bb40-4b23-b7a2-9266a1c89d4b", "events": [{ "name": "lead_submission", "params": { "page_location": "https://yourdomain.com/leadgen?utm_source=facebook&utm_medium=leadform&utm_campaign=summer_sale&utm_content=ad_1", "source_platform": "facebook", "form_type": "lead_form" } }] }

🧩 Step 4: Send Data to CRM

Your CRM (HubSpot, Pipedrive, Salesforce, etc.) should include at least the following custom fields:
Field
Description
landing_page
Synthetic URL with UTMs
google_client_id
UUID shared with GA4
source_platform
Platform name (Meta, LinkedIn, TikTok, Google)
campaign_name
From ad metadata
ad_name
From ad metadata

🧩 Step 5: Platform-Specific Implementation

🔵 Meta (Facebook & Instagram Lead Ads)

Metadata available:
  • ad_id, ad_name, adset_name, campaign_name, platform
UTM formula:
plain text
utm_source=facebook&utm_medium=leadform&utm_campaign={{campaign_name}}&utm_content={{ad_name}}
Automation flow:
  1. Trigger: New Lead in Facebook Lead Ads
  1. Generate google_client_id (UUID)
  1. Build landing_page URL
  1. Send both to CRM
  1. Post synthetic lead_submission event to GA4 via webhook

🔷 LinkedIn Lead Gen Forms

Metadata available:
  • campaignName, adGroupName, creativeId, leadGenFormName, platform
UTM formula:
plain text
utm_source=linkedin&utm_medium=leadform&utm_campaign={{campaignName}}&utm_content={{creativeId}}
Automation flow:
  1. Trigger: New LinkedIn Lead
  1. Generate google_client_id
  1. Construct landing_page URL
  1. Push to CRM
  1. Send event to GA4

🟢 Google Ads Lead Form Extensions

Metadata available:
  • campaign_name, ad_group_name, form_id
UTM formula:
plain text
utm_source=google&utm_medium=leadform&utm_campaign={{campaign_name}}&utm_content={{ad_group_name}}
Automation flow:
  1. Trigger: New Google Lead Form Submission
  1. Generate google_client_id
  1. Build synthetic landing_page URL
  1. Send to CRM
  1. Push to GA4

🔴 TikTok Instant Forms

Metadata available:
  • campaign_name, adgroup_name, ad_name, platform
UTM formula:
plain text
utm_source=tiktok&utm_medium=leadform&utm_campaign={{campaign_name}}&utm_content={{ad_name}}
Automation flow:
  1. Trigger: New TikTok Lead
  1. Generate google_client_id
  1. Build synthetic landing_page URL
  1. Send both to CRM
  1. Send GA4 event via webhook

✅ Summary

Step
Action
1
Capture ad metadata
2
Generate UUID as google_client_id
3
Construct synthetic landing_page with UTMs
4
Send to CRM
5
Send synthetic GA4 event via Measurement Protocol
Once implemented, SegmentStream will automatically stitch these leads — aligning GA4 events, CRM leads, and ad spend data — allowing full visibility into campaign performance even when the user never visited your website.