Skip to content

Shopify integration

Install PureMetrix on a Shopify storefront: load the cookieless script, then wire the custom pixel so pageviews and checkout events reach your dashboard.

Prerequisites

  • A PureMetrix site with the store hostname and a public key from app.puremetrix.org.
  • Access to Shopify admin → Customer events (custom pixels) and theme or app embed settings.

1. Load the PureMetrix script

The custom pixel calls window.puremetrix(). So the storefront must load the PureMetrix tracking script first (snippet or theme app extension) with your domain and public key. If you use a proxy, point to the paths on your own domain instead (see related guides).

<script defer data-domain="your-shop.myshopify.com" data-key="YOUR_PUBLIC_KEY"
  data-api="https://collect.puremetrix.org/api/event"
  src="https://collect.puremetrix.org/js/script.js"></script>

Use your production custom domain in data-domain when that is the PureMetrix site hostname.

2. Add the custom pixel

  1. In Shopify admin open Settings → Customer events and create a custom pixel.
  2. Paste the PureMetrix Shopify pixel from the product adapter (adapters/shopify/pixel.js in the PureMetrix repo or package).
  3. Connect the pixel and publish it for the storefront.

The pixel subscribes to Shopify analytics events and forwards:

  • page_viewed → pageview
  • product_added_to_cart → Add to cart
  • checkout_started → Begin checkout
  • checkout_completed → Purchase with revenue.amount and revenue.currency from checkout totals

3. Goals in PureMetrix

Create custom event goals for Add to cart, Begin checkout, and Purchase (and enable ecommerce / revenue widgets when your plan includes them). See ecommerce revenue tracking.

Verify

  1. In a private window, open a collection → product → cart. DevTools → Network should show the script and the event requests.
  2. Dashboard pageviews update within about a minute.
  3. Complete a test order in a development store; confirm a Purchase event and revenue when the thank-you flow fires checkout_completed.

Privacy

PureMetrix does not set visitor cookies. Other Shopify apps may — if so, set up your consent tool (CMP) for them. PureMetrix visitor stats are hosted in the EU on Hetzner.

Related