Salesforce is the dominant CRM for companies with active sales teams, and WordPress is the most common platform for the websites those sales teams rely on for leads. The combination is everywhere — but the default setup leaves a critical gap. Leads flow into Salesforce through Web-to-Lead forms or integration tools, contact records appear in the pipeline, and sales reps start working them. What is usually missing is where those leads came from. The source fields are blank, or they show “Web” as a catch-all with no campaign detail, and there is no reliable way to connect a closed deal back to the channel or ad that generated it.
This guide covers how to wire Salesforce and WordPress together so that every lead in your CRM carries the full attribution trail from the session that produced it.
What Salesforce Tracks by Default
Salesforce has a built-in Lead Source field, but it is a manually set dropdown — not an automatically captured value. When a Web-to-Lead form submits, Salesforce creates a lead record with whatever fields you included in the form. If you did not include UTM data, the lead has no UTM data. The Lead Source field will typically show whatever default value your admin configured, usually “Web” or blank.
Salesforce does not have a native mechanism to read UTM parameters from the visitor’s landing URL and carry them into the lead record. That requires a UTM capture layer on your WordPress site and custom fields on the Salesforce Lead object to receive the data.
Setting Up UTM Capture in WordPress
The foundation is capturing UTM parameters when a visitor first arrives on your site and persisting them across page navigation so they are available when the visitor eventually submits a form. The pattern is the same regardless of which CRM you are feeding:
- On landing, read UTM parameters from the URL and write them to first-party cookies. A small JavaScript snippet checks the URL for utm_source, utm_medium, utm_campaign, utm_term, and utm_content. When any are present, it writes them to cookies with a 30-day expiration. The cookies survive page navigation — a visitor who lands on a blog post, browses to a services page, and submits a contact form three clicks later still carries the UTMs from their original landing URL.
- Also capture the gclid (Google click identifier) and fbclid (Facebook click identifier) using the same cookie approach. These click identifiers are what you need later for Google Ads offline conversion upload — they tie the closed deal in Salesforce back to the specific paid click that started the journey.
- Capture the first landing page URL in a separate cookie (set only if the cookie does not already exist). This gives you the entry point the visitor used, which is valuable context alongside the UTMs for understanding which content is generating quality leads.
Custom Fields to Create in Salesforce
Before updating your forms, create custom fields in Salesforce to hold the attribution data. In Salesforce Setup, go to Object Manager > Lead > Fields and Relationships and add these as custom Text fields:
- UTM Source (Text, 255) — maps from utm_source (google, facebook, linkedin, email, etc.)
- UTM Medium (Text, 255) — maps from utm_medium (cpc, organic, email, social, etc.)
- UTM Campaign (Text, 255) — maps from utm_campaign (the campaign name you set in your ad platform)
- UTM Term (Text, 255) — maps from utm_term (the keyword for paid search)
- UTM Content (Text, 255) — maps from utm_content (ad variation identifier for A/B testing)
- Landing Page (URL, 255) — the first page the visitor landed on
- GCLID (Text, 255) — Google click identifier, required for Google Ads offline conversion upload
- FBCLID (Text, 255) — Facebook click identifier, for Meta offline conversion upload
Mirror these same fields on the Opportunity object. When a Lead converts to an Opportunity in Salesforce, the standard conversion does not automatically carry custom fields — you need a Flow or Process Builder automation to copy them, which is covered below.
Connecting WordPress Forms to Salesforce
There are three main approaches for routing form submissions from WordPress into Salesforce with attribution data included.
Option 1: Salesforce Web-to-Lead with Hidden Fields
Salesforce’s native Web-to-Lead generates an HTML form you embed on your WordPress site. The form posts directly to Salesforce’s submission endpoint. To include attribution data, add hidden input fields to the generated form HTML with the Salesforce API names for your custom fields (e.g., UTM_Source__c, UTM_Campaign__c). A JavaScript snippet reads the cookies at page load and populates the hidden fields before the visitor submits. This approach requires zero third-party integration tools and works as long as the cookie values are present when the form renders.
Option 2: WordPress Form Plugin with Salesforce Integration
Plugins like Gravity Forms, WPForms, and Fluent Forms have native or add-on integrations with Salesforce that map form fields to Salesforce fields on submission. Add hidden fields to your WordPress form that read the UTM cookies (populated by JavaScript), then map those hidden fields to your custom Salesforce Lead fields in the plugin’s integration settings. This gives you full control over the form design on your WordPress site while routing to Salesforce natively. The hidden field population script needs to fire after the form renders — move it to after the form HTML or use a DOMContentLoaded event listener if the default timing causes blank values.
Option 3: Zapier or Make (Integromat)
If your form plugin does not have a direct Salesforce integration, use Zapier or Make to bridge the submission to Salesforce. The form plugin sends a webhook to Zapier, Zapier maps the fields to a Salesforce “Create Lead” action. Make sure your hidden UTM fields are included in the webhook payload from the form plugin — if they are not mapped as outputs in the plugin’s webhook settings, they will not arrive in Zapier. The downside of this path is added latency (Zapier can introduce a delay of a few minutes) and a dependency on the connection staying active and the Zap not hitting errors.
Copying Attribution From Lead to Opportunity in Salesforce
When a Salesforce Lead converts to a Contact and Opportunity, custom field values on the Lead do not automatically transfer. To get attribution onto the Opportunity (which is where deal value lives and where revenue reporting happens), you need an automation to copy the fields at conversion time.
The cleanest approach is a Salesforce Flow:
- Trigger: Record-triggered Flow on Opportunity creation (when IsWon is false and the Opportunity has a converted Lead source)
- Get Records: fetch the related converted Lead using the Opportunity’s associated Contact’s ConvertedFromLeadId
- Update Records: copy each custom attribution field from the Lead to the Opportunity
Once this is in place, every new Opportunity has the original Lead’s UTM data on it, and your Opportunity reports can filter and group by attribution fields without manual data entry.
Reporting: Which Channels Produce Closed Revenue
With attribution on Opportunities, you can run the most important report in your marketing stack: closed revenue by source channel.
In Salesforce Reports, create an Opportunity report filtered to Closed Won and group by your UTM Medium field. This shows revenue breakdown by channel: cpc (paid search), organic, email, social, direct. Compare this to your lead volume by source (a separate Leads report grouped by UTM Medium) to identify which channels convert leads to closed deals at the highest rate — which is frequently very different from which channels produce the most leads by volume.
For campaign-level analysis, add UTM Campaign as a second grouping to see which specific campaigns produce the most closed revenue, not just the most form fills. The UTM Term field gives you keyword-level closed deal data for paid search — which searches are actually worth the click cost versus which generate leads that never close.
Google Ads Offline Conversion Upload
If your WordPress forms capture GCLID into a Salesforce custom field, you have what you need to close the loop with Google Ads. When an Opportunity reaches Closed Won, the GCLID, close date, and deal value can be uploaded to Google Ads as an offline conversion event. This tells Google Ads which ad clicks produced actual customers — not just form fills — and its Smart Bidding adjusts to favor the keywords and audiences that generate revenue.
Two ways to implement this:
- Salesforce Flow + Google Ads API: A record-triggered Flow fires when an Opportunity reaches Closed Won. The Flow calls the Google Ads offline conversions API via a connected app or an outbound HTTP callout, posting the GCLID and conversion details. This is fully automated once configured — no CSV exports, no manual steps.
- Manual CSV upload: Export Closed Won Opportunities from a Salesforce report filtered by a date range, include the GCLID column, format the export as the Google Ads offline conversion import template (columns: Google Click ID, Conversion Name, Conversion Time, Conversion Value, Conversion Currency), and upload via Google Ads > Goals > Conversions > Offline conversion imports. This approach works without any API integration and is a solid starting point before investing in the automated path.
What the Full Stack Looks Like
When everything is connected:
- A visitor clicks a Google Ad and arrives on your site with UTM parameters and a GCLID in the URL
- The UTM capture script stores all parameters and the GCLID in cookies
- The visitor browses several pages, then submits a contact form
- Hidden fields read the cookies and submit UTMs and GCLID alongside the form data
- The form creates a Salesforce Lead with UTM Source = google, UTM Medium = cpc, UTM Campaign = your campaign name, GCLID = the click value
- A sales rep works the lead, converts it, and an Opportunity is created
- A Salesforce Flow copies all attribution fields from the Lead to the Opportunity
- When the Opportunity closes, the GCLID uploads to Google Ads as an offline conversion
- Google Ads Smart Bidding optimizes toward the keywords that produce closed deals, not just form fills
The setup takes a few hours across WordPress, Salesforce, and Google Ads. The payoff is that your Salesforce Opportunity reports reflect actual channel performance and your Google Ads campaigns optimize on revenue, not lead volume.
For a WordPress attribution layer that handles UTM capture, hidden field population, CRM routing, and Google Ads offline conversion upload as a connected system — rather than assembling each piece separately — Sales Provenance integrates everything described here. Related reading: UTM parameter tracking on WordPress, CRM integration for WordPress, HubSpot and WordPress lead tracking, Pipedrive and WordPress lead tracking, and Google Ads conversion tracking for WordPress.