Skip to main content
Gravity Forms → SalesforceIntegration guide

Connecting Gravity Forms to Salesforce

Gravity Forms stores the entry in your own WordPress database, which makes it one of the easier sources to join correctly. Sending conversions into Salesforce rather than out of it is how marketing data reaches the place sales actually works. The join between them succeeds or fails on one thing: whether the Lead or Contact identity reaches the Gravity Forms entry before the conversion happens, because Salesforce can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Gravity Forms to Salesforce: gclid on the Lead, revenue later

Write Gravity Forms hidden-field click IDs like gclid, fbclid and GA4 client_id into custom Lead fields, mapped through to Contact and Opportunity on conversion, then send closed-won value to ad platforms from Salesforce. Web-to-Lead returns no errors, so test from a cached page and open the Lead. Decide which touch wins on duplicate Leads.

This is the pairing where form tracking becomes revenue tracking. The Gravity Forms entry creates a Salesforce Lead, and the Lead later becomes an Opportunity. The ad platforms should hear about it when that Opportunity closes, not when the form is submitted. For that to work, the click identifiers in the hidden fields (gclid, fbclid, the GA4 client_id) have to be written into custom fields on the Lead and mapped through to the Contact and Opportunity on lead conversion.

Check how the entry actually reaches Salesforce. That might be a Salesforce add-on, Web-to-Lead posted from the form, or an automation tool in the middle. Each handles field mapping and failures differently. Web-to-Lead in particular gives the form no clear error back, so a validation rule or field-level security setting can drop the gclid field without anyone noticing. Submit a test entry from a cached page and open the resulting Lead.

Duplicate Leads are the next problem. A visitor who submits twice, or submits after already being a Contact, creates a second record holding the newer click ID. Decide which touch wins under your matching rules. Then send closed-won value to the ad platforms from Salesforce, not from Gravity Forms.

Gravity Forms → Salesforce · what breaks

Why this join usually fails — Gravity Forms → Salesforce

  1. 01

    The Lead or Contact identity never reaches Gravity Forms

    The identifier must be written into a hidden field with dynamic population enabled, and that only works if the parameter is on the URL when the page renders. Page caching serves a cached render to the visitor, so the dynamic population never runs — the same caching problem that breaks WooCommerce.

  2. 02

    Dynamic population fails silently under page caching

    The field is configured correctly and still arrives empty, because the visitor was served a cached page rendered for someone else. This is the most common Gravity Forms failure and it looks like nothing is wrong.

  3. 03

    Writes that succeed and change nothing

    Field-level security, validation rules and required-field constraints can reject a write while the API reports success. Open the record and look rather than trusting the response.

  4. 04

    Nothing reconciles afterwards

    Check the record in Salesforce itself, not the API response. Then confirm the value survives Lead conversion onto the Contact, Account and Opportunity — the mapping is separate and is usually the thing that was missed.

Gravity Forms → Salesforce · the fix

What working looks like — Gravity Forms → Salesforce

  • The Lead or Contact identity on every entry

  • Conversions arriving in Salesforce

    The marketing context appears on the record and flows into the opportunity, where sales and reporting can both use it.

  • Reconciled against the source

Gravity Forms → Salesforce · architecture

How Gravity Forms and Salesforce actually connect

  1. 1

    Gravity Forms holds the truth

    The entry lives in your database with every field value attached. You can query it, back it up and reconcile against it without depending on any third party, which is a real advantage over hosted form tools.

  2. 2

    Salesforce needs a click to match

    Salesforce needs a resolvable record and a custom field to write to. Field-level security and validation rules can silently reject writes, which is a Salesforce-specific failure that returns success at the API level and changes nothing.

  3. 3

    The identifier is the bridge

    The Lead or Contact identity, captured at the visit and carried into the Gravity Forms entry.

  4. 4

    The event source decides reliability

    Fire server-side from the PHP hook. This runs regardless of caching, AJAX submission, or what the confirmation page does.

  5. 5

    Deduplication at the destination

    Salesforce deduplicates according to whatever matching rules your org has configured, which vary enormously between instances. Duplicate Leads are the standard failure and merging them afterwards is manual work.

