Skip to main content
Medusa → SnowflakeIntegration guide

Connecting Medusa to Snowflake

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. Snowflake's distinguishing feature is that two organisations can join data without either copying it to the other, which turns measurement between partners from a legal negotiation into a query. The join between them succeeds or fails on one thing: whether whatever join key both parties agree on, usually a hashed identifier reaches the Medusa order before the conversion happens, because Snowflake can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Medusa to Snowflake: replicate Postgres, not just events

Replicate Medusa's orders, payments, refunds and carts from Postgres into Snowflake with change data capture. In v2 some totals are calculated, not stored, so have a subscriber write captured amount and currency if needed. Land metadata click IDs in a VARIANT column, dedupe on order ID, and use Snowflake only for sharing or joins.

Medusa already writes every order to Postgres, so the cleanest Snowflake pipeline replicates tables rather than inventing events. A change-data-capture connector from Postgres keeps orders, payments, refunds and carts current, with the raw rows intact. Add a subscriber-written event table only for things that are not stored, such as the moment of payment capture if you want it timestamped independently.

The Medusa-specific catch: in v2 several order totals are calculated by the application rather than stored as one column, so a raw table copy may not contain the paid total you expect. Check which totals your version persists before building revenue models, and if necessary have a subscriber write the captured amount and currency to its own table. Click identifiers live in cart and order metadata as JSON; land them in a VARIANT column and flatten in Snowflake rather than parsing in the pipeline.

Snowflake is justified when you need to share or join with someone: a retailer, an agency, an ad platform's clean room, or ad spend from several accounts. If none of those apply, querying the Medusa database replica you already have answers the same questions. Either way, dedupe on order ID after every load, since connectors retry and the warehouse will not refuse a duplicate.

Medusa → Snowflake · what breaks

Why this join usually fails — Medusa → Snowflake

  1. 01

    Whatever join key both parties agree on, usually a hashed identifier never reaches Medusa

    The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.

  2. 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.

  3. 03

    A clean room that answers a question nobody agreed on

    The technology makes the join possible; it does not make the definitions match. Two organisations measuring the same campaign will disagree about what a conversion is, which window applies and whose attribution model governs — and the query will return a confident number for whichever set of assumptions got written into the SQL.

  4. 04

    Nothing reconciles afterwards

    Snowflake will not tell you anything is wrong. Verify by querying against each party's own totals and checking for duplicate rows on the join key before trusting any aggregate.

Medusa → Snowflake · the fix

What working looks like — Medusa → Snowflake

  • Whatever join key both parties agree on, usually a hashed identifier on every order

  • Conversions arriving in Snowflake

    The row lands in a table you own, joinable to your own data and — through a share or clean room — to a partner's, without either party moving raw records.

  • Reconciled against the source

Medusa → Snowflake · architecture

How Medusa and Snowflake actually connect

  1. 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. 2

    Snowflake needs a click to match

    A schema both sides agree on, consistent types, and identifiers normalised identically before hashing. The failure mode is not rejection but silent divergence — a timestamp in the wrong zone or a trimmed-versus-untrimmed email produces answers that look plausible.

  3. 3

    The identifier is the bridge

    Whatever join key both parties agree on, usually a hashed identifier, captured at the visit and carried into the Medusa order.

  4. 4

    The event source decides reliability

    Send orders at payment capture, at the paid total.

  5. 5

    Deduplication at the destination

    Nothing deduplicates for you. Loads are at-least-once, so a retried pipeline creates duplicate rows and the only protection is a deduplication step you write and actually schedule.

Medusa → Snowflake · normal or broken

Working vs. broken, side by side — Medusa → Snowflake

Normal, not a fault

  • Whatever join key both parties agree on, usually a hashed identifier present on the order

  • Sent from a Medusa subscriber on order payment capture

  • Deduplicated correctly

    Nothing deduplicates for you. Loads are at-least-once, so a retried pipeline creates duplicate rows and the only protection is a deduplication step you write and actually schedule.

  • Reconciles with the source

Actually broken

  • Whatever join key both parties agree on, usually a hashed identifier 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

    The technology makes the join possible; it does not make the definitions match. Two organisations measuring the same campaign will disagree about what a conversion is, which window applies and whose attribution model governs — and the query will return a confident number for whichever set of assumptions got written into the SQL.

  • Nobody has reconciled it

Medusa → Snowflake · diagnose

Diagnostic order — Medusa → Snowflake

  1. 01

    Count orders carrying whatever join key both parties agree on, usually a hashed identifier

  2. 02

    Follow one real conversion end to end

  3. 03

    Check which event your subscriber listens to

    One line of code, and it decides whether you are counting orders or counting money.

  4. 04

    Write down both parties' conversion definitions before writing any query

    Definition mismatch, not technology, is what makes most partner measurement projects produce numbers neither side trusts.

  5. 05

    Read the match rate, not the success message

    Snowflake will not tell you anything is wrong. Verify by querying against each party's own totals and checking for duplicate rows on the join key before trusting any aggregate.

Medusa → Snowflake · prove

How it gets proven — Medusa → Snowflake

Source of truth

Medusa orders by payment status, emitted from your own subscriber code.

  • Whatever join key both parties agree on, usually a hashed identifier confirmed present on a live order.
  • Row counts and revenue reconciled against each source system for a closed window, with duplicates checked on the join key and both definitions documented.
  • Payment-captured orders reconciled against imported conversions.

Medusa → Snowflake · free audit

What we check in the free audit

  • Count orders carrying whatever join key both parties agree on, usually a hashed identifier
  • Follow one real conversion end to end
  • Check which event your subscriber listens to
  • Write down both parties' conversion definitions before writing any query
  • Read the match rate, not the success message

Checked against

Medusa orders by payment status, emitted from your own subscriber code.

Get my free conversion tracking audit

Free30 minutesNo obligation

Medusa → Snowflake · when not to buy

When you don't need this — Medusa → Snowflake

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry whatever join key both parties agree on, usually a hashed identifier.
  • If every payment method you accept is instant, the two events nearly coincide and the distinction costs more than it returns.
  • If you have no partner to share data with and one cloud, a warehouse you already run does the same job. The sharing capability is what justifies this one.

Medusa → Snowflake · what we deliver

What gets built — Medusa → Snowflake

  • 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 Snowflake

    Batch or streaming loads from your order system, with the raw event retained alongside anything you derive from it.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Medusa → Snowflake questions, answered

Replicate Medusa's Postgres tables with a change-data-capture connector, then model orders and payments in Snowflake. Add an event table only for facts Medusa does not persist.

Free · 30 min

Get Medusa and Snowflake joined properly

Free30 minutesNo obligation