Free10 minutesbeginner

Tracking Not Working

Diagnose and fix common issues when Zenovay tracking isn't recording visitor data.

trackinginstallationdebuggingscriptissues
Last updated: January 15, 2025

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:

Option 1: 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>

Option 2: Use custom domain (Enterprise)

  • Configure analytics.yourdomain.com
  • Point to Zenovay servers

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. Go to Domains and select your website
  2. Copy the Website ID
  3. Compare with your script tag

IDs 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 initial page view recorded

Cause: Single Page Apps don't trigger full page loads

Solution for React Router:

import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function Analytics() {
  const location = useLocation();

  useEffect(() => {
    if (window.zenovay) {
      window.zenovay('page');
    }
  }, [location]);

  return null;
}

Solution for Vue Router:

router.afterEach(() => {
  if (window.zenovay) {
    window.zenovay('page');
  }
});

Issue: Localhost/Development Not Tracking

Symptom: Works in production, not locally

Cause: Some configurations exclude localhost

Check dashboard settings:

  1. Go to Domains and select your website
  2. Check Allowed Domains
  3. Add localhost if needed

Or enable debug mode:

<script
  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:

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

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. Go to DashboardLive
  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

Script Not Loading

Check:

  1. Plugin activated
  2. Website ID entered
  3. Caching cleared

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 support@zenovay.com with:

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

Next Steps

Was this article helpful?