Connecting Salesforce to X Ads
Salesforce holds the opportunity, the amount and the close — the only place the actual revenue outcome is recorded. X is a conversation platform where a large share of engagement is discussion rather than intent, which makes the gap between engagement metrics and conversions unusually wide. The join between them succeeds or fails on one thing: whether the twclid click identifier reaches the Salesforce Lead or Opportunity before the conversion happens, because X Ads can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Salesforce pipeline to X Ads: twclid from form to Closed Won
Capture twclid server-side on the landing page, since X's in-app browser loses it on return visits, and store it in a Lead custom field mapped through to Contact and Opportunity. Send X's Conversions API a lead event at Lead creation with twclid, hashed work email and the Lead ID as conversion ID, then a Closed Won event with the amount.
X can work for B2B companies whose buyers follow industry conversation there. To report pipeline back, capture twclid on the landing page server-side, because much X traffic arrives in the in-app browser and the value will not survive a return visit. Write it into a custom field on the Lead with the form submission and map that field through Lead conversion onto Contact and Opportunity.
Send a lead event to X's Conversions API when the Lead is created, with twclid, hashed work email and the Lead ID as conversion ID, and a second event when the Opportunity reaches Closed Won, with the amount. If an X pixel fires on the form's thank-you page, it must use the same Lead-based conversion ID, or every Lead is counted twice.
Engagement on X often bears no relation to pipeline; a thread can draw thousands of replies from peers and competitors and produce no qualified Leads. Judge X campaigns by Salesforce Leads with the twclid field filled, then by how many reach an Opportunity, and check whether X's attribution window can still credit a deal that took a quarter to close.
Salesforce → X Ads · what breaks
Why this join usually fails — Salesforce → X Ads
- 01
The twclid click identifier never reaches Salesforce
Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.
- 02
The identifier is lost at lead conversion
This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.
- 03
Engagement mistaken for intent
A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.
- 04
Nothing reconciles afterwards
Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.
Salesforce → X Ads · the fix
What working looks like — Salesforce → X Ads
The twclid click identifier on every opportunity
Conversions arriving in X Ads
The conversion is matched to a click or an engagement and becomes available for optimisation and reporting.
Reconciled against the source
Salesforce → X Ads · architecture
How Salesforce and X Ads actually connect
- 1
Salesforce holds the truth
The opportunity carries the amount, stage and close date. Because Leads convert into Contacts, Accounts and Opportunities, the identifier must be mapped through the conversion or it is dropped exactly at the moment the record becomes valuable.
- 2
X Ads needs a click to match
An event X recognises, a conversion identifier for deduplication, hashed customer information, and the click identifier where you have it.
- 3
The identifier is the bridge
The twclid click identifier, captured at the visit and carried into the Salesforce Lead or Opportunity.
- 4
The event source decides reliability
Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.
- 5
Deduplication at the destination
X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.
Salesforce → X Ads · normal or broken
Working vs. broken, side by side — Salesforce → X Ads
Normal, not a fault
The twclid click identifier present on the opportunity
Sent from a Salesforce flow, Apex trigger or scheduled export on StageName change
Deduplicated correctly
X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.
Reconciles with the source
Actually broken
The twclid click identifier missing on most records
Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.
Sent from the browser
This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.
Counted twice, or not at all
A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.
Nobody has reconciled it
Salesforce → X Ads · diagnose
Diagnostic order — Salesforce → X Ads
- 01
Count opportunitys carrying the twclid click identifier
- 02
Follow one real conversion end to end
- 03
Convert a test Lead and inspect the resulting Opportunity
If the identifier is not on the Opportunity, the field mapping is missing. This takes five minutes and rules out the most likely cause outright.
- 04
Compare engagement rate against conversion rate by campaign
On X the two frequently move in opposite directions, and that divergence is the finding rather than a measurement fault.
- 05
Read the match rate, not the success message
Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.
Salesforce → X Ads · prove
How it gets proven — Salesforce → X Ads
Source of truth
A Salesforce report of Closed Won opportunities for the same window, by close date.
- The twclid click identifier confirmed present on a live opportunity.
- Conversions reconciled per order against imported figures, with deduplication verified on a live test.
- A test lead converted end to end with the identifier confirmed present on the resulting opportunity.
Salesforce → X Ads · free audit
What we check in the free audit
- Count opportunitys carrying the twclid click identifier
- Follow one real conversion end to end
- Convert a test Lead and inspect the resulting Opportunity
- Compare engagement rate against conversion rate by campaign
- Read the match rate, not the success message
Checked against
A Salesforce report of Closed Won opportunities for the same window, by close date.
Free30 minutesNo obligation
Salesforce → X Ads · when not to buy
When you don't need this — Salesforce → X Ads
- Measure identifier coverage yourself first — pull your last hundred opportunitys and count how many carry the twclid click identifier.
- If your Salesforce instance is heavily customized and administered by another team, scope their availability before commissioning this — the build is usually blocked on admin access rather than on the tracking work.
- If X is a brand and community channel for you rather than a performance one, measure it that way and do not force a conversion pipeline onto it.
Salesforce → X Ads · what we deliver
What gets built — Salesforce → X Ads
Identifier capture into Salesforce
Custom field on Lead, matching custom field on Contact and Opportunity, and the field mapping configured so conversion carries it across. Verify by converting a test lead and reading the resulting opportunity.
Event source: a Salesforce flow, Apex trigger or scheduled export on StageName change
Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.
Dispatch to X Ads
The X Conversions API, posted server-side with the click identifier and hashed customer data.
Reversals where they exist
An opportunity moved back out of Closed Won can be retracted, and enterprise pipelines do this often enough to be worth wiring.
Written guarantee
95%+ tracking accuracy
Measured against A Salesforce report of Closed Won opportunities for the same window, by close date.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Salesforce → X Ads questions, answered
Save twclid on the Lead at form submission, map it through conversion, and send lead and Closed Won events to X's Conversions API from Salesforce. Use the Lead or Opportunity ID as the conversion ID.
twclid was likely lost in the in-app browser before the form fill, or dropped at Lead conversion. Check a recent Lead and a converted Opportunity for the field.
Almost always because the twclid click identifier never reached the Salesforce Lead or Opportunity. Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable. Measure coverage before debugging the dispatch.
X appends twclid to the landing URL and the pixel stores it. It behaves like other click identifiers, with the usual caveat that a large share of X traffic arrives through the in-app browser, where storage is partitioned and short-lived.
A Salesforce flow, Apex trigger or scheduled export on StageName change. Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.
Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.
More on Salesforce → X Ads
- Salesforce → Google AdsConnecting Salesforce to Google Ads
- Salesforce → Microsoft AdsConnecting Salesforce to Microsoft Ads
- Salesforce → Apple Search AdsConnecting Salesforce to Apple Search Ads
RELATED GUIDES
Where Salesforce → X Ads fits in the rest of your tracking
- X Ads · Home servicesX Ads conversion tracking for home service businesses
- X Ads · Financial servicesX Ads conversion tracking for financial services firms
- X Ads × CRM DealsHow to reconcile X Ads against your CRM's closed-won deals
- X Ads · Demo request → opportunityHow to track demo request to opportunity for X Ads
- Copper → X AdsConnecting Copper to X Ads
- Salesforce → MetaConnecting Salesforce to Meta Conversions API
- Home servicesConversion tracking for home service businesses, measured in completed jobs
- Freshsales → X AdsConnecting Freshsales to X Ads
Free · 30 min
Get Salesforce and X Ads joined properly
Free30 minutesNo obligation
