Login
ZappushZappush Docs
Get started

Install the tracker

Add the Zappush tracking script to your site so it can capture shopper events, and confirm it is live.

The tracker is a small script that captures what shoppers do on your store: page views, product views, cart actions, and checkouts. On Shopify it is installed for you automatically. On every other platform you add one snippet.

1. Copy your tracking script

  1. In the dashboard, go to Settings → Install.
  2. You will see your tracking script. It looks like this, with your own key in place of your-key:
<script>!function(w,z){z=w.zappush=w.zappush||{};z.q=z.q||[];z.track=z.track||function(e,d){z.q.push([e,d])}}(window)</script>
<script src="https://api.zappush.com/s/your-key.js" defer></script>
  1. Click Copy. Always copy the exact snippet from this screen rather than the example above, since the key is unique to your store.

The small inline block lets Zappush capture events fired before the tracker finishes loading. Paste both lines together.

2. Add it to your site's <head>

The script goes in the <head> of every page. Find your platform below.

Add the snippet as a page element, on every page. Do not use the funnel or website Tracking Code setting.

The Tracking Code field is not a shortcut here, it is a trap. Anything pasted into it sits idle for roughly twelve seconds after the page has finished loading. We measured this on live pages: the page was ready in about a fifth of a second, and the pasted code did not run for another eleven and a half. Every visitor who leaves before then is invisible, which on paid traffic is most of them. The same snippet added as a page element runs before the page finishes rendering.

  1. Open the funnel or website in the page builder and select the first step or page.
  2. Drag in an element and choose Custom HTML / Javascript (also listed as Custom JS/HTML).
  3. Paste your Zappush snippet into it, then save.
  4. Publish the page. Custom code is stripped from preview URLs, so an unpublished page will never track.
  5. Repeat for every step and every page you want measured, including order forms, upsells, and thank-you pages.

Any page without the element is untracked, so the dashboard reports it as unmeasured rather than as zero traffic. Check the coverage list after you publish.

Turn off "Optimize JavaScript" under Settings → Performance & compliance as well. It lazy-loads custom code, which delays events further. Turning it off is worth doing, but on its own it does not fix the Tracking Code delay above.

Disable Optimize JavaScript in GHL

Page views, funnel steps, and form submissions are captured automatically. Checkout and purchase need the order value and order id, which you send with a data layer push. See the GoHighLevel section of the data layer reference for the exact shape.

Tracking is installed automatically when you connect your Shopify store. You can skip ahead to Connect Meta.

Recommended: custom app install. Reach out to us at support@zappush.com and we will install a custom app for you. The app tracks all events automatically, including checkout and purchase, with no manual data-layer setup required.

If you prefer to add it by hand via theme.liquid:

  1. In your Shopify admin, go to Online Store → Themes.
  2. Find your active theme, click the three-dot menu, then Edit code.
  3. Under Layout, open theme.liquid.
  4. Paste the script tag just before the </head> closing tag.
  5. Save. The tracker goes live on the next page load.
  1. The Zappush for WooCommerce plugin is the recommended path. If you have it, you are already done.
  2. Otherwise, install a header-scripts plugin such as WPCode or Insert Headers and Footers.
  3. Open its header scripts setting, paste the script tag, then save and publish.
  4. If you use WP Rocket or any caching plugin, clear the cache after installing so old pages pick up the tag.

The tracker captures page views and product views automatically. The automatic page view is on by default, and you can turn it off for your store under Settings → Install. If you turn it off, you can still send your own page view whenever you want one, with zappush.track("page_viewed"). Checkout and purchase events require your site to push data to window.dataLayer. See the Data layer reference for the exact pushes needed.

  1. Open the template or layout file that renders your site's <head>.
  2. Paste the script tag just before the closing </head>.
  3. Deploy. The tracker fires on the next page load.

For React or Next.js, add it to your root layout or _document. For static sites, it usually goes in index.html.

The tracker captures page views and product views automatically. The automatic page view is on by default, and you can turn it off for your store under Settings → Install. If you turn it off, you can still send your own page view whenever you want one, with zappush.track("page_viewed"). Checkout and purchase events require your site to push data to window.dataLayer. See the Data layer reference for the exact pushes needed.

3. Confirm the tracker is live

  1. Visit your store in a normal browser tab to generate a page view.
  2. In the dashboard, open Sessions or Events under Analytics.
  3. Within a few minutes you should see your visit appear: a session, and events like page views and product views.

Seeing nothing after a few minutes? Confirm the snippet is in the <head> on a live page, clear any page cache, and load a page in a fresh tab. The tracker only fires on real page loads.

You'll know it worked when

A session and at least one event appear in your analytics within a few minutes of loading a page on your store.

Next: Connect Meta.

On this page