Skip to main content
Salesforce → MatomoIntegration guide

Connecting Salesforce to Matomo

Salesforce holds the opportunity, the amount and the close — the only place the actual revenue outcome is recorded. Matomo can be self-hosted with no third party in the chain, which makes it the one analytics destination where the data genuinely never leaves infrastructure you control. The join between them succeeds or fails on one thing: whether the first-party visitor ID reaches the Salesforce Lead or Opportunity before the conversion happens, because Matomo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Backdating Salesforce revenue into Matomo ecommerce reports

Put Matomo's visitor ID from its first-party cookie into a hidden Web-to-Lead field carried through conversion to the Opportunity. On Closed Won, post an ecommerce order through the HTTP Tracking API with that visitor ID, amount, the Opportunity ID as order ID and the stored campaign and referrer. Invalidate archives for backdated hits, and allow Salesforce's callout through.

Matomo records the visit; the opportunity closes weeks later. The join is the Matomo visitor ID read from its first-party cookie and placed in a hidden field on the Web-to-Lead form, carried through conversion to the Opportunity. On Closed Won, post an ecommerce order or goal conversion through the HTTP Tracking API with that visitor ID, the amount, and the Opportunity ID as the order ID.

A server-side hit carries no referrer, so on its own the deal is credited to direct traffic. The Tracking API lets you pass the original campaign name, keyword and referrer with the conversion; capture those on the Lead alongside the visitor ID when the form is submitted. Matomo also archives reports for past days, so a conversion posted for an earlier date only shows in those reports after archives for the affected dates are invalidated and rebuilt, and backdated hits need an authenticated token.

If you self-host Matomo, the call comes from Salesforce's servers, not your office network. A tracker endpoint behind a VPN or an IP allow-list will refuse the flow's callout, and the failure surfaces only as a flow error email to an admin. Allow the callout through a named credential and test it from the production org, not just a sandbox.

Salesforce → Matomo · what breaks

Why this join usually fails — Salesforce → Matomo

  1. 01

    The first-party visitor ID never reaches Salesforce

    Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.

  2. 02

    The identifier is lost at lead conversion

    This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.

  3. 03

    Owning the pipeline means owning the outage

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  4. 04

    Nothing reconciles afterwards

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Salesforce → Matomo · the fix

What working looks like — Salesforce → Matomo

  • The first-party visitor ID on every opportunity

  • Conversions arriving in Matomo

    The event lands in your own database and is queryable directly, including the raw log, which most analytics products do not expose.

  • Reconciled against the source

Salesforce → Matomo · architecture

How Salesforce and Matomo actually connect

  1. 1

    Salesforce holds the truth

    The opportunity carries the amount, stage and close date. Because Leads convert into Contacts, Accounts and Opportunities, the identifier must be mapped through the conversion or it is dropped exactly at the moment the record becomes valuable.

  2. 2

    Matomo needs a click to match

    The site ID, the visitor identifier and the event or ecommerce order. Self-hosted instances additionally need the tracker endpoint reachable and the database keeping up, which hosted tools do not fail at.

  3. 3

    The identifier is the bridge

    The first-party visitor ID, captured at the visit and carried into the Salesforce Lead or Opportunity.

  4. 4

    The event source decides reliability

    Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.

  5. 5

    Deduplication at the destination

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

Salesforce → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the opportunity

  • Sent from a Salesforce flow, Apex trigger or scheduled export on StageName change

  • Deduplicated correctly

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

  • Reconciles with the source

Actually broken

  • The first-party visitor ID missing on most records

    Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.

  • Sent from the browser

    This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.

  • Counted twice, or not at all

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  • Nobody has reconciled it

Salesforce → Matomo · diagnose

Diagnostic order — Salesforce → Matomo

  1. 01

    Count opportunitys carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Convert a test Lead and inspect the resulting Opportunity

    If the identifier is not on the Opportunity, the field mapping is missing. This takes five minutes and rules out the most likely cause outright.

  4. 04

    Check tracker reachability and database lag before debugging any tag

    On self-hosted analytics the answer is infrastructure more often than instrumentation.

  5. 05

    Read the match rate, not the success message

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Salesforce → Matomo · prove

How it gets proven — Salesforce → Matomo

Source of truth

A Salesforce report of Closed Won opportunities for the same window, by close date.

  • The first-party visitor ID confirmed present on a live opportunity.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • A test lead converted end to end with the identifier confirmed present on the resulting opportunity.

Salesforce → Matomo · free audit

What we check in the free audit

  • Count opportunitys carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Convert a test Lead and inspect the resulting Opportunity
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

A Salesforce report of Closed Won opportunities for the same window, by close date.

Get my free conversion tracking audit

Free30 minutesNo obligation

Salesforce → Matomo · when not to buy

When you don't need this — Salesforce → Matomo

  • Measure identifier coverage yourself first — pull your last hundred opportunitys and count how many carry the first-party visitor ID.
  • If your Salesforce instance is heavily customized and administered by another team, scope their availability before commissioning this — the build is usually blocked on admin access rather than on the tracking work.
  • If you have no privacy or ownership requirement and no team to run it, a hosted product removes the only real cost of this one.

Salesforce → Matomo · what we deliver

What gets built — Salesforce → Matomo

  • Identifier capture into Salesforce

    Custom field on Lead, matching custom field on Contact and Opportunity, and the field mapping configured so conversion carries it across. Verify by converting a test lead and reading the resulting opportunity.

  • Event source: a Salesforce flow, Apex trigger or scheduled export on StageName change

    Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.

  • Dispatch to Matomo

    The Matomo HTTP Tracking API, posted server-side from your order system.

  • Reversals where they exist

    An opportunity moved back out of Closed Won can be retracted, and enterprise pipelines do this often enough to be worth wiring.

Written guarantee

95%+ tracking accuracy

Measured against A Salesforce report of Closed Won opportunities for the same window, by close date.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Salesforce → Matomo questions, answered

Store the Matomo visitor ID and the original campaign and referrer on the Lead, then send them with the conversion through the Tracking API. Without the campaign values the server-side hit counts as direct.

Free · 30 min

Get Salesforce and Matomo joined properly

Free30 minutesNo obligation