Skip to content

Track Facebook Ads in Salesforce: a 4-step attribution setup

You can see which Facebook campaigns produce leads, opportunities, customers and revenue by carrying campaign identifiers from the ad click through to the Salesforce record created by a form submission. The workflow below explains how that handoff works, what to check before launch, and how to read the resulting reports.

Why connect ad clicks to CRM outcomes?

Without a link between ad clicks and CRM records, two opposite mistakes are easy: scaling a campaign that looks cheap in the ad platform but never closes, or cutting one that quietly produces profitable customers. Connecting the click to the lead, opportunity and closed deal lets spend decisions follow downstream outcomes instead of clicks alone.

The core idea is simple: tag the destination URL, remember those tags in the browser, copy them into the form at submission, and store them beside the contact details in Salesforce. Each later report then groups records by the remembered campaign rather than by guesswork.

How the attribution handoff works

A small site snippet inspects how a visitor arrived, using the same kind of technical signals analytics tools examine. It assigns the visit to a standard channel such as Organic Search, Paid Social or Paid Search, saves that assignment in a cookie, and later inserts it into hidden form fields. When the form is submitted, the values travel with the lead data into connected systems such as Salesforce, an email platform, a billing system or an analytics tool.

That stored channel record is what makes questions answerable inside the CRM: lead volume by channel, opportunities by campaign, closed-won customers by source, close rates by source, revenue by campaign, and return on ad spend when spend is compared with revenue.

The four setup steps

Step 1 — Install the snippet and prepare the form. Add the site snippet directly through site settings or through a tag manager. Then add five hidden fields to each lead-capture form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3 and Channel Drilldown 4. Most form builders let you drag in a hidden field type or hide a standard field in its settings.

Step 2 — Tag Facebook destinations with UTM parameters. UTM values are extra text appended to the destination URL. A consistent convention for Facebook is: utm_medium = Paid Social, utm_source = Facebook, utm_campaign = campaign name, utm_term = ad set name, and utm_content = specific ad. Free URL builders can help assemble these links, but consistency matters more than the builder used.

Step 3 — Let the snippet populate the hidden fields. On arrival, the UTM values are stored in a cookie so they survive browsing across pages. At form submission, the stored values are written into the hidden fields alongside the visitor's name, email and other details. The snippet also passes the landing page URL and landing page group, such as a /features section, so content performance can be reviewed as well.

Step 4 — Send the record into Salesforce. The campaign values arrive with the lead's contact details. From there, Salesforce native reports or a connected BI tool can be used for analysis.

Worked example and field map

Consider a demo-request form reached from a Facebook ad. The hidden fields could resolve as Channel = Paid Social, Channel Drilldown 1 = Facebook, Channel Drilldown 2 = Brand Campaign, Channel Drilldown 3 = North America Ad Group, and Channel Drilldown 4 = Green Ad, with the landing page recorded separately. That single record can then be counted in a leads-by-channel view, followed through to an opportunity, and finally included in revenue-by-campaign reporting if it closes.

Use this field map as a pre-launch checklist:

  • Site snippet present on every page where lead forms appear
  • Five hidden fields added to each lead form and mapped to the CRM destination
  • UTM convention documented and applied to every Facebook destination URL
  • Test submission checked in Salesforce for Channel, all four drilldowns, landing page and landing page group
  • Test record confirmed under the correct channel despite UTM naming variations
  • Reports built for leads by channel, customers by campaign and revenue by campaign

Reading the reports without fooling yourself

Leads by channel shows how Facebook compares with Google Ads, SEO and other sources, which helps decide where the next unit of budget should go. Customers by campaign separates campaigns that generate volume from campaigns that generate buyers; a campaign strong on leads but weak on customers is a candidate to pause or rework. Revenue by campaign goes one step further: the source example shows $65,000 in new revenue from Facebook Ads in August, and the test is whether total Facebook cost, including agency and creative costs, sits below that figure. Breaking the same view down by campaign shows where to invest more and where to stop.

Three distinctions prevent misreading these reports. First, leads are not customers: compare the two views before judging a campaign. Second, revenue is not ROI: subtract ad spend and associated costs before calling a campaign profitable. Third, Facebook-only data is incomplete: because other channels are captured too, relative performance can be judged rather than absolute Facebook volume alone.

Launch checklist and next step

Before scaling spend, confirm that a test lead carries the expected channel and drilldown values, that a multi-page journey still submits the original campaign values, and that reports reconcile with the number of form submissions. Then review leads, customers and revenue together each month. Campaigns that produce customers and revenue at a cost below the revenue they generate earn more budget; campaigns that produce only early-stage leads do not. If you evaluate a dedicated attribution tool for this workflow, check its current plan details and any trial conditions directly with the provider before signing up.

Hidden field map for Facebook Ads
Hidden fieldWhat it should contain for a Facebook ad
ChannelPaid Social
Channel Drilldown 1Facebook
Channel Drilldown 2Campaign name
Channel Drilldown 3Ad set or ad group name
Channel Drilldown 4Specific ad name

Values depend on the UTM parameters placed behind the ad; the example is illustrative.

Frequently asked questions

What is needed to connect Facebook Ads data to Salesforce leads?

Add UTM parameters to the ad destination URL, install the attribution snippet on the site, add the five hidden fields to lead forms, and let form submissions carry the stored values into Salesforce. The source workflow uses utm_medium for Paid Social, utm_source for Facebook, utm_campaign for the campaign name, utm_term for the ad set, and utm_content for the specific ad.

Does this only track Facebook, or other channels too?

Yes. The same capture covers Organic Search, Organic Social, Referral, Direct, Paid Search and other channels, so reports can compare Facebook against the rest of acquisition rather than showing Facebook in isolation.

What happens if a visitor browses several pages before submitting a form?

The values are stored in a browser cookie when the visitor arrives, so they persist while the visitor browses and can be written into whichever form they complete later, not only the first landing page.

How are inconsistent UTM values handled?

The tool is described as normalising inconsistent UTM values, for example treating utm_source=facebook and utm_source=facebook.com as the same Paid Social channel, which reduces split reporting from naming variations.

What reports become possible in Salesforce?

Once the fields reach Salesforce, native reporting can be used, or a connected BI tool such as Tableau or Looker for more advanced reporting. Typical views include leads by channel, customers by campaign, and revenue by campaign.