Skip to main content
WooCommerce → SalesforceIntegration guide

Connecting WooCommerce to Salesforce

WooCommerce keeps the order in your own database, which is both the advantage and the reason nobody has wired it properly. 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 WooCommerce order 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

WooCommerce into Salesforce: orders onto accounts without duplicates

For a WooCommerce store with a B2B side, write a summary to the Salesforce Account or Contact: first and last order, lifetime total, and the first-touch click identifier and campaign from order meta, not an Opportunity per order. Match on billing email then company to avoid guest duplicates, and trigger from status changes.

Salesforce makes sense for a WooCommerce store with a B2B side, wholesale buyers, trade accounts or customers who reorder through a rep. The useful write is a summary on the Account or Contact: first order date, lifetime order total, last order, and the first-touch click identifier and campaign stored as order meta on the first order. Writing every consumer order as an Opportunity floods the org with records nobody works.

Guest checkout is where duplicates come from. A buyer orders as a guest, then as a logged-in customer with a different email, then a rep creates them manually. Match on billing email, then on company name for B2B, and check your org's matching rules before the first sync, since a WooCommerce plugin that creates a Contact per order will produce hundreds of duplicates in a week.

Check the WooCommerce extension directory for a maintained Salesforce connector and what it writes before building one. Whichever route you take, trigger from order status changes rather than checkout, so on-hold and failed orders stay out, and open a synced Contact in the Salesforce UI to confirm the fields actually hold values.

WooCommerce → Salesforce · what breaks

Why this join usually fails — WooCommerce → Salesforce

  1. 01

    The Lead or Contact identity never reaches WooCommerce

    WooCommerce sites are usually the most heavily plugged-in of any platform. Caching plugins serve a static page to the visitor, optimization plugins defer or strip scripts, and consent plugins block them entirely. Any of the three will stop an identifier being captured, and they fail silently.

  2. 02

    Caching and optimization plugins eat the tracking

    The page the customer sees is not the page your code assumed. This is the most common cause of WooCommerce tracking that worked at launch and silently stopped after a plugin update.

  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.

WooCommerce → Salesforce · the fix

What working looks like — WooCommerce → Salesforce

  • The Lead or Contact identity on every order

  • 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

WooCommerce → Salesforce · architecture

How WooCommerce and Salesforce actually connect

  1. 1

    WooCommerce holds the truth

    You own the database, so the truth is exactly as good as the query you write against it. Pin the status set first — whether processing, completed, or both count as a conversion changes the number by a lot and is the source of most arguments.

  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 WooCommerce order.

  4. 4

    The event source decides reliability

    Fire server-side from the PHP hook rather than from the thank-you page template. Page caching means the thank-you page cannot be relied on to execute anything, and on many stores it is served from cache to a paying customer.

  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.

WooCommerce → Salesforce · normal or broken

Working vs. broken, side by side — WooCommerce → Salesforce

Normal, not a fault

  • The Lead or Contact identity present on the order

  • Sent from the woocommerce_payment_complete 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

    WooCommerce sites are usually the most heavily plugged-in of any platform. Caching plugins serve a static page to the visitor, optimization plugins defer or strip scripts, and consent plugins block them entirely. Any of the three will stop an identifier being captured, and they fail silently.

  • Sent from the browser

    The page the customer sees is not the page your code assumed. This is the most common cause of WooCommerce tracking that worked at launch and silently stopped after a plugin update.

  • 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

WooCommerce → Salesforce · diagnose

Diagnostic order — WooCommerce → Salesforce

  1. 01

    Count orders carrying the Lead or Contact identity

  2. 02

    Follow one real conversion end to end

  3. 03

    Check order meta on ten recent orders

    Directly in the database or with a meta viewer. Then disable page caching for the checkout path and see whether coverage changes — if it does, 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.

WooCommerce → Salesforce · prove

How it gets proven — WooCommerce → Salesforce

Source of truth

WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.

  • The Lead or Contact identity confirmed present on a live order.
  • A test value confirmed present on the record in the UI, and confirmed to survive Lead conversion.
  • Order meta confirmed present on orders placed while full page caching was active.

WooCommerce → Salesforce · free audit

What we check in the free audit

  • Count orders carrying the Lead or Contact identity
  • Follow one real conversion end to end
  • Check order meta on ten recent orders
  • Write a test value and open the record in the UI
  • Read the match rate, not the success message

Checked against

WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.

Get my free conversion tracking audit

Free30 minutesNo obligation

WooCommerce → Salesforce · when not to buy

When you don't need this — WooCommerce → Salesforce

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Lead or Contact identity.
  • If you run a small store with no caching layer and a single free plugin already reporting accurately, leave it alone.
  • 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.

WooCommerce → Salesforce · what we deliver

What gets built — WooCommerce → Salesforce

  • Identifier capture into WooCommerce

    Capture the click identifier and persist it as order meta on the order object with a small snippet in the theme's functions or a purpose-built plugin. Order meta lives in your own database, so it survives caching, plugin conflicts and the customer's browser.

  • Event source: the woocommerce_payment_complete hook

    Fire server-side from the PHP hook rather than from the thank-you page template. Page caching means the thank-you page cannot be relied on to execute anything, and on many stores it is served from cache to a paying customer.

  • 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

    The refund hooks carry the order ID, so reversals are straightforward once the identifier is on the order.

Written guarantee

95%+ tracking accuracy

Measured against WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

WooCommerce → Salesforce questions, answered

Only for B2B or rep-managed orders. For consumer orders, summarize order history on the Contact or Account instead.

Free · 30 min

Get WooCommerce and Salesforce joined properly

Free30 minutesNo obligation