Connecting Medusa to HubSpot
Medusa is a Node commerce engine you extend in your own codebase, which makes the conversion event a piece of application code — and therefore something that can be tested rather than hoped for. HubSpot is where sales works, so a conversion that never reaches it is invisible to the people who decide what a lead was worth. The join between them succeeds or fails on one thing: whether the contact identity — email, or the hubspotutk cookie reaches the Medusa order before the conversion happens, because HubSpot can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Medusa orders into HubSpot: a subscriber you can test
On payment capture, a Medusa subscriber upserts the HubSpot contact by order email and creates or updates the commerce Order or an ecommerce-pipeline deal. Write the hubspotutk cookie into cart metadata at first touch so original source survives. Map refunds to amount or status updates, and associate B2B orders with the company.
HubSpot makes sense for Medusa builds that sell B2B or high-ticket, where a sales or account team needs to see what a customer bought. There is no single official route; check for a community plugin that matches your Medusa version, but a small subscriber of your own is often simpler: on payment capture, upsert the contact by the order's email, then create or update the record that holds the revenue. If your HubSpot portal has the commerce Orders object, use it; otherwise use a deal in an ecommerce pipeline. Because the subscriber is your code, you can write a test that feeds it a fixture order and asserts what HubSpot receives.
Original source needs one storefront change. The hubspotutk cookie should be written into cart metadata at first touch, the same way click identifiers are, so the subscriber can send it with the contact update and HubSpot can stitch the shopper's earlier visits. Without it, every buyer whose first identified moment was checkout shows as Offline Sources.
Map Medusa's refund event to an amount update or a status property on the HubSpot record, not a deleted deal, so sales still sees the history. For B2B customers who order repeatedly, associate each order with the company as well as the contact; account managers think in companies.
Medusa → HubSpot · what breaks
Why this join usually fails — Medusa → HubSpot
- 01
The contact identity — email, or the hubspotutk cookie never reaches Medusa
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
- 02
Firing on order placed rather than payment captured
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
- 03
Duplicate contacts
Two records for one person, each with half the history. Every downstream report is then wrong in a way that looks like a data problem rather than an integration problem.
- 04
Nothing reconciles afterwards
HubSpot shows the contact record and its timeline. A successful API response means HubSpot accepted the call, not that it resolved to the right contact — open the record and look.
Medusa → HubSpot · the fix
What working looks like — Medusa → HubSpot
The contact identity — email, or the hubspotutk cookie on every order
Conversions arriving in HubSpot
The revenue or conversion lands on the contact record and its associated deal, where sales can see it and where HubSpot's own attribution reporting can use it.
Reconciled against the source
Medusa → HubSpot · architecture
How Medusa and HubSpot actually connect
- 1
Medusa holds the truth
Because you own the event handlers, the conversion can fire from the payment-captured event specifically rather than from whatever the frontend happened to render.
- 2
HubSpot needs a click to match
HubSpot needs to resolve the incoming data to an existing contact or create one. Without an email or a hubspotutk it creates duplicates, and duplicate contacts break every report built on top of them.
- 3
The identifier is the bridge
The contact identity — email, or the hubspotutk cookie, captured at the visit and carried into the Medusa order.
- 4
The event source decides reliability
Send orders at payment capture, at the paid total.
- 5
Deduplication at the destination
HubSpot deduplicates contacts on email address. Events and property updates against the same contact are idempotent by design, but a second contact created for the same person is not detected, and merging them afterwards is manual work.
Medusa → HubSpot · normal or broken
Working vs. broken, side by side — Medusa → HubSpot
Normal, not a fault
The contact identity — email, or the hubspotutk cookie present on the order
Sent from a Medusa subscriber on order payment capture
Deduplicated correctly
HubSpot deduplicates contacts on email address. Events and property updates against the same contact are idempotent by design, but a second contact created for the same person is not detected, and merging them afterwards is manual work.
Reconciles with the source
Actually broken
The contact identity — email, or the hubspotutk cookie missing on most records
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
Sent from the browser
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
Counted twice, or not at all
Two records for one person, each with half the history. Every downstream report is then wrong in a way that looks like a data problem rather than an integration problem.
Nobody has reconciled it
Medusa → HubSpot · diagnose
Diagnostic order — Medusa → HubSpot
- 01
Count orders carrying the contact identity — email, or the hubspotutk cookie
- 02
Follow one real conversion end to end
- 03
Check which event your subscriber listens to
One line of code, and it decides whether you are counting orders or counting money.
- 04
Search for the test contact by email after sending
One record or two? Then check whether the properties landed on the contact or only on the form submission — they are different things and only the first is usable.
- 05
Read the match rate, not the success message
HubSpot shows the contact record and its timeline. A successful API response means HubSpot accepted the call, not that it resolved to the right contact — open the record and look.
Medusa → HubSpot · prove
How it gets proven — Medusa → HubSpot
Source of truth
Medusa orders by payment status, emitted from your own subscriber code.
- The contact identity — email, or the hubspotutk cookie confirmed present on a live order.
- One contact record confirmed, not two, with the property visible on the contact rather than only on the submission.
- Payment-captured orders reconciled against imported conversions.
Medusa → HubSpot · free audit
What we check in the free audit
- Count orders carrying the contact identity — email, or the hubspotutk cookie
- Follow one real conversion end to end
- Check which event your subscriber listens to
- Search for the test contact by email after sending
- Read the match rate, not the success message
Checked against
Medusa orders by payment status, emitted from your own subscriber code.
Free30 minutesNo obligation
Medusa → HubSpot · when not to buy
When you don't need this — Medusa → HubSpot
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the contact identity — email, or the hubspotutk cookie.
- If every payment method you accept is instant, the two events nearly coincide and the distinction costs more than it returns.
- HubSpot's native form and tracking code already handle the straightforward cases well. This is worth building when the conversion happens somewhere HubSpot's code cannot see.
Medusa → HubSpot · what we deliver
What gets built — Medusa → HubSpot
Identifier capture into Medusa
Write the identifier into cart metadata at first touch so it is carried onto the order automatically at completion.
Event source: a Medusa subscriber on order payment capture
Send orders at payment capture, at the paid total.
Dispatch to HubSpot
The HubSpot API — contact create-or-update with the properties, or a custom behavioral event where you need the timeline entry rather than a property.
Reversals where they exist
Refunds emit their own event and should reverse.
Written guarantee
95%+ tracking accuracy
Measured against Medusa orders by payment status, emitted from your own subscriber code.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Medusa → HubSpot questions, answered
Check the Medusa community for a plugin built for your exact version. A short subscriber that calls HubSpot's API on payment capture is often easier to maintain and test.
Capture the hubspotutk cookie into cart metadata at first touch and send it with the contact update, so HubSpot can link earlier page views.
Almost always because the contact identity — email, or the hubspotutk cookie never reached the Medusa order. The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created. Measure coverage before debugging the dispatch.
HubSpot resolves to a contact by email address, or by the hubspotutk cookie value which ties an anonymous visitor to their eventual contact record. Sending the hubspotutk with a form submission is what lets HubSpot stitch the pre-conversion page views to the contact, which is where the original source attribution comes from.
A Medusa subscriber on order payment capture. Send orders at payment capture, at the paid total.
HubSpot shows the contact record and its timeline. A successful API response means HubSpot accepted the call, not that it resolved to the right contact — open the record and look.
More on Medusa → HubSpot
- Stripe → HubSpotConnecting Stripe to HubSpot
- Shopify → HubSpotConnecting Shopify to HubSpot
- WooCommerce → HubSpotConnecting WooCommerce to HubSpot
RELATED GUIDES
Where Medusa → HubSpot fits in the rest of your tracking
- Shopify → HubSpotConnecting Shopify to HubSpot
- Checkout Extensibility → HubSpotConnecting Shopify Checkout Extensibility to HubSpot
- Magento → HubSpotConnecting Magento to HubSpot
- Medusa → SalesforceConnecting Medusa to Salesforce
- Medusa → 6senseConnecting Medusa to 6sense
- Furniture ecommerceConversion tracking for furniture ecommerce, measured after delivery
- WooCommerce → HubSpotConnecting WooCommerce to HubSpot
- Saleor → HubSpotConnecting Saleor to HubSpot
Free · 30 min
Get Medusa and HubSpot joined properly
Free30 minutesNo obligation
