Docs · Shopify

Evarist on your Shopify store.

Everything Shopify on one page. The first half is for you; the headless half is for your developer — send it over.

Getting started Tracking & consent Shopify
01 / The app

The app, and how to install it.

The native Evarist app is live on the Shopify App Store — install it from apps.shopify.com/evarist, then open it in your admin and click Connect this store to Evarist. No code, and Shopify already knows your store, so there's no domain to type.

The app turns on tracking through a theme app embed and a web pixel. If you already track this site with the snippet or a tag manager, remove it once the app is connected — the app replaces it. Orders are deduplicated by order ID across every source, so your revenue stays correct either way; but while both are running, page events and any goals you set up on the old tracking can be counted twice, so don't leave them side by side longer than the switchover.

03 / Headless

Headless storefronts.

Running Shopify behind a custom frontend instead of the Online Store — Hydrogen, or your own React/Next.js site? A theme toggle can't reach those pages, so set up tracking manually with the two steps below. This works today, independent of the app.

Install the snippet on every page

Paste the tracking snippet into your storefront's root layout or template — every page, not just one.

If Shopify creates your orders

The common case, even with a custom frontend. Whenever you build or update the cart, set a Shopify cart custom attribute named _evarist to the value of the visitor's _evarist cookie, via the Storefront API's cartAttributesUpdate mutation:

mutation cartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {
  cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
    cart { id }
    userErrors { field message }
  }
}

# variables
{
  "cartId": "YOUR_CART_ID",
  "attributes": [{ "key": "_evarist", "value": "VALUE_OF_THE_EVARIST_COOKIE" }]
}

It rides through to the order, so Evarist attributes the purchase to the right visitor — no matter where checkout renders. This only carries the anonymous visitor id, never anything about the customer.

One timing note: the tracker loads asynchronously, so on a brand-new visit the _evarist cookie may not exist yet when you first create the cart. Read the cookie fresh at every cart mutation rather than caching it at page load — and have the handler that sends the shopper to checkout set the attribute one last time, so a cart created before the tracker finished loading still picks it up. The value present at checkout is the one that rides through; a cart that never got it simply shows as an unattributed order, nothing breaks.

04 / Your checkout

Checkout on your own system.

If checkout isn't Shopify at all, install the snippet and tag your order-confirmation page as a goal — the same no-code flow as any other outcome: Track what matters.

If the amount varies per order, fire it from code with one JS call.