Connecting Magento to Salesforce
Magento is self-hosted and endlessly customisable, which means every installation is different and full-page caching is always in the way. 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 Magento 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
Magento to Salesforce: useful for B2B accounts, not every order
Sync Magento orders to Salesforce only when sales owns accounts, such as B2B or large-order follow-up. Use a custom Order object or Salesforce Order, not Opportunity, with increment_id as an external ID, on the Account and linked Contact matched by email, carrying the click source. Check that synced fields actually landed, and have credit memos update the same record.
Pushing every Magento order into Salesforce mostly creates records nobody opens. The pair makes sense when a sales team owns accounts: B2B buyers with company accounts, quote requests, net terms, or a consumer store where large orders trigger a rep follow-up. Then the order belongs on the Account, linked to the Contact, with the original click source carried along so sales can see which campaigns brought in accounts worth calling.
Decide the object first. Magento orders are not Salesforce opportunities; teams that force them into Opportunity get a pipeline full of closed-won deals nobody worked. A custom Order object, or Salesforce's own Order where enabled, is usually right, with the increment_id as an external ID so re-syncs update instead of duplicating. Match the Magento customer to an existing Contact by email before creating anything, since Magento allows multiple accounts per person and Salesforce dedup rules vary by org.
If a connector is already in place, open one synced record and check that the click identifier and source fields actually landed; validation rules reject fields silently. Magento credit memos should update the same record, not create a second one.
Magento → Salesforce · what breaks
Why this join usually fails — Magento → Salesforce
- 01
The Lead or Contact identity never reaches Magento
Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one.
- 02
Full-page cache between the visitor and your code
The page the customer saw is not the page your code assumed. This is the defining Magento tracking failure and it produces intermittent, hard-to-reproduce loss.
- 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.
- 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.
Magento → Salesforce · the fix
What working looks like — Magento → 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
Magento → Salesforce · architecture
How Magento and Salesforce actually connect
- 1
Magento holds the truth
You own the database, so the truth is as good as the query. Pin down which order statuses count as revenue — processing, complete, or both — because that choice moves the number substantially.
- 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
The identifier is the bridge
The Lead or Contact identity, captured at the visit and carried into the Magento order.
- 4
The event source decides reliability
Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
- 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.
Magento → Salesforce · normal or broken
Working vs. broken, side by side — Magento → Salesforce
Normal, not a fault
The Lead or Contact identity present on the order
Sent from the Magento order placement observer
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
Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one.
Sent from the browser
The page the customer saw is not the page your code assumed. This is the defining Magento tracking failure and it produces intermittent, hard-to-reproduce loss.
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
Magento → Salesforce · diagnose
Diagnostic order — Magento → Salesforce
- 01
Count orders carrying the Lead or Contact identity
- 02
Follow one real conversion end to end
- 03
Place a test order as an anonymous visitor through cache
Not as an admin, which bypasses it. If the order data is missing on the cached path, caching is your cause.
- 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.
- 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.
Magento → Salesforce · prove
How it gets proven — Magento → Salesforce
Source of truth
Magento's sales order records in your own database, for the same window and order 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 data confirmed populated on an order placed through a fully warmed cache.
Magento → 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
- Place a test order as an anonymous visitor through cache
- Write a test value and open the record in the UI
- Read the match rate, not the success message
Checked against
Magento's sales order records in your own database, for the same window and order status set.
Free30 minutesNo obligation
Magento → Salesforce · when not to buy
When you don't need this — Magento → Salesforce
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Lead or Contact identity.
- If your Magento build has heavy customisation by another team, scope their availability first — the build is usually blocked there.
- 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.
Magento → Salesforce · what we deliver
What gets built — Magento → Salesforce
Identifier capture into Magento
Capture the identifier and persist it as order data through an observer on order placement, server-side, so it never depends on what the cache served.
Event source: the Magento order placement observer
Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
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
Credit memos are recorded against the original order and should reduce the reported figure.
Written guarantee
95%+ tracking accuracy
Measured against Magento's sales order records in your own database, for the same window and order status set.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Magento → Salesforce questions, answered
Usually not. Use an order object linked to the Account and Contact, and keep opportunities for deals sales actually works.
Match on email before creating, and store the Magento customer ID as an external ID on the Contact. Check your org's duplicate rules first.
Almost always because the Lead or Contact identity never reached the Magento order. Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one. Measure coverage before debugging the dispatch.
Salesforce resolves on its own record identity — a Lead, a Contact, or an Account — rather than on a click identifier. What you are doing here is attaching marketing context to a record so the pipeline carries it, which means the click identifier arrives as a custom field value rather than as a matching key. The hazard is duplicates: two Leads for one person means two records with half the history each.
The Magento order placement observer. Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
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.
More on Magento → Salesforce
- Magento → Marketing CloudConnecting Magento to Salesforce Marketing Cloud
- Salesforce → Google AdsConnecting Salesforce to Google Ads
- Salesforce → MetaConnecting Salesforce to Meta Conversions API
RELATED GUIDES
Where Magento → Salesforce fits in the rest of your tracking
- nopCommerce → SalesforceConnecting nopCommerce to Salesforce
- Saleor → SalesforceConnecting Saleor to Salesforce
- Braintree → SalesforceConnecting Braintree to Salesforce
- Magento → MarketoConnecting Magento to Marketo
- Magento → HubSpotConnecting Magento to HubSpot
- Furniture ecommerceConversion tracking for furniture ecommerce, measured after delivery
- EDD → SalesforceConnecting Easy Digital Downloads to Salesforce
- Checkout Extensibility → SalesforceConnecting Shopify Checkout Extensibility to Salesforce
Free · 30 min
Get Magento and Salesforce joined properly
Free30 minutesNo obligation
