Before you start
Finish Install on Shopify. It does three things this page depends on:- It connects the permanent
myshopify.comdomain. - It enables the App Embed, which loads
dl.json 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.
https://webhooks.datalyr.com/shopify and hold the signing secret, so you create no webhook in Shopify.
Link orders to a storefront visitor
The App Embed setsdata-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.
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 withevent_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
- Open the storefront in a private window with
?utm_source=doctest. - Open Events. Confirm a
pageviewrow exists. - Add a product to the cart.
- Complete one order with Shopify’s Bogus Gateway.
- Open Events. Confirm a
purchaserow and ashopify_transactionrow. - Confirm the
purchaserow’svisitor_iddoes not start withshopify_. - Refund the order in Shopify. Confirm an
order_refundedrow arrives.
When it does not work
Next, create a conversion rule so these orders reach your ad platforms.