Analytics Tracker

Installation Guide

Four simple ways to connect your store. Pick the one that fits your setup. Each takes just a few minutes.

⏱About 5 minutes
✓No coding required
↺One-time setup

Which option is right for me?

You only need to complete one of the four options below. Choose whichever matches your setup. If you're on Shopify, we recommend Option 1. Once installed, tracking begins automatically and your dashboard updates on its own.

1

Shopify Theme ✓ RecommendedBest performance

  1. In your Shopify admin, go to Online Store → Themes.
  2. On your active theme, open Actions (•••) → Edit code.
  3. Open the file layout/theme.liquid.
  4. Find {{ content_for_header }} and paste this line immediately before it, then click Save.
HTML · theme.liquid
<script src="https://track-analytics.com/shopify.js"></script>
IMPORTANT Do not add async or defer attributes. The script must run before the header analytics for tracking to work correctly.
2

Shopify Customer EventsNo theme editing

Prefer not to touch theme files? Use Shopify's native custom pixel instead.

  1. In Shopify admin, open Settings → Customer events.
  2. Click Add custom pixel, name it Analytics Tracker, and select Add pixel.
  3. Paste the snippet below into the Code box.
  4. Click Save, then click Connect to activate.
JavaScript · Custom pixel
analytics.subscribe("page_viewed", (event) => {
  if (window.__trackAnalyticsLoaded) return;
  window.__trackAnalyticsLoaded = true;
  const pageUrl = event.context?.document?.location?.href ||
    event.context?.window?.location?.href || "";
  const referrer = event.context?.document?.referrer || "";
  const script = document.createElement("script");
  script.src = "https://track-analytics.com/shopify.js?url=" +
    encodeURIComponent(pageUrl) + "&ref=" + encodeURIComponent(referrer);
  document.head.appendChild(script);
});
3

Shopify via Google Tag ManagerFor stores already using GTM

  1. Open your GTM container and click Tags → New.
  2. Choose Custom HTML and paste the tag below.
  3. Set the trigger to Initialization – All Pages (or All Pages).
  4. Click Save, then Submit / Publish the container.
HTML · GTM Custom HTML tag
<script src="https://track-analytics.com/shopify.js"></script>
IMPORTANT Do not add async or defer attributes. The script must run before the header analytics for tracking to work correctly.
4

Non-Shopify Website via Google Tag ManagerWooCommerce, Magento, or any custom eCommerce platform

  1. In GTM, create a Custom HTML tag.
  2. Paste the tag below.
  3. Set the trigger to All Pages.
  4. Click Save, then Submit / Publish the container.
HTML · GTM Custom HTML tag
<script src="https://track-analytics.com/px.js"></script>
IMPORTANT Do not add async or defer attributes. The script must run before the header analytics for tracking to work correctly.

Confirm it's working

After installing, you don't need to do anything else. Here's how to confirm the tracker is live:

  • Visit your storefront in a normal browser window (not a preview).
  • In most cases tracking registers within a minute or two of your first visit.
  • Check your dashboard. Once the first visit is recorded, you're all set.
  • Using GTM? You can also use Preview mode in Tag Manager to see the tag fire before publishing.

Common questions

Do I need to install more than one option?

No. Pick the single option that matches your setup. Installing more than one isn't necessary and isn't recommended.

Will this slow down my website?

No. The script is lightweight and loads in the background without affecting your page speed or your customers' experience.

Do I need any coding knowledge?

No. Each option is copy-and-paste. If you'd rather we handle it, we're happy to complete the setup for you.

Is any customer data at risk?

No. The tracker only records standard analytics such as page visits and referral sources, the same information your platform already collects.

Copied to clipboard