Login
ZappushZappush Docs
Reference

Scripts

How the Zappush tracker and gate scripts load, the URL shape of each, and where to copy the exact snippet for your store.

Zappush serves two small scripts. The tracker captures shopper events on your store, and is the same script across every route in your store: install it once and it works everywhere. The gate runs on a compliant page and hands visitors off to your store while carrying their identity across; it stays specific to the route it belongs to. Either way, the snippet you copy from the dashboard already contains the right key.

The tracker script

The tracker loads on your store's pages and records events like page views, product views, cart actions, and checkouts. It records a page view on every page load. That automatic page view is on by default and can be turned off for your store under Settings → Install; with it off, you can still send your own page view with zappush.track("page_viewed"). The tracker's URL looks like this, with your own key in place of your-key:

<script src="https://api.zappush.com/s/your-key.js" defer></script>

The defer attribute lets the page finish parsing before the script runs, so it never blocks rendering. The dashboard install snippet also wraps this loader with a small inline block that buffers events fired before the script loads. Copy the exact snippet from Settings → Install in the dashboard rather than the example above, since the key is unique to your store.

Full install instructions, including where to paste the snippet for GoHighLevel, Shopify, WordPress, and custom sites, are in Install the tracker. GoHighLevel is the one platform where the snippet goes on the page itself rather than in the site settings, and the reason is on that page.

If you see a Custom script card under Settings → Install, you can paste your own JavaScript there. It runs after the tracker on every page that loads it, so it can call zappush.track() to send an event your pages do not send on their own. Keep personal data such as emails or phone numbers out of the code. A saved change usually reaches your visitors within about five minutes.

The gate script

The gate script powers a compliant page. It is served at the same host but under the /g/ path:

<script src="https://api.zappush.com/g/your-key.js" defer></script>

Like the tracker, the gate loads with defer. You normally do not paste this by hand. Copy the exact snippet from the route's Install panel in the dashboard, since the key identifies which route the gate belongs to.

What the scripts configure

You do not configure the scripts in the page. Zappush bakes everything they need into the file it serves for your key: the ingestion key that ties events to your store, the API endpoint to send events to, and route attribution for compliant pages. The tracker script is the same across every route in your store, so there is nothing to set in the snippet beyond the key in the URL; the gate script stays specific to the route that issued its key.

Always copy the snippet from the dashboard. A snippet copied from somewhere else will send events to the wrong place or fail to load.

If your store is paused or still being set up, the script returns a harmless placeholder that logs a short status message and captures nothing. It is replaced automatically once your store is active, with no change needed on your side.

On a store with Consent management turned on, the tracker respects each shopper's cookie choice. It picks the choice up from your consent banner when the banner supports Google Consent Mode v2, or from window.zappush.setConsent() when you pass it yourself. See Manage consent.

On this page