Capturing the ad click identifier in Salesforce
One field, correctly placed, is the difference between reporting on revenue and reporting on form fills.
Ad platforms attach an identifier to a click and hand it to the landing page. If that identifier reaches Salesforce and survives lead conversion, a closed deal can be sent back to the platform and the bidding algorithm learns from revenue rather than from form submissions. If it does not, the loop stays open. This covers the field design, the conversion mapping that quietly loses it, the expiry window that caps how long you have, and how to measure coverage.
What the identifier is doing
When somebody clicks a paid ad, the platform appends an identifier to the destination URL. It is meaningless to a human and it is the join key for everything that follows.
The platform already knows which campaign, ad group, keyword, device and audience produced that click. It does not know what happened afterwards, because the sale happened in a CRM it cannot see. Sending the identifier back later with a value and a date is what closes that gap. Google's conversion management documentation covers the model, and the specific mechanism for deals that close offline is documented under managing offline conversions.
The consequence is not reporting, it is bidding. An automated bidding strategy optimises toward whatever conversions it receives. Feed it form fills and it will find you cheap form fills. Feed it closed deals with amounts and it optimises toward the traffic that produced revenue. Those two behaviours diverge sharply once lead quality varies by channel, which it always does.
So the field is not a reporting nicety. It is an input to how the money gets spent, and the whole return path is covered in pushing closed deals back to the ad platform.
Where the field goes, and the mistake in putting it in one place
| Object | Why the field is needed here | What goes wrong without it |
|---|---|---|
| Lead | First point where the identifier can be stored | Nothing is captured at all |
| Contact | Conversion target for the person | The trail ends at conversion |
| Opportunity | The record that carries amount and close date | No deal can be reported back with a value |
| Account | Optional, useful for multi-deal customers | Second and third deals lose provenance |
The identifier arrives with a Lead and has to still be readable when an Opportunity closes, which is usually several objects and several months later.
That means the field exists in more than one place. Create a custom text field on Lead, an equivalent on Contact, and an equivalent on Opportunity. Salesforce's custom fields reference covers the mechanics, and the naming convention it describes is what stops the field being mistaken for a package field later.
The common mistake is creating it only on Lead. It captures perfectly, it reports fine for the first month, and then the first deal closes and the identifier is nowhere to be found on the Opportunity. The Lead still holds it, closed and converted, and no report joins back to it because nobody documented that they should.
Make the field long enough. These identifiers are opaque strings whose length is not yours to control, and a text field sized for today's format is a truncation bug waiting for a format change. Truncation is the worst failure mode available here because the value looks present and matches nothing.
Mark the field read-only in the page layout for everyone except the integration user. Nothing good has ever come from a sales representative editing a machine identifier by hand.
One more field is worth having beside it: the timestamp of the click, or failing that, the date the record was created. You need it for the expiry arithmetic below.
Lead conversion is where it disappears
This is the single most common defect and it is entirely preventable.
When a Lead is converted, Salesforce creates a Contact, optionally an Account, and optionally an Opportunity. Standard fields map across on their own. Custom fields do not, unless somebody has explicitly configured the mapping.
So the sequence is: identifier captured on Lead, Lead converted, identifier not on the Opportunity, and the deal that closes four months later has no provenance. The Lead record still holds the value, sitting behind a closed converted flag, invisible to the report.
Configure the mapping at the same time you create the fields, not later. Later means after the first quarter of deals has already lost it, and there is no supported way to reconstruct a value that was never copied.
Then test conversion in a sandbox before you rely on it. Create a Lead with a recognisable test value, convert it, and read the Opportunity. It takes five minutes. Skipping it is how teams discover the problem from a quarterly report rather than from a test.
There is a second, quieter loss on the same event. If two Leads for the same person are converted into one Contact, one identifier wins and the other is discarded. Deduplication is therefore an attribution decision as well as a data quality one, and it needs deciding before the first merge rather than after.
Expiry is a real deadline
The identifier does not stay useful forever. Ad platforms enforce a window between the click and the conversion upload, and outside that window the upload is rejected.
Treat that window as a delivery constraint rather than a footnote, because it interacts badly with a long sales cycle. If deals typically close in 45 days and the pipeline occasionally runs to 200, some genuine revenue is simply outside the window and will never be reportable. That is a fact to state in the plan, not a defect to discover in month four.
The arithmetic worth running before you build anything: take the last 12 months of closed-won Opportunities, compute days from lead creation to close, and count how many fall inside the platform's window. If it is 80 percent, the mechanism is well worth building. If it is 30 percent, you are building a machine that will optimise on the fastest-closing third of your pipeline, and you should decide that deliberately rather than by accident.
The lag itself is a measurable property of the account and it distorts more than this one mechanism, which is the subject of conversion lag and attribution windows.
The design response is to upload on a schedule that runs at least daily and to upload deals as they close rather than in a monthly batch. A monthly batch spends up to 30 days of the available window on nothing but waiting.
Coverage is the number that tells you if it works
One metric decides whether the whole mechanism is worth anything: the percentage of paid-sourced Opportunities that carry a usable identifier.
Report it monthly. Not as a technical health check, as a line in the marketing report, because it is the confidence interval on every attribution number presented alongside it.
Coverage is never 100 percent and should not be presented as a failure when it is not. Direct visits carry nothing. Somebody who clicked an ad on a phone and converted on a laptop will not carry it. A visitor who cleared their cookies between arrival and submission will not carry it. Those are properties of the world, not bugs.
What matters is whether coverage is stable. A figure that sits between 70 and 75 percent for six months is a measurement you can reason about. The same figure dropping to 40 percent in one week is a broken deployment, and it will not announce itself any other way.
Set the alert on that metric rather than on the pipeline job. The job will keep succeeding while capturing nothing.
This is the measurable core of a conversion and attribution audit: find where the identifier is lost, fix it at the point of loss, then publish the coverage number so nobody has to trust the fix on faith. Restoring per-location attribution across 15 or more clinics came down to the same discipline applied at the event layer rather than at the CRM field.
The build order that avoids rework
Do these in sequence. Doing them in a different order means redoing at least one.
First, create the fields on Lead, Contact and Opportunity, and set the field-level permissions. Do all three now even if only Lead is populated today.
Second, configure the lead conversion mapping and test a conversion in a sandbox with a recognisable value.
Third, capture the identifier on the website and get it into the Lead record. If the form posts directly into Salesforce, the mechanics and their failure modes are covered in Web-to-Lead and the parameters it drops.
Fourth, measure coverage for a full month and do nothing else. A month of clean measurement tells you whether the upload will have anything to send, and it is much cheaper than building the upload and discovering the answer afterwards.
Fifth, build the upload. Not before step four.
Sequencing this across a web developer, a Salesforce administrator and whoever runs the ad account is coordination work more than technical work, and it is what a fractional technical project manager is brought in to hold. Each of those three people can do their part correctly and still produce nothing usable if the order is wrong.