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
- In Shopify admin open Settings → Customer events and create a custom pixel.
- Paste the PureMetrix Shopify pixel from the product adapter (
adapters/shopify/pixel.jsin the PureMetrix repo or package). - Connect the pixel and publish it for the storefront.
The pixel subscribes to Shopify analytics events and forwards:
page_viewed→pageviewproduct_added_to_cart→Add to cartcheckout_started→Begin checkoutcheckout_completed→Purchasewithrevenue.amountandrevenue.currencyfrom 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
- In a private window, open a collection → product → cart. DevTools → Network should show the script and the event requests.
- Dashboard pageviews update within about a minute.
- 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.