UTM Grabber

Menu

How to Track UTM Parameters in Salesforce: Fix Lead Source, Web-to-Lead, GCLID, and Campaign Attribution

Salesforce is where revenue teams expect the truth to live.

But when Salesforce UTM tracking is not set up correctly, the truth gets split across five places:

  1. Google Ads knows the click.
  2. Meta Ads knows the creative.
  3. GA4 knows the session.
  4. WordPress knows the form submission.
  5. Salesforce only says Web, Referral, Other, Direct, or a manually selected Lead Source.

That is the moment marketing, sales, and finance start arguing about which campaign actually created the pipeline.

If you searched for how to track UTM parameters in Salesforce, the answer is not "just use Lead Source." Lead Source is useful, but it is too small to carry the full attribution story.

The practical answer is:

Capture UTMs and click IDs on the website, pass them through hidden fields, store them in dedicated Salesforce fields, preserve first-touch attribution, update latest-touch attribution, and make sure the data survives Lead conversion into Contacts, Accounts, Opportunities, Campaigns, and offline conversion imports.

This guide explains how to set up Salesforce UTM tracking for WordPress forms, Web-to-Lead, Brilliant Web-to-Lead, custom Lead fields, Salesforce Campaigns, Campaign Influence, gclid, gbraid, wbraid, fbclid, and CRM reporting.

Salesforce UTM tracking field map from landing page parameters to hidden form fields and Salesforce Lead custom fields

If Salesforce lead source tracking is not working

  • Your Salesforce Leads say Web, but you need to know the exact campaign, keyword, ad, landing page, and click ID.
  • utm_source and utm_campaign appear in the landing page URL, but they are blank on the Salesforce Lead.
  • Web-to-Lead creates the Lead, but the hidden UTM fields never populate.
  • Google Ads sends gclid, gbraid, or wbraid, but Salesforce cannot send useful offline conversions back.
  • Meta Ads sends fbclid, but the CRM cannot connect qualified leads or won deals to the original ad click.
  • The Lead has UTM fields, but the Contact or Opportunity loses them after Lead conversion.
  • The sales team overwrites Lead Source manually, so campaign reporting drifts.
  • Salesforce Campaigns exist, but Campaign Influence does not explain the actual ad or keyword that brought the lead in.

Most Salesforce attribution problems are field design problems, not dashboard problems.

Salesforce UTM tracking is not the same as Lead Source

The most common Salesforce attribution mistake is trying to put too much meaning into Lead Source.

Lead Source is good for a broad channel or source category:

  • Web
  • Google Ads
  • Paid Search
  • Paid Social
  • Referral
  • Partner
  • Event
  • Direct Mail

But Lead Source should not be your only attribution field.

It should not have to store:

  • utm_source
  • utm_medium
  • utm_campaign
  • utm_content
  • utm_term
  • gclid
  • gbraid
  • wbraid
  • fbclid
  • msclkid
  • landing page
  • first referrer
  • latest referrer
  • first-touch source
  • latest-touch source
  • ad ID
  • ad set ID
  • campaign ID
  • keyword

When teams force all of that into Lead Source, reporting gets messy. Picklists explode. Sales reps select different values. Campaign detail disappears. Google Ads offline conversion imports become weaker. Salesforce reports start showing broad source categories when leadership needs campaign-level answers.

The better model is:

Lead Source tells you the channel. UTM and click ID fields tell you the campaign journey.

The Salesforce fields you should create first

Start with dedicated custom fields on the Lead object. Then decide which ones should map to Contact, Account, and Opportunity during Lead conversion.

Here is a practical starting schema.

Salesforce fieldExample API nameWhy it matters
UTM SourceUTM_Source__cPlatform, publisher, or source, such as google, facebook, linkedin, newsletter, or partner.
UTM MediumUTM_Medium__cChannel or medium, such as cpc, paid_social, email, organic, or referral.
UTM CampaignUTM_Campaign__cCampaign name or campaign code used in ad platform reporting.
UTM ContentUTM_Content__cCreative, ad, placement, asset, or CTA variant.
UTM TermUTM_Term__cKeyword, audience, or targeting detail when available.
GCLIDGCLID__cGoogle Ads click ID for offline conversion matching.
GBRAIDGBRAID__cGoogle click ID used in some privacy and app/browser paths.
WBRAIDWBRAID__cGoogle click ID used in some privacy and app/browser paths.
FBCLIDFBCLID__cMeta click ID. Useful for diagnostics and server-side event flows.
MSCLKIDMSCLKID__cMicrosoft Ads click ID.
First Landing PageFirst_Landing_Page__cFirst page where the tracked visitor entered.
First ReferrerFirst_Referrer__cOriginal referring URL or domain.
Last Landing PageLast_Landing_Page__cLatest page before conversion.
Last ReferrerLast_Referrer__cLatest referring URL or domain.

