Skip to main content
Craft → SnowflakeIntegration guide

Connecting Craft CMS to Snowflake

Craft is a developer-oriented CMS, usually built bespoke by an agency, which means the implementation is whatever that agency decided and nothing is standard. 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 Craft Commerce 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

Craft Commerce to Snowflake: why replicating Craft's tables hurts

Don't replicate Craft's tables, whose custom fields sit in JSON content storage that breaks on renamed handles. From the order-complete listener, write a flat record for Snowflake with order reference, UTC completion time, totals, currency, line items, discount codes, named custom fields and the raw payload. Deduplicate on order reference after loads.

The tempting route is replicating Craft's MySQL or Postgres database into Snowflake and querying orders there. Craft stores everything as elements: an order's core columns sit in Commerce's own tables, but the custom fields an agency added (click identifiers, channel flags, gift options) sit in Craft's content storage, which in Craft 5 is a JSON column per element and site. Queries over that are fragile, and a field handle renamed in the control panel breaks them silently.

Emit an order event instead. From the order-complete listener, write a flat record to a table or stream you load into Snowflake: order reference, completion time in UTC, totals, currency, line items, discount codes, and custom field values by name. Do the same for refunds and cancellations from their own events. Keep the raw payload alongside the flattened columns so a later schema change can be backfilled.

Timestamps are the classic divergence. Craft stores dates in UTC but displays them in the site's timezone, so a report built from control-panel exports and one built from Snowflake disagree at the day boundary. Keep UTC in the warehouse, convert at reporting, and deduplicate on order reference after each load, because retried loads land twice.

Craft → Snowflake · what breaks

Why this join usually fails — Craft → Snowflake

  1. 01

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

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  2. 02

    Every install is bespoke

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  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.

Craft → Snowflake · the fix

What working looks like — Craft → 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

    Craft CMS's own records are the reference, not either dashboard.

Craft → Snowflake · architecture

How Craft and Snowflake actually connect

  1. 1

    Craft CMS holds the truth

    Craft installs are bespoke by nature. Establish how this particular build models a completed order before assuming anything transfers from another Craft site.

  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 Craft Commerce order.

  4. 4

    The event source decides reliability

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  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.

Craft → Snowflake · normal or broken

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

Normal, not a fault

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

    Visible on the record itself in Craft CMS, not merely captured somewhere on the site.

  • Sent from the Craft Commerce order-complete event

  • 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

    Snowflake's count and Craft CMS's records agree within a few percent over a closed window.

Actually broken

  • Whatever join key both parties agree on, usually a hashed identifier missing on most records

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  • Sent from the browser

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  • 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

    The dashboard shows a number and no one has compared it to Craft CMS.

Craft → Snowflake · diagnose

Diagnostic order — Craft → 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

    Read how this specific build handles order completion

    Assumptions carried from another Craft project are the main source of wasted time here.

  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.

Craft → Snowflake · prove

How it gets proven — Craft → Snowflake

Against Craft CMS's own records, not against either platform's dashboard.

Source of truth

Craft Commerce's order records in your own database, filtered to completed.

  • 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.
  • Order custom field confirmed populated on an order placed as an anonymous visitor through cache.

Craft → 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
  • Read how this specific build handles order completion
  • Write down both parties' conversion definitions before writing any query
  • Read the match rate, not the success message

Checked against

Craft Commerce's order records in your own database, filtered to completed.

Get my free conversion tracking audit

Free30 minutesNo obligation

Craft → Snowflake · when not to buy

When you don't need this — Craft → Snowflake

  • If Snowflake already reports conversions that reconcile against Craft CMS's records within a few percent, this join is working and there is nothing to buy.
  • 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 the original agency is still engaged, the fastest path is usually specifying the field and having them add the hook.
  • 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.

Craft → Snowflake · what we deliver

What gets built — Craft → Snowflake

  • Identifier capture into Craft

    Capture the identifier and store it as a custom field on the order through a Craft event listener, server-side.

  • Event source: the Craft Commerce order-complete event

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  • 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 and cancelled orders are recorded against the order.

Written guarantee

95%+ tracking accuracy

Measured against Craft Commerce's order records in your own database, filtered to completed.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Craft → Snowflake questions, answered

For orders, usually not. Craft's element storage makes custom fields hard to query reliably; emit a flat order record from the order-complete event and load that.

Free · 30 min

Get Craft and Snowflake joined properly

Free30 minutesNo obligation