Skip to main content
Free10 minutesBeginner

Tracking Not Working

Diagnose and fix common issues when Zenovay tracking isn't recording visitor data. Learn about tracking in this troubleshooting guide.

trackinginstallationdebuggingscriptissues
Last updated:

Follow this guide to diagnose and fix issues when Zenovay isn't tracking visitors.

Quick Diagnosis

Check in Browser Console

  1. Open your website
  2. Press F12 or right-click → Inspect
  3. Go to Console tab
  4. Type: window.zenovay

Expected result: A function (typeof === 'function') If undefined: Script not loading

Check Network Tab

  1. Go to Network tab
  2. Refresh the page
  3. Filter by "zenovay" or "analytics"
  4. Look for z.js and API calls

Common Issues

Issue: Script Not Loading

Symptom: window.zenovay is undefined

Causes:

  1. Script tag missing or incorrect
  2. Ad blocker blocking script
  3. Content Security Policy (CSP) blocking
  4. Script loading error

Solutions:

Check your script tag:

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

Common mistakes:

<!-- Wrong: Missing website ID -->
<script src="https://api.zenovay.com/z.js"></script>

<!-- Wrong: Typo in URL -->
<script src="https://api.zennovay.com/z.js"></script>

<!-- Wrong: Missing closing tag -->
<script src="https://api.zenovay.com/z.js">

Issue: Ad Blocker Interference

Symptom: Script loads for you but not all visitors

Test:

  1. Disable your ad blocker
  2. Refresh the page
  3. Check if tracking works

Solutions:

Self-host the script:

# Download script
curl -o zenovay.js https://api.zenovay.com/z.js

# Host on your domain
# Then use:
<script src="/js/zenovay.js" data-tracking-code="YOUR_TRACKING_CODE"></script>

Self-hosting serves the script from your own origin, which most ad blockers won't touch. If you self-host, keep the file up to date so you get tracker fixes and new features.

Issue: Content Security Policy Blocking

Symptom: Console shows CSP violation error

Error example:

Refused to load the script 'https://api.zenovay.com/z.js'
because it violates the Content-Security-Policy directive

Solution:

Update your CSP header:

Content-Security-Policy:
  script-src 'self' https://api.zenovay.com;
  connect-src 'self' https://api.zenovay.com;

Issue: Wrong Website ID

Symptom: No data in dashboard

Check:

  1. Open Domains and select your website
  2. Open Settings → General to view the install snippet for that site
  3. Compare the data-tracking-code value in the snippet with the one on your live page

The codes should match exactly:

<script data-tracking-code="abc123-def456-ghi789"></script>

Issue: Script Loads After User Leaves

Symptom: Low page view counts

Cause: Script in wrong position or slow loading

Solution: Place script in <head> with defer:

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

Issue: SPA Not Tracking Page Changes

Symptom: Only the initial page view is recorded in a single-page app (React, Vue, etc.)

How Zenovay handles this: The tracker automatically detects client-side route changes. It patches history.pushState / history.replaceState and listens for popstate and pageshow, so navigations in React Router, Vue Router, Next.js, and similar frameworks are recorded without any extra code.

If you're only seeing the first page view, check that:

  1. The script is loaded once, near the top of your app (in <head> with defer) and isn't removed on route change
  2. Your router actually updates the URL via the History API (most do)

Manual page views (optional): If your app changes the visible "page" without changing the URL, you can record a page view yourself:

if (window.zenovay) {
  window.zenovay('page');
}

Only do this for navigations the tracker can't see on its own — calling it on every route change in addition to the automatic tracking will double-count views.

Issue: Localhost/Development Not Tracking

Symptom: Works in production, not locally

Cause: The tracker blocks localhost, 127.0.0.1, and *.local hostnames by default so your development traffic doesn't pollute production data.

To allow tracking on localhost, add data-allow-localhost="true" to the script tag:

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

You can also turn this on per site in the dashboard: open Domains, select your website, then Settings → General and enable the localhost / debug option.

To see what the tracker is doing, enable debug logging with data-debug="true" (or append ?zenovay_debug=true to the page URL):

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

Issue: HTTPS/HTTP Mismatch

Symptom: Script blocked on HTTPS sites

Cause: Loading HTTP script on HTTPS page

Solution: Always use HTTPS:

<!-- Correct -->
<script src="https://api.zenovay.com/z.js"></script>

<!-- Wrong on HTTPS sites -->
<script src="http://api.zenovay.com/z.js"></script>

Debug Mode

Enable detailed logging by adding data-debug="true" to the script:

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

You can also enable it on any page without changing the snippet by appending ?zenovay_debug=true to the URL.

Check console for:

  • Script initialization
  • Page view events
  • API responses
  • Error messages

Testing Tracking

Manual Test

// In browser console
if (window.zenovay) {
  window.zenovay('track', 'test_event', { test: true });
  console.log('Event sent!');
} else {
  console.log('Zenovay not loaded');
}

Verify in Real-Time

  1. Open Domains, select your website, and go to the Live View tab
  2. Visit your site in another tab
  3. You should appear within seconds

Server-Side Rendering Issues

Next.js

// Only load on client
import dynamic from 'next/dynamic';

const Analytics = dynamic(() => import('./Analytics'), {
  ssr: false
});

Nuxt.js

// nuxt.config.js
export default {
  head: {
    script: [
      {
        src: 'https://api.zenovay.com/z.js',
        'data-tracking-code': 'YOUR_ID',
        defer: true,
        body: true // Load at end of body
      }
    ]
  }
}

WordPress Issues

Zenovay does not provide an official WordPress plugin — you add the tracking script manually (in your theme's header.php, via a wp_head action in functions.php, or with a "header/footer scripts" plugin). See Add Zenovay to WordPress for the exact code.

Script Not Loading

Check:

  1. The tracking snippet is actually present in the page source (view source, search for z.js)
  2. The data-tracking-code value matches the one in your dashboard
  3. Caching is cleared after editing the theme or snippet

Cache Plugin Conflicts

Exclude Zenovay from optimization:

WP Rocket:

Settings → File Optimization → Exclude External:
api.zenovay.com

W3 Total Cache:

Performance → Minify → JS Minify Settings → Never minify:
api.zenovay.com/z.js

Verification Checklist

  • Script tag present in page source
  • Website ID correct
  • No console errors
  • Network request succeeds (200 status)
  • Not blocked by ad blocker
  • CSP allows analytics domain
  • Correct domain in dashboard settings
  • Real-time view shows visits

Still Not Working?

Gather Information

Before contacting support:

  1. Your website URL
  2. Browser console errors
  3. Network tab screenshots
  4. Website ID (partial)
  5. When it stopped working

Contact Support

Email [email protected] with:

  • Subject: "Tracking Not Working"
  • Information gathered above
  • Steps you've already tried

Next Steps

Was this article helpful?