For more mature Salesforce attribution, add a second set of fields for first touch and latest touch:

Field groupBehavior
First-touch UTM fieldsWrite once. Do not overwrite once populated.
Latest-touch UTM fieldsUpdate on each new tracked conversion or qualified touch.
Click ID fieldsPreserve the ID tied to the conversion event you plan to send back to ad platforms.

First touch answers "what originally acquired this person?" Latest touch answers "what brought them back right before this conversion?"

You usually need both.

Salesforce Web-to-Lead hidden field setup using UTM Grabber shortcodes and custom Salesforce Lead fields

How UTMs get into Salesforce from WordPress

Salesforce does not magically know the UTM parameters that were present in the visitor's browser.

The data has to move through the full path:

  1. The visitor lands on a tagged URL.
  2. The website captures the parameters.
  3. The website stores them long enough for the visitor to submit a form.
  4. The form includes hidden fields.
  5. The hidden fields are populated before submit.
  6. The submission sends those values to Salesforce.
  7. Salesforce saves them to the correct Lead fields.
  8. Lead conversion mapping carries the important fields into Contacts, Accounts, and Opportunities.

With HandL UTM Grabber, the website side is handled by capturing and saving attribution values in the browser. Then you use shortcodes in hidden field values.

For example:

[utm_source]
[utm_medium]
[utm_campaign]
[utm_content]
[utm_term]
[gclid]
[fbclid]
[msclkid]
[first_utm_source]
[first_utm_campaign]
[handl_landing_page]
[handl_original_ref]

That matters because a visitor often does not submit the form on the first page.

They might enter through:

https://example.com/demo?utm_source=google&utm_medium=cpc&utm_campaign=salesforce_demo&gclid=EAIaIQ...

Then they click pricing, read a case study, open a booking page, and submit later from:

https://example.com/contact

If your tracking only reads the current URL, the UTM values are gone. If you persist them client-side and pass them into hidden fields, Salesforce still receives the source context.

Web-to-Lead UTM tracking: what usually breaks

Salesforce Web-to-Lead is simple in concept: an HTML form posts to Salesforce and creates a Lead.

The problem is that Web-to-Lead forms only send the fields present in the submitted form. If your UTM fields are not included, not populated, or not named correctly, Salesforce will create the Lead without attribution.

Common Web-to-Lead failures:

  • The custom Lead field exists in Salesforce, but the Web-to-Lead form does not include it.
  • The hidden input uses the wrong Salesforce field ID or API name.
  • The hidden field is present, but JavaScript never writes the UTM value into it.
  • The form plugin uses a visible text field instead of a hidden field.
  • The hidden field is hidden in the UI, but missing from the submitted payload.
  • A validation rule or picklist rejects the value.
  • The Lead is created correctly, but Lead conversion mapping is missing, so the Contact or Opportunity loses the field.

The right pattern is:

<input type="hidden" name="00N..." id="00N..." value="[utm_source]">
<input type="hidden" name="00N..." id="00N..." value="[utm_medium]">
<input type="hidden" name="00N..." id="00N..." value="[utm_campaign]">
<input type="hidden" name="00N..." id="00N..." value="[gclid]">

If you use the Brilliant Web-to-Lead for Salesforce plugin, the UTM Grabber docs show the same idea: edit the form and use the relevant shortcode in the value field. For the native Salesforce integration in HandL UTM Grabber, the setup is also field-based: go to Settings > Salesforce, add a form, add fields, set them as hidden, and use shortcodes as values.

A hidden field is only useful if it is included in the actual submitted payload.

Always test the final browser submission, not just the form builder screen.

The difference between Salesforce fields, Campaigns, and Campaign Influence

Salesforce Campaigns are useful, but they do not replace UTMs.

Think of the layers this way:

LayerWhat it answersExample
Lead SourceBroad origin categoryGoogle Ads
UTM fieldsCampaign and click detailutm_campaign=spring_demo, utm_content=video_ad_3
Salesforce CampaignSalesforce campaign membership or response trackingSpring Demo Requests
Campaign InfluenceWhich campaigns influenced an OpportunityCampaign A influenced Opportunity X
Google/Meta click IDsAd platform matching for feedback loopsgclid, gbraid, wbraid, fbclid

If you only use Salesforce Campaigns, you may know that a Lead responded to a campaign. But you may not know the exact ad, keyword, landing page, or source string that created the session.

