INSTALL / SHOPIFY

Varde on Shopify

Add Varde to your Shopify theme in two minutes, and count completed orders with a custom pixel.

1. Add the script to your theme

  1. In Shopify admin, go to Online Store → Themes.
  2. Next to your live theme, click ⋯ → Edit code and open layout/theme.liquid.
  3. Paste the script just before </head> and click Save.
<script defer data-site="YOUR_SITE_ID" src="https://vardeanalytics.com/js/script.js"></script>

This counts pageviews on your storefront: home, collections, products, cart and pages. If you switch themes later, add it to the new theme too.

2. Count orders (optional)

Shopify checkout and the thank-you page don't run theme code, so purchases need a custom pixel. Go to Settings → Customer events → Add custom pixel, name it Varde, paste the code below with your site ID, then click Save and Connect.

// Varde: count completed orders as a "purchase" goal const SITE = "YOUR_SITE_ID"; analytics.subscribe("checkout_completed", (event) => { const checkout = event.data.checkout; fetch("https://vardeanalytics.com/api/event", { method: "POST", keepalive: true, headers: { "Content-Type": "text/plain" }, body: JSON.stringify({ s: SITE, n: "purchase", u: event.context.document.location.href, r: event.context.document.referrer || null, w: event.context.window.innerWidth, p: { total: Number(checkout.totalPrice?.amount ?? 0), currency: checkout.currencyCode ?? "", }, }), }); });

Each completed order is sent as a purchase goal with the order total and currency. Add a goal named purchase in your dashboard to see which sources and pages lead to sales.

In the pixel's Customer privacy settings, Varde sets no cookies and stores no personal data, so you can choose Not required. Check this against your own privacy policy.

Use your store's domain

Register the domain customers actually visit, such as yourstore.com. If you don't use a custom domain, register yourstore.myshopify.com.

Check that it works

Open your site in a normal browser window. The add-site screen shows Connected once the first pageview arrives, and the dashboard fills in within a few minutes. If nothing shows up, see the checklist at the bottom of Install on your platform.

Other platforms