Skip to main content
Free10 minutesBeginner

Installing the Tracking Script

Learn how to add the Zenovay tracking script to your website using various methods including HTML, npm, and CMS integrations.

installationtrackingscriptsetuphtml
Last updated:

This guide covers all the ways you can install Zenovay tracking on your website.

Finding Your Tracking Code

First, get your unique tracking code:

  1. Log in to your Zenovay dashboard
  2. Open Domains and select the site you want to track
  3. Open the website's settings and go to the General tab
  4. Copy the script from the Tracking Script section

Your tracking code is a unique 12-character identifier (for example aB3xYz9kLm2P). It is embedded in the script snippet you copy, so you usually do not need to handle it on its own.

The Tracking Script card in a website's settings, showing HTML, React, Next.js, and First-Party install tabs with a copyable script snippet and an install-verification button.
The Tracking Script section is where you copy your snippet and pick the install method that matches your stack.

Installation Methods

The simplest way to add tracking is with a script tag. Add this code to your website's <head> section:

<script
  defer
  src="https://api.zenovay.com/z.js"
  data-tracking-code="YOUR_TRACKING_CODE"
></script>

Replace YOUR_TRACKING_CODE with your actual tracking code from the dashboard.

Script Options

You can customize the tracking behavior with additional data attributes:

AttributeDescriptionDefault
data-tracking-codeYour unique tracking code (required)-
data-api-urlCustom API endpoint URLhttps://api.zenovay.com
data-debugEnable debug mode in consolefalse
data-ignore-dntOverride Do Not Track to track anywayfalse
data-allow-localhostEnable tracking on localhostfalse
data-heartbeatSend periodic heartbeat pingstrue
data-track-outboundTrack outbound link clicksfalse
data-silentSuppress all console outputfalse

DNT (Do Not Track) and GPC (Global Privacy Control) are respected by default. You do not need any attribute to enable this. Use data-ignore-dnt="true" only if you need to override this behavior. Other privacy settings such as IP anonymization and privacy mode are configured in Settings in the dashboard.

Example with Options

<script
  defer
  src="https://api.zenovay.com/z.js"
  data-tracking-code="YOUR_TRACKING_CODE"
  data-debug="true"
></script>

First-Party Tracking

Scale Plan

For ad-blocker resistant tracking, serve the script from your own domain. The custom-domain (CNAME) setup below requires a Scale or Enterprise plan:

  1. Add CNAME Record

    Add a CNAME DNS record pointing a subdomain (e.g., analytics.yourdomain.com) to proxy.zenovay.com.

  2. Update Script URL

    Change the script source to use your subdomain:

    <script
      defer
      src="https://analytics.yourdomain.com/z.js"
      data-tracking-code="YOUR_TRACKING_CODE"
    ></script>
    
  3. Wait for DNS Propagation

    DNS changes can take up to 48 hours to propagate fully.

First-party tracking helps ensure your analytics work even when visitors use ad blockers or privacy extensions.

Verifying Installation

After adding the script:

  1. Open your website in a new browser tab
  2. Open browser DevTools (F12) and go to the Network tab
  3. Filter by "zenovay" or "tracker"
  4. You should see requests being made to the Zenovay API

Alternatively, open your website's dashboard and select the Live View tab to see your visit appear in real time.

Troubleshooting

Script Not Loading?

  • Ensure the script is in the <head> section
  • Check for JavaScript errors in the browser console
  • Verify your tracking code is correct
  • Make sure there are no Content Security Policy (CSP) issues

Next Steps

Was this article helpful?