Skip to main content
Shopify sends orders, checkouts, refunds, and customers to Datalyr through a webhook we register for you.

Before you start

Finish Install on Shopify. It does three things this page depends on:
  • It connects the permanent myshopify.com domain.
  • It enables the App Embed, which loads dl.js on the storefront.
  • It installs the Web Pixel, which records checkout events.

Connect

1

Open the source

Open Sources, find Shopify, and select connect.
2

Enter the store domain

Paste the permanent myshopify.com domain. Omit the protocol and any path.
3

Approve the Shopify scopes

Complete the Shopify OAuth flow.
4

Enable the App Embed

In Shopify, open Online Store → Themes → Customize → App embeds. Turn on Datalyr. Save.
We register https://webhooks.datalyr.com/shopify and hold the signing secret, so you create no webhook in Shopify. The App Embed sets data-platform="shopify", which turns on cart-attribute stamping. dl.js then posts these attributes to /cart/update.js. They reach the order webhook as note_attributes.
Stamping stops when Shopify customer-privacy marketing consent is denied. Orders still arrive, but they carry no visitor ID, so no campaign earns credit.
We resolve the visitor for a paid order in this order, stopping at the first useful match. No match writes visitor_id as shopify_<customer_id> or shopify_<order_id>.

Event mapping

checkouts/update produces checkout_completed when completed_at is set. It produces checkout_abandoned when the checkout is over one hour old, has an email, and has no completed_at. Each checkout emits one terminal event, never both. orders/updated records nothing when the change is under 0.01, when the order has no stored baseline, or when the total went down. Any other topic returns 200 and records nothing.

Revenue

purchase events aren’t the money. Reports sum shopify_transaction rows only, so a mutable order snapshot can never double-book cash. Use purchase to count orders.
total_price is gross: it includes tax and shipping and excludes nothing. Currency is the shop currency, uppercased. The economics events keep both the shop and the presentment currency side by side. We apply no FX conversion at write time. A refund payload carries no top-level currency, so we read the currency from the refund transactions.

Test orders

We mark every event with event_data.is_test. Reports exclude rows where it is true.

Delivery behavior

The /shopify endpoint has no rate limit. It answers 200 as soon as the delivery is queued, then processes it. A processing failure retries on the queue and never changes the HTTP status.

Checkout Champ orders

If you run a Checkout Champ funnel in front of Shopify, you need no extra work. We classify the origin of every order before recording it. Origin is decided once per order and never changes. Suppression covers orders, refunds, and transactions. It does not cover checkouts or customers.

Every HTTP status

Verify

  1. Open the storefront in a private window with ?utm_source=doctest.
  2. Open Events. Confirm a pageview row exists.
  3. Add a product to the cart.
  4. Complete one order with Shopify’s Bogus Gateway.
  5. Open Events. Confirm a purchase row and a shopify_transaction row.
  6. Confirm the purchase row’s visitor_id does not start with shopify_.
  7. Refund the order in Shopify. Confirm an order_refunded row arrives.

When it does not work

Next, create a conversion rule so these orders reach your ad platforms.