Attributing Meta ad spend to closed revenue in your CRM
Cost per lead is a vanity number if you can't see cost per client. Here's the full chain, from the click to the closed deal.
8 min read
The chain you're building
Attribution is not one setting, it's a chain: the click carries identifiers, the form stores them, the CRM keeps them on the contact, the deal outcome writes back. A break anywhere means the report is guesswork.
Browser and server, deduplicated
Fire the pixel event in the browser and the same event from your server with an identical event ID. Meta deduplicates on that ID, so you get coverage from the server when the browser is blocked, without double-counting when it isn't.
- 01Generate one event ID per conversion in your own code.
- 02Send it with the browser event and with the server event.
- 03Include the click identifier and browser identifier from the visitor's cookies with the server call.
- 04Hash email and phone before sending — never send raw contact details.
Consent, handled by region
Where opt-in is legally required, show the banner and load nothing until it's accepted. Where it isn't, don't throttle your own traffic with a banner you don't need.
Detect region server-side where you can, with a time-zone fallback for when that detection fails. A detection failure must fail to the correct default for your main market, not to blocking everything — an easy misconfiguration that silently kills tracking.
Carrying campaign data into the CRM
Capture the campaign parameters on landing, store them in the form submission, and write them to fields on the CRM contact. Fields, not tags — you want to report on them, not filter by them.
Do the same for instant-form leads from the ad platform itself, so both paths produce comparable records.
Closing the loop
When a deal is won, you now have campaign, ad set and ad on the contact and a value on the opportunity. That's cost per client by campaign, which is the only acquisition number worth optimising against.
Expect it to change your decisions: the campaign with the cheapest leads is very often not the one producing clients.