If you only use UTM fields, you may know the ad context, but you may not have the Lead connected to Salesforce Campaign reporting or Campaign Influence.

The stronger setup uses both:

  1. Store UTM and click ID fields on the Lead.
  2. Add the Lead or Contact to the appropriate Salesforce Campaign when the business logic is clear.
  3. Preserve the original UTM values even if Campaign membership changes later.
  4. Map key attribution fields forward during Lead conversion.
  5. Use Campaign Influence for opportunity influence, not as a substitute for raw tracking fields.

GCLID missing in Salesforce? Start here

If you run Google Ads, gclid, gbraid, and wbraid are not small details. They can be the difference between vague CRM reporting and useful offline conversion feedback.

Google's Salesforce integration and offline conversion documentation is built around connecting ad clicks to later CRM milestones. But that only works if the click identity survives long enough to be attached to the right Lead or Opportunity.

The usual flow looks like this:

  1. Google Ads sends traffic with auto-tagging and click IDs.
  2. The landing page captures gclid, gbraid, or wbraid.
  3. The form passes the click ID into Salesforce.
  4. Salesforce stores it on the Lead.
  5. Lead conversion mapping carries it into the Opportunity if needed.
  6. A qualified lead, converted lead, or closed-won event is imported back to Google Ads.
Salesforce GCLID offline conversion flow from Google Ads click to WordPress form, Salesforce Lead, Opportunity, and Google Ads import

When this fails, check these before touching bidding strategy:

  • Is Google Ads auto-tagging enabled?
  • Does the landing page URL actually contain gclid, gbraid, or wbraid?
  • Does your website capture the click ID before redirects remove it?
  • Is the click ID saved in a hidden form field?
  • Does the Salesforce Lead show the click ID?
  • Is the field visible to the integration user?
  • Does Lead conversion mapping carry the field forward if the import reads from Opportunity?
  • Are duplicate rules or merge rules keeping the wrong older value?
  • Are consent rules preventing the click ID from being stored?

If the click ID is not on the Salesforce record, the ad platform cannot reliably connect the CRM outcome to the original click.

First-touch and latest-touch fields in Salesforce

Salesforce records live longer than one session.

A buyer might:

  1. First arrive from Google Ads.
  2. Return from a LinkedIn retargeting ad.
  3. Click an email.
  4. Submit a pricing form.
  5. Book a demo.
  6. Become an Opportunity.
  7. Close two months later.

If you only have one UTM_Source__c field and every form submission overwrites it, you lose context.

Use two field groups:

Field typeRule
First-touch fieldsPopulate only if blank. Keep original acquisition context.
Latest-touch fieldsUpdate when a new tracked conversion happens.
Conversion-touch fieldsStore the source/click ID tied to a specific action, such as demo request or consultation booking.

This prevents a retargeting click, an email click, or a direct return visit from erasing the acquisition source.

It also gives leadership two useful views:

  • Original source: what created the person or account.
  • Conversion source: what pushed them into a Lead, meeting, Opportunity, or purchase.

What to map during Salesforce Lead conversion

Lead conversion is where many Salesforce UTM setups quietly fail.

The Lead shows campaign data. Then the rep converts the Lead. The Contact is created. The Opportunity is created. The UTM fields are suddenly gone from the report that matters.

That happens when field mapping is incomplete.

At minimum, decide which fields should map from Lead to:

  • Contact
  • Account
  • Opportunity

For B2B reporting, Opportunity mapping is especially important because revenue reports usually live at the Opportunity level.

A practical mapping strategy:

Lead fieldContactAccountOpportunity
First UTM SourceYesOptionalYes
First UTM CampaignYesOptionalYes
Latest UTM SourceYesOptionalYes
Latest UTM CampaignYesOptionalYes
GCLID / GBRAID / WBRAIDOptionalNoYes if used for offline import
Landing PageYesOptionalYes
ReferrerYesOptionalOptional

Do not assume the fields mapped just because they exist on the Lead.

Test conversion with a real Lead and inspect the Contact and Opportunity afterward.

Salesforce UTM field names: keep them boring

Attribution fields should be easy to understand, easy to report on, and hard to misuse.

Use names like:

First UTM Source
First UTM Medium
First UTM Campaign
First UTM Content
First UTM Term

Latest UTM Source
Latest UTM Medium
Latest UTM Campaign
Latest UTM Content
Latest UTM Term

GCLID
GBRAID
WBRAID
FBCLID
MSCLKID
First Landing Page
Latest Landing Page
First Referrer
Latest Referrer

Avoid names like:

Campaign
Source
Marketing
Tracking
Ad Info
Lead Detail

