Docs menu

Shopify

Attribute every Shopify payment to the visit that brought it.

Updated 21 Oct 2026

Connect

  1. In Shopify admin, open Settings → Notifications → Webhooks → Create webhook, with the event Order payment and format JSON. Below the list, Shopify shows the key your webhooks are signed with. That's the secret.
  2. In atrby, open Revenue → Payment processors → Connect, choose Shopify and paste the secret.
  3. atrby shows your webhook URL. It looks like https://app.atrby.site/api/webhooks/shopify/…. Add it in Shopify and send these events: orders/paid.

The connection shows as active once the first webhook arrives. Webhooks with a wrong signature are rejected.

Pass the visit ids

Where they go: Cart attributes, which Shopify copies to the order as note_attributes. Read them in the browser with atrby.ids() and send them to your server with the checkout request.

Browser
const ids = window.atrby?.ids(); // { atrby_sid, atrby_site }
Theme · layout/theme.liquid, before </body>
<script>
  window.addEventListener("load", () => {
    const ids = window.atrby?.ids();
    if (ids) fetch("/cart/update.js", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ attributes: ids }),
    });
  });
</script>

atrby_uid is your user id, from identify. It's optional, but it credits payments made long after the first visit.

What gets recorded

  • Each payment once, however often Shopify retries the webhook.
  • Refunds aren't read from Shopify yet, so revenue is gross of refunds.
  • The amount is the order's total_price in the shop currency.
Was this helpful?
Ask a question about this page