Connecting HubSpot to Matomo
HubSpot knows which leads turned into money, weeks after the ad platforms have stopped paying attention. 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 HubSpot contact and deal 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
HubSpot Closed Won deals as Matomo goals on the original visitor
Copy the Matomo visitor ID from the _pk_id cookie into a hidden HubSpot field and contact property, with utm_campaign and landing referrer. On Closed Won, post a goal conversion or ecommerce order to the HTTP Tracking API with deal amount as revenue, deal ID as order ID, and the stored campaign values so it is not credited to direct.
The Matomo visitor ID lives in the _pk_id cookie on your own domain, and a HubSpot form rendered in an iframe cannot read it. Copy it into a hidden field and a contact property at submission, alongside the Matomo user ID if visitors log in. A deal reaching Closed Won weeks later can then be posted to the HTTP Tracking API as a goal conversion or ecommerce order for that same visitor, with the deal amount as revenue and the HubSpot deal ID as the order ID, so a re-fired workflow does not record it twice.
Attribution is where this pair is unusual. A server-side request sent on the close date opens a fresh visit with no referrer, so Matomo credits the deal to direct traffic unless you also pass the original referrer and campaign values captured on the form, which Matomo uses to attribute goal conversions. Store utm_campaign and the landing referrer as contact properties next to the visitor ID. Back-dating the request to the click date instead needs an auth token and leaves already-archived reports stale until they are invalidated and reprocessed; confirm how your instance archives before choosing.
Self-hosted Matomo is a sensible home for this because deal amounts never leave your servers, which matters when the customer list is commercially sensitive. Send no personal data from the contact: the visitor ID, deal ID, amount and campaign are enough.
HubSpot → Matomo · what breaks
Why this join usually fails — HubSpot → Matomo
- 01
The first-party visitor ID never reaches HubSpot
The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again.
- 02
The deal closes long after the click
B2B sales cycles routinely run past the attribution window of every ad platform. Value uploaded on day 95 is value nobody will accept, so the timing question has to be answered before anything is built.
- 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.
- 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.
HubSpot → Matomo · the fix
What working looks like — HubSpot → Matomo
The first-party visitor ID on every deal
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
HubSpot → Matomo · architecture
How HubSpot and Matomo actually connect
- 1
HubSpot holds the truth
The deal carries the amount, the stage, the close date and the associated contact. That contact is where the original click identifier must live, because the deal is created much later by a salesperson who has no idea an ad was involved.
- 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
The identifier is the bridge
The first-party visitor ID, captured at the visit and carried into the HubSpot contact and deal.
- 4
The event source decides reliability
Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
- 5
Deduplication at the destination
Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.
HubSpot → Matomo · normal or broken
Working vs. broken, side by side — HubSpot → Matomo
Normal, not a fault
The first-party visitor ID present on the deal
Sent from a HubSpot workflow or webhook on deal stage 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
The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again.
Sent from the browser
B2B sales cycles routinely run past the attribution window of every ad platform. Value uploaded on day 95 is value nobody will accept, so the timing question has to be answered before anything is built.
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
HubSpot → Matomo · diagnose
Diagnostic order — HubSpot → Matomo
- 01
Count deals carrying the first-party visitor ID
- 02
Follow one real conversion end to end
- 03
Open a Closed Won deal and follow it back to its contact
Does that contact carry the identifier property, populated? Then check the date gap between the contact's creation and the deal's close — that gap decides whether this integration is possible at all.
- 04
Check tracker reachability and database lag before debugging any tag
On self-hosted analytics the answer is infrastructure more often than instrumentation.
- 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.
HubSpot → Matomo · prove
How it gets proven — HubSpot → Matomo
Source of truth
HubSpot's Deals report, filtered to Closed Won for the same window, by close date.
- The first-party visitor ID confirmed present on a live deal.
- Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
- The click-to-close time distribution measured, so you know what share of deals close inside the destination's window.
HubSpot → Matomo · free audit
What we check in the free audit
- Count deals carrying the first-party visitor ID
- Follow one real conversion end to end
- Open a Closed Won deal and follow it back to its contact
- Check tracker reachability and database lag before debugging any tag
- Read the match rate, not the success message
Checked against
HubSpot's Deals report, filtered to Closed Won for the same window, by close date.
Free30 minutesNo obligation
HubSpot → Matomo · when not to buy
When you don't need this — HubSpot → Matomo
- Measure identifier coverage yourself first — pull your last hundred deals and count how many carry the first-party visitor ID.
- If your median deal closes well past the destination's upload window, the honest answer is a different measurement strategy, not this integration. We will tell you that on the call rather than sell you a build that cannot 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.
HubSpot → Matomo · what we deliver
What gets built — HubSpot → Matomo
Identifier capture into HubSpot
Create a custom contact property, populate a hidden form field from the persisted first-party cookie, and confirm the property lands on the contact rather than only on the form submission.
Event source: a HubSpot workflow or webhook on deal stage change
Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
Dispatch to Matomo
The Matomo HTTP Tracking API, posted server-side from your order system.
Reversals where they exist
A deal reopened or moved out of Closed Won can be retracted where the destination supports it, though most teams accept the small error here rather than wire it.
Written guarantee
95%+ tracking accuracy
Measured against HubSpot's Deals report, filtered to Closed Won for the same window, by close date.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
HubSpot → Matomo questions, answered
Yes, if the Matomo visitor ID was saved on the HubSpot contact at form submit. Post the Closed Won deal through the Tracking API with that ID and the original campaign values, or it lands as direct traffic.
An embedded HubSpot form in an iframe cannot read your domain's Matomo cookie. Populate a hidden field from a script on the parent page before submit.
Almost always because the first-party visitor ID never reached the HubSpot contact and deal. The identifier has to be captured on the form and written to a contact property. HubSpot forms embedded in an iframe do not automatically see your page's cookies, so a hidden field has to be populated deliberately. Miss that and the contact is created clean, with nothing to join on ever again. Measure coverage before debugging the dispatch.
Matomo sets its own first-party cookie and, when self-hosted on your domain, is not a third-party request at all. That means ad blockers and browser tracking-prevention affect it far less than a hosted analytics tag — one of the few genuine measurement advantages available under current privacy conditions.
A HubSpot workflow or webhook on deal stage change. Trigger when the deal reaches Closed Won and send the deal amount with the identifier stored on the associated contact. Sending on form submission instead means you optimize toward form fills, which is exactly the behavior that fills a pipeline with unqualified leads.
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.
More on HubSpot → Matomo
- Stripe → HubSpotConnecting Stripe to HubSpot
- Shopify → HubSpotConnecting Shopify to HubSpot
- WooCommerce → HubSpotConnecting WooCommerce to HubSpot
Using HubSpot for bookings? How HubSpot bookings get tracked end to end
RELATED GUIDES
Where HubSpot → Matomo fits in the rest of your tracking
- Nutshell → MatomoConnecting Nutshell to Matomo
- Zoho → MatomoConnecting Zoho CRM to Matomo
- Freshsales → MatomoConnecting Freshsales to Matomo
- HubSpot → Adobe AnalyticsConnecting HubSpot to Adobe Analytics
- HubSpot → AmplitudeConnecting HubSpot to Amplitude
- Law firmsConversion tracking for law firms, without sending case details anywhere
- monday → MatomoConnecting monday CRM to Matomo
- Close → MatomoConnecting Close to Matomo
Free · 30 min
Get HubSpot and Matomo joined properly
Free30 minutesNo obligation
