This guide covers all the ways you can install Zenovay tracking on your website.
Finding Your Tracking Code
First, get your unique tracking code:
- Log in to your Zenovay dashboard
- Select your website from the dropdown
- Go to Settings → Tracking Code
- 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.
For React or other SPA frameworks, add the same script tag to your index.html or root layout:
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js"
></script>
Then use the global zenovay function in your components:
// Track custom events after the script loads
function handleSignup() {
zenovay('track', 'signup_click', { plan: 'pro' });
}
For Next.js, add the script in your _app.tsx or layout.tsx:
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
defer
src="https://api.zenovay.com/z.js"
data-tracking-code="YOUR_TRACKING_CODE"
/>
</head>
<body>{children}</body>
</html>
)
}
Script Options
You can customize the tracking behavior with additional data attributes:
| Attribute | Description | Default |
|---|---|---|
data-tracking-code | Your unique tracking code (required) | - |
data-api-url | Custom API endpoint URL | https://api.zenovay.com |
data-debug | Enable debug mode in console | false |
data-ignore-dnt | Override Do Not Track to track anyway | false |
data-allow-localhost | Enable tracking on localhost | false |
data-heartbeat | Send periodic heartbeat pings | false |
data-track-outbound | Track outbound link clicks | false |
data-silent | Suppress all console output | false |
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 PlanFor ad-blocker resistant tracking, set up first-party tracking using your own domain:
Add CNAME Record
Add a CNAME DNS record pointing a subdomain (e.g., analytics.yourdomain.com) to proxy.zenovay.com.
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>
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:
- Open your website in a new browser tab
- Open browser DevTools (F12) and go to the Network tab
- Filter by "zenovay" or "tracker"
- 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
- Verify your installation to ensure everything works
- Track custom events for important user actions
- Set up goals to measure conversions