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: January 15, 2025

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. Select your website from the dropdown
  3. Go to SettingsTracking Code
  4. Copy your tracking code

Your tracking code is a unique identifier that looks like: zv_abc123xyz

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 pingsfalse
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

Pro Plan

For ad-blocker resistant tracking, set up first-party tracking using your own domain:

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, check the Live tab in your dashboard 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?