Gravity Forms → Salesforce · normal or broken

Working vs. broken, side by side — Gravity Forms → Salesforce

Normal, not a fault

  • The Lead or Contact identity present on the entry

  • Sent from the gform_after_submission hook

  • Deduplicated correctly

    Salesforce deduplicates according to whatever matching rules your org has configured, which vary enormously between instances. Duplicate Leads are the standard failure and merging them afterwards is manual work.

  • Reconciles with the source

Actually broken

  • The Lead or Contact identity missing on most records

    The identifier must be written into a hidden field with dynamic population enabled, and that only works if the parameter is on the URL when the page renders. Page caching serves a cached render to the visitor, so the dynamic population never runs — the same caching problem that breaks WooCommerce.

  • Sent from the browser

    The field is configured correctly and still arrives empty, because the visitor was served a cached page rendered for someone else. This is the most common Gravity Forms failure and it looks like nothing is wrong.

  • Counted twice, or not at all

    Field-level security, validation rules and required-field constraints can reject a write while the API reports success. Open the record and look rather than trusting the response.

  • Nobody has reconciled it

Gravity Forms → Salesforce · diagnose

Diagnostic order — Gravity Forms → Salesforce

  1. 01

    Count entrys carrying the Lead or Contact identity

  2. 02

    Follow one real conversion end to end

  3. 03

    Submit a test entry through a cached page

    Not through a logged-in admin session, which bypasses the cache. If the hidden field is empty on the cached path and populated on the admin path, caching is your cause.

  4. 04

    Write a test value and open the record in the UI

    The API saying it worked and the field actually holding the value are different things in Salesforce more than anywhere else.

  5. 05

    Read the match rate, not the success message

    Check the record in Salesforce itself, not the API response. Then confirm the value survives Lead conversion onto the Contact, Account and Opportunity — the mapping is separate and is usually the thing that was missed.

Gravity Forms → Salesforce · prove

How it gets proven — Gravity Forms → Salesforce

Source of truth

The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.

  • The Lead or Contact identity confirmed present on a live entry.
  • A test value confirmed present on the record in the UI, and confirmed to survive Lead conversion.
  • Entry meta confirmed populated on a submission made from a fully cached page as an anonymous visitor.

Gravity Forms → Salesforce · free audit

What we check in the free audit

  • Count entrys carrying the Lead or Contact identity
  • Follow one real conversion end to end
  • Submit a test entry through a cached page
  • Write a test value and open the record in the UI
  • Read the match rate, not the success message

Checked against

The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.

Get my free conversion tracking audit

Free30 minutesNo obligation

Gravity Forms → Salesforce · when not to buy

When you don't need this — Gravity Forms → Salesforce

  • Measure identifier coverage yourself first — pull your last hundred entrys and count how many carry the Lead or Contact identity.
  • If your site has no caching layer and one form, a developer can wire this in an afternoon. Worth trying before hiring anyone.
  • If your Salesforce org is administered by a team you cannot get time with, scope their availability before starting — this build is usually blocked on admin access rather than on the work.

Gravity Forms → Salesforce · what we deliver

What gets built — Gravity Forms → Salesforce

  • Identifier capture into Gravity Forms

    Hidden field with 'allow field to be populated dynamically' enabled and a parameter name set, plus a cookie fallback via a gform filter so the identifier survives a visitor who browsed several pages before converting.

  • Event source: the gform_after_submission hook

    Fire server-side from the PHP hook. This runs regardless of caching, AJAX submission, or what the confirmation page does.

  • Dispatch to Salesforce

    API writes to the Lead or Contact record, or a platform event, carrying the marketing context as custom field values.

  • Reversals where they exist

    Nothing to reverse, though entries marked spam should be excluded from the send.

Written guarantee

95%+ tracking accuracy

Measured against The Gravity Forms entries list for the same window, or the wp_gf_entry table directly.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Gravity Forms → Salesforce questions, answered

Capture gclid in a hidden field, map it to a custom field on the Lead, and map that field through lead conversion to the Contact and Opportunity.

Free · 30 min

Get Gravity Forms and Salesforce joined properly

Free30 minutesNo obligation