Connect Shopify orders
Send every new Shopify order, cancellation and refund to Varly with webhooks, in a few minutes and without installing an app.
In this article
A webhook is a message Shopify sends automatically when something happens in your shop. Here, Shopify sends each new order to Varly. Shopify signs every message with a secret key, and Varly checks that signature, so nobody else can send fake orders to your account.
Step 1: Copy your Varly order address
- In Varly, open Install in the menu on the left.
- Make sure Shopify is picked under 1., then scroll to 5. Connect your orders.
- Click the copy button next to the address in step 2 of the list. It ends with your site's key, for example
…/api/orders/shopify/pk_….
Each site has its own address. If you run several Shopify stores, set up a webhook in each store with the address of the matching Varly site.
Step 2: Create the webhook in Shopify
- In your Shopify admin, go to Settings → Notifications → Webhooks.
- Click Create webhook.
- Choose the event Order creation.
- Choose the format JSON.
- Paste the Varly address you copied as the URL.
- Save the webhook.
- Repeat steps 2 to 6 twice, with the same address and format: once for the event Order cancellation and once for Refund create. With these two webhooks, canceled and refunded orders lower the revenue in Varly too.
All three webhooks use the same address and the same signing key.
Step 3: Paste the signing key in Varly
- Back in Shopify, look below the list of webhooks. Shopify shows a line that starts with "Your webhooks will be signed with …", followed by a long key.
- Copy that key.
- In Varly, paste it into Webhook signing key on Install → 5. Connect your orders.
- Click Connect Shopify.
Varly confirms with "Shopify connected. New orders appear within a minute." The key is stored encrypted. Afterward, the field shows which key is connected by its last characters.
How orders are linked to visits
Once Shopify is connected, the Varly snippet adds two hidden values to the visitor's cart: a visitor ID and a session ID. It does this once per visit, and only for visitors who accepted cookies. Shopify keeps these values with the order, so when the webhook arrives, Varly knows which visit led to the sale.
What your customers see: nothing. The values are hidden cart attributes (their names start with an underscore, which Shopify doesn't show to shoppers). Varly never touches your checkout and never tracks checkout pages.
What Varly counts
- Every new order Shopify sends, with its total, currency, number of items and order time. The currency is your shop's currency, as Shopify sends it with the order.
- Test orders (placed in Shopify's test mode) are skipped.
- Orders that are already canceled when they arrive are skipped.
- Canceled later: with the Order cancellation webhook, the order's revenue becomes 0.
- Refunded later: with the Refund create webhook, the refunded amount is taken off the order's revenue. Each refund counts once, even if Shopify sends it twice.
- A canceled or refunded order still counts as an order in conversion rates. Only its revenue changes.
- If the same order arrives twice, it counts once.
- Varly only receives orders placed after you connect. Earlier orders are not imported, and cancellations or refunds of those earlier orders change nothing.
Orders with the hidden visit values count everywhere: Click impact, A/B tests and the order filters in Heatmaps and Recordings. Orders without them count only in the order total. See Orders and revenue.
Replace or disconnect the key
- Replace: paste the new key into Webhook signing key and click Replace key. Do this when Shopify shows a different key below your webhooks than the one connected in Varly.
- Disconnect: click Disconnect. Varly stops accepting orders from this webhook. Also delete the webhook in Shopify, so it stops sending.
Common problems
Varly says "Paste the signing key exactly as Shopify shows it under Webhooks". You probably copied extra text or only part of the key. Copy only the key itself, without the sentence around it.
No orders show up after a test order. Orders placed in Shopify's test mode are skipped on purpose; use a real order instead. Also check that the webhook event is Order creation, the format is JSON, and the URL is exactly the one from Install → 5. Connect your orders. Also compare the key below your Shopify webhooks with the last characters shown under Webhook signing key; if they differ, paste the key again and click Replace key.
Revenue doesn't go down after a refund or cancellation. Check that the Order cancellation and Refund create webhooks exist in Shopify, with the same address and format as Order creation.
Orders arrive but aren't linked to visits. See Orders are not linked to visits.
My numbers differ from Shopify's reports. See Why Varly's revenue differs from Shopify or GA4.
Still stuck? Email support@varly.ai and we'll help you out.
Related articles
- Orders and revenue: why connect your shopConnect your orders so Varly can show revenue per click and pick winners in your A/B tests.
- Why are my orders not linked to visits?Orders arrive in Varly, but Click impact, tests or order filters show few or none. Here's what to check.
- Why Varly's revenue differs from Shopify or GA4The reasons Varly's orders and revenue don't match your shop or Google Analytics exactly, and which ones matter.
- Install Varly on ShopifyAdd the snippet to your Shopify theme in a few minutes, and check that it works.