Those names are too vague. Six months later, nobody knows whether Campaign means Salesforce Campaign, Google Ads campaign, Meta campaign, UTM campaign, Pardot campaign, or a sales campaign.

What about Account Engagement, Marketing Cloud, or other Salesforce products?

Salesforce has multiple marketing and attribution surfaces. Teams might use Sales Cloud, Account Engagement, Marketing Cloud, Marketing Cloud Personalization, Data Cloud, or a third-party form system.

The implementation details change, but the tracking principle does not:

The first system that sees the browser session must capture the attribution data and pass it to the system of record.

If the form is a WordPress form that creates a Salesforce Lead, WordPress needs to capture and submit the UTM data.

If the form is Web-to-Lead, the HTML form needs hidden fields.

If the form is embedded in an iframe, the iframe needs to receive the parameters or otherwise read persisted values.

If a marketing automation platform creates the Lead, the integration must map the attribution fields into Salesforce.

If Salesforce is downstream, it cannot guess the original campaign after the fact.

The Salesforce UTM QA checklist

Use this before you trust any report.

1. Test with a real tagged URL

Use a URL like:

https://example.com/demo?utm_source=google&utm_medium=cpc&utm_campaign=salesforce_utm_test&utm_content=ad_a&utm_term=crm_tracking&gclid=test-gclid-123

Submit the form like a normal visitor.

2. Inspect the form payload

Use browser developer tools or your form submission logs.

Confirm the payload includes:

  • utm_source
  • utm_medium
  • utm_campaign
  • utm_content
  • utm_term
  • gclid
  • landing page
  • referrer

3. Inspect the Salesforce Lead

Open the created Lead and confirm the custom fields are populated.

Do not stop at "the Lead was created." That only proves the form worked. It does not prove attribution worked.

4. Convert the Lead

Convert the Lead into Contact, Account, and Opportunity if that is your normal process.

Confirm key fields survived the conversion.

5. Check reports and permissions

Make sure the fields are:

  • Available to the integration user.
  • Visible on the relevant page layouts.
  • Included in report types.
  • Included in exports or dashboards.
  • Available to Flow, Zapier, Make, or API jobs that need them.

6. Test duplicate and returning visitor behavior

Submit again from a different source.

Confirm first-touch fields stay stable and latest-touch fields update only when intended.

7. Test ad platform feedback

If Google Ads, Meta, LinkedIn, or Microsoft Ads needs offline conversion feedback, confirm the required click ID or matching fields exist on the record used for import.

Common Salesforce attribution problems and fixes

UTM parameters are in the URL but blank in Salesforce

This usually means the website did not pass values into hidden fields, or the hidden fields were not included in the submitted payload.

Fix:

  1. Capture the UTM parameters on arrival.
  2. Persist them in the browser.
  3. Add hidden fields to the form.
  4. Populate the fields before submit.
  5. Map the fields into Salesforce.

Salesforce Lead Source says Web for every lead

Lead Source is broad by design. It may tell you the lead came through the web, not the campaign that created the lead.

Fix:

Keep Lead Source simple, then add dedicated UTM and click ID fields.

GCLID is missing from Salesforce

The most likely causes are redirects, missing hidden fields, consent timing, form plugin timing, or a field mapping issue.

Fix:

Test with a real Google Ads click or a controlled tagged URL. Confirm gclid, gbraid, or wbraid reaches the landing page, hidden field, Salesforce Lead, and Opportunity if needed.

The Lead has UTMs but the Opportunity does not

This is usually a Lead conversion mapping issue.

Fix:

Map important custom Lead fields to Opportunity fields before conversion, then retest with a new Lead.

Salesforce Campaign reports do not match UTM reports

Campaign membership and UTM fields answer different questions.

Fix:

Use UTMs for source/campaign/click detail. Use Salesforce Campaigns for campaign membership, response, and influence logic.

First-touch attribution keeps changing

One field is being overwritten by every submission.

Fix:

Use first-touch fields that write only when blank and latest-touch fields that can update.

Form submissions from cached pages are missing UTM fields

Caching can serve the page fast, but the hidden fields still need to be filled client-side at the right time.

Fix:

Use client-side UTM persistence and test the real cached page, not only a logged-in admin page.

Consent management blocks tracking

Some consent tools delay cookies, scripts, or storage until after consent.

Fix:

Define which attribution values are allowed before consent in your compliance model, then test both consent accepted and consent declined states.

What a clean Salesforce attribution report should answer

A healthy setup should let you answer:

  • Which campaigns created new Leads?
  • Which campaigns created qualified Leads?
  • Which campaigns created Opportunities?
  • Which campaigns created closed-won revenue?
  • Which keywords or ads created pipeline?
  • Which forms are losing attribution?
  • Which landing pages generate high-quality Leads?
  • Which first-touch sources create accounts?
  • Which latest-touch sources drive demo requests?
  • Which click IDs are missing before offline conversion import?

If your Salesforce report cannot answer those questions, the issue is usually upstream.

The missing data was probably never captured, never submitted, never mapped, or overwritten later.

The hidden cost of weak Salesforce UTM tracking

Bad Salesforce attribution does not only make reports ugly.

It changes decisions.

Teams pause campaigns that are actually creating pipeline. They scale campaigns that only create low-quality leads. They give sales teams source values that are too vague to route or prioritize. They send weak offline conversion data back to ad platforms. Then Google, Meta, LinkedIn, and Microsoft optimize against partial truth.

If Salesforce is the revenue source of truth, attribution fields need the same care as email, phone, company, and opportunity amount.

What good Salesforce UTM tracking looks like

  • Every form submission has hidden attribution fields.
  • UTM values persist across pages before form submission.
  • Lead Source stays simple and readable.
  • Dedicated UTM fields store campaign-level detail.
  • First-touch fields do not get overwritten.
  • Latest-touch fields update intentionally.
  • gclid, gbraid, wbraid, fbclid, and msclkid are captured when present.
  • Lead conversion mapping carries important fields into Contact and Opportunity records.
  • Salesforce Campaigns and Campaign Influence complement UTMs instead of replacing them.
  • Google Ads offline conversion imports have the click ID or matching data they need.
  • Sales, marketing, and finance can inspect the same record and understand where the lead came from.

Why trying harder in Salesforce reports will not fix this

Salesforce reports can only report on data that exists.

If the website never captured utm_campaign, a report cannot recover it.

If Web-to-Lead never submitted the hidden field, Salesforce cannot infer it.

If Lead conversion mapping dropped the field before Opportunity creation, pipeline reporting will stay incomplete.

If first-touch fields are overwritten every week, your historical acquisition reporting will keep moving.

The fix has to happen at the capture, persistence, field mapping, and conversion-mapping layers.

How HandL UTM Grabber helps Salesforce attribution

HandL UTM Grabber captures UTM parameters, click IDs, referrer data, landing page data, and first-touch/latest-touch values on WordPress, then makes those values available to forms and integrations.

For Salesforce, that means you can populate hidden fields with shortcodes, send campaign data into Salesforce Leads, preserve first-touch context, capture click IDs for offline conversion workflows, and avoid the classic "Lead Source is Web, but nobody knows which campaign worked" problem.

This is especially useful when Salesforce is downstream from WordPress forms, Web-to-Lead forms, Brilliant Web-to-Lead, Zapier, Make, or custom workflows.

Who should use this Salesforce UTM tracking setup

  • B2B teams that use Salesforce as the source of truth for pipeline and revenue.
  • Agencies that need to prove which campaigns create qualified leads, not just form fills.
  • WordPress sites sending leads into Salesforce through forms, Web-to-Lead, Zapier, Make, or custom integrations.
  • Paid media teams importing qualified leads or closed-won conversions back into Google Ads.
  • Revenue operations teams cleaning up Lead Source, Campaign, and Opportunity attribution.
  • Founders who need to know which channel actually creates sales, not just traffic.

"A must have tool for any serious business looking to convert more and figure out their points of conversion. The support from the developers is top notch. Highly recommended."

@shriram2u
@shriram2uMust have tool for Conversion Attribution

"I absolutely love the simplicity and functionality of this plugin. Its a secret weapon for marketing pros to track conversions better for all the different ad campaigns across sites too!"

@fawadgreenspace
@fawadgreenspaceBest UTM tracking plugin on WP

"Excellent plugin. Works perfectly and lets us track exactly what is going on and what works and doesn’t work with our marketing. Highly recommend!"

@restalfep
@restalfepExcellent Plugin! A+++++++

"This plugin does exactly what it promises and saves me a lot of time!The personal support stood out and made integrating this plugin super easy! Great work!!"

@niekrosens
@niekrosensGreat plugin and excellent support

"This is an amazing plugin: simple in is usage, but incredibly powerful in its use to track your campaigns. Very helpful and capable support. Utmgrabber is the best software to track the source of your woocommerce-clients (ads, …)."

@jessy86
@jessy86MAGNIFICENT plugin & support

"This plugin, in combination with WPForms, has solved an integral component of lead source tracking, and now allows us to save important marketing information to every form submission, which also creates a lead record in Salesforce. The support we've received alone is well worth the plugin price."

Related references

Sources checked: