The short answer
To know which ad brought a closed deal, capture the click ID and source when the lead first arrives, store them on the CRM contact, and never overwrite them. Then send the later stages, booked, won and paid, back to the ad platform within its upload window, so it can credit the ad too. The source is usually lost at a hand-off, not by the CRM.
DataCops is the tracking solution for ad-funded businesses: it keeps the click, filters junk visits, matches the sale and sends it back to Meta, Google Ads, TikTok and LinkedIn, so your ads learn from real outcomes and not just from what a browser managed to report.
How DataCops covers the attribution chain:
- It keeps the click. One script and one DNS record collect on your own domain. Click IDs (gclid, wbraid, gbraid, fbclid, ttclid, li_fat_id) stay on the server for up to 90 days, and a signed server-set cookie lasts up to 400 days where enabled.
- It checks the visit. Every visit gets a bot verdict against an IP database covering 360+ billion IPs, with a Real people only switch per ad platform (off by default), and form emails are checked.
- It matches the sale. By click ID, or by hashed email and phone, from Shopify orders, HighLevel, any CRM by webhook, or a CSV.
- It sends the sale back. To Meta, Google Ads, TikTok and LinkedIn, counted once against the pixel, with every send in a delivery log.
- It sends the stages that happen later. Booked, showed, won and paid, so the ad platform learns who becomes a customer.
- Ads Warmup. Upload past customers (only email is required, up to 20,000 rows), see a 0 to 10 match score, and send them to Meta, Google Ads and TikTok so a new campaign starts with real buyers.
Best for: stores and lead-gen businesses that want the ad platforms themselves to learn from real sales. It is not a reporting dashboard.
Why the ad gets lost between the form and the deal
A lead-gen sale happens in two places. The visitor arrives from an ad on your website. Weeks later, someone marks the deal won inside a CRM. Between those two moments the ad has to travel with the person, and it rarely does.
Walk the path. A shopper clicks a Facebook ad, lands on your page, browses three pages, and fills in a contact form two days later. If the form does not carry the source, the CRM record shows no ad. If an embedded form lives on another domain, the click ID dropped at the redirect. If the CRM overwrites the original source whenever the person returns, the first ad is replaced by whatever came last. By the time a salesperson closes the deal, the record has no memory of what brought it in.
This is a plumbing problem, and it is the most common reason that "which ad brought this deal?" has no answer.
The method, in seven steps
- Capture the source at the first touch. When the visitor lands, store the ad click ID (gclid, fbclid, ttclid, li_fat_id) and UTM tags. Do it on your own domain, and keep it on the server, not only in a browser cookie.
- Add hidden fields to every form. Click ID, UTM source, campaign and landing page, filled in automatically.
- Store them on the CRM contact in fields that nothing else overwrites.
- Audit where the data gets lost. Submit a test lead from a test ad click and see which fields arrive. Repeat on mobile and in Safari.
- Report closed deals by that original-source field. Check a sample of won deals by hand to confirm it is right.
- Send the later stages back to the ad platform. A won deal is the signal the platform most needs.
- Watch the delivery. See that each stage was accepted, and why any were held.
Steps 1 to 5 give you the answer to "which ad". Steps 6 and 7 make the ad platform learn from it. Most teams stop after 5.
What to store on the CRM contact
| Field | Examples | Why |
|---|---|---|
| Click ID | gclid, wbraid or gbraid, fbclid, ttclid, li_fat_id | The match key for the ad platform |
| First source and campaign | UTM source, medium, campaign, term | Reporting by channel |
| Landing page | The first page they saw | Which offer or page converted |
| Time of first visit | Date and time | Checks the upload window |
| Hashed email and phone | Created when sending | A second match key when the click is gone |
| Deal stage and value | Booked, showed, won, paid, and the amount | What you send back |
The clock: how long you have
Every platform limits how late a sale can be sent back. For a long sales cycle this is the hidden killer, because a deal that closes on day 120 can be too late for everyone.
| Platform | Upload window |
|---|---|
| Google Ads | Click ID import within 90 days of the click; 63 days for enhanced conversions for leads |
| Meta | Events older than 7 days are rejected |
| Up to 90 days; some conversion types allow longer through the Conversions API or CSV |
If your deals take longer than the window, send an earlier checkpoint, such as "qualified" or "booked", with a smaller value, so the platform still learns something while the click is fresh. The Google part of this also changed in 2026; see Google Ads attribution in 2026.
Example: HighLevel and the "missing GCLID" error
A very common version of the problem is the HighLevel workflow log that says the action only works with contacts from Google Ads, and that the contact is missing a GCLID. The workflow step needs a Google click ID stored on the contact. This contact has none.
The cause is almost always upstream. The click ID is lost when a lead comes through an embedded form, a redirect, or returns by a different route. Auto-tagging off in Google Ads has the same effect. The general checks come from Google's own guidance: confirm auto-tagging is on, then look for redirects that drop the parameter, then check that your form actually saves a hidden click ID field. A workflow guard that only continues when the click ID exists stops the error from blocking everything else, but it does not recover the missing sale.
The same applies on the Meta side. HighLevel's own Conversions API step sends pipeline events for contacts that came from a Facebook lead form or have a stored fbclid. A website lead without a stored fbclid has nothing to match. Capturing the click on the first visit solves both. Our guide is HighLevel conversion tracking.
Phone-led sales
When a phone call decides the sale, the click ID has to be on the same contact as the call, or you cannot say which ad produced it. A call tracking tool can tie a call to a source. The call outcome still has to be sent as a stage. Read phone call offline conversions.
Which date to report on
Closed deals can lag the lead by months, so one date cannot do both jobs. Use the close date for revenue reporting, and the lead creation date for finding the ad click. If you report revenue by lead date, a campaign looks poor for months and then jumps. If you report by close date, you attribute revenue to the wrong month of spend. Pick, and say which in the report.
How DataCops does it
DataCops captures the click on your own domain and keeps click IDs on the server for up to 90 days. It matches a later stage by click ID, or by hashed email and phone if the click is gone. HighLevel stages go natively: form or survey lead, booked, showed, won with its value, and paid. Cancelled, no-show and lost deals are never sent. Any other CRM sends stages through a private webhook, a CSV or Zapier. Each send appears in the delivery log, with the reason when it is held. Start with offline conversion tracking, and see the complete attribution guide.
Tools you will meet
Each row says what the type does and where it stops. We checked the named tools' own pages in October 2026; vendors change features, so confirm before you choose.
| Type | What it does | Best for | Limit |
|---|---|---|---|
| The ad platform's own reporting | Credits sales by its own rules and window | Ranking ads against each other | Overstates across platforms; sees only what it was sent |
| GA4 or first-party analytics | Sessions and paths on your site | Behaviour and funnels | Browser-only tools miss blocked and non-consented events |
| Attribution dashboards, such as Hyros, Triple Whale, Northbeam and Cometly | Journeys and revenue by channel; several also send conversions back | Cross-channel budget decisions | Check what each sends, to which platforms, and whether bots are filtered |
| Call tracking, such as CallRail and WhatConverts | Ties a call to a source | Phone-led sales | The call is one stage, not the sale |
| DataCops | Keeps the click, filters junk, matches and sends sales and CRM stages, with a delivery log | Making the ad platforms learn from real outcomes | Not a reporting dashboard |
What else the same install does
The attribution chain is one part of a wider setup. Collection runs on your own domain with one script and one DNS record; with your DNS on Cloudflare, the free, optional DataCops Cloudflare Worker reads click IDs and UTMs at the edge before the page runs, and it captures without blocking. On Shopify, the DataCops Shopify app sends every paid order from Shopify's server. A first-party consent manager built on IAB TCF v2.2 and first-party analytics, a GA4 alternative, come from the same script. Each form email is checked for disposable providers and domains with no mail server, and LeadCops can enforce those rules on a form. Every send appears in a delivery log with the reason it was sent, held, skipped or failed.
Sources
- support.google.com/google-ads/answer/2998031
- support.google.com/tagmanager/answer/15629968
- developers.facebook.com/docs/marketing-api/conversions-api
- learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api
FAQ
How do I know which ad brought a lead that became a customer?
Capture the ad click ID and source when the lead first arrives, store them on the CRM contact, and read the deal's original source from that record. Then send the later stages back to the ad platform so it can credit the ad too.
Why does my CRM show the wrong source for closed deals?
Usually because the source was lost at a hand-off: a redirect dropped the click ID, an embedded form did not pass it on, or the CRM overwrote the original source with a later touch.
How long can I send a closed deal back to the ad platform?
Google Ads accepts a click ID import within 90 days of the click, and 63 days for enhanced conversions for leads. Meta rejects events older than 7 days. LinkedIn accepts up to 90 days. If your deals take longer, send earlier stages as checkpoints.
What does "Contact is missing GCLID" mean in HighLevel?
The workflow step that uploads to Google Ads needs a stored Google click ID on the contact, and this contact has none. It is lost when a lead comes through an embedded form, a redirect, or returns by another route. Capture the click ID on the first visit and store it on the contact.
Should I report on lead date or close date?
Both, for different jobs. Use the close date for revenue reporting and the lead date for finding the ad click, because closed deals can lag the lead by months.
Does the ad platform learn from CRM stages?
Only if you send them. A lead stage tells it who filled in a form. Booked, showed, won and paid tell it who became a customer, which is what it should optimise for.
Can I do this with phone calls?
Yes, if the click ID or source is stored on the same contact as the call, and the call outcome is sent as a stage. Call tracking tools tie a call to a source; the stage still has to reach the ad platform.