メインコンテンツへスキップ
5分で読めます

Tracking Script Installation

Add Zenovay analytics to your website with a single line of code. No configuration required.

Quick Install (30 seconds)

Copy this script and paste it into your website's <head> section:

Basic InstallationHTML
<!-- Zenovay Analytics v2.0.6 -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js">
</script>

Replace YOUR_TRACKING_CODE with your tracking code from the Zenovay Dashboard. It looks like ZV_ABC123XYZ.

That's it! The script automatically tracks:

  • Page views
  • Visitor sessions
  • Geographic location
  • Device and browser info
  • Referral sources
  • UTM parameters

Framework-Specific Installation

HTML / Static Sites

Add directly before the closing </head> tag:

index.htmlHTML
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<!-- Zenovay Analytics v2.0.6 -->
<script defer
  data-tracking-code="YOUR_TRACKING_CODE"
  src="https://api.zenovay.com/z.js">
</script>
</head>
<body>
<!-- Your content -->
</body>
</html>

React

Add the script in your root component's useEffect:

App.jsx or index.jsJSX
import { useEffect } from 'react';

function App() {
useEffect(() => {
  const script = document.createElement('script');
  script.src = 'https://api.zenovay.com/z.js';
  script.defer = true;
  script.setAttribute('data-tracking-code', 'YOUR_TRACKING_CODE');
  document.head.appendChild(script);
}, []);

return <div>Your App</div>;
}

export default App;

Next.js (App Router)

Add to your root layout file:

app/layout.tsxTSX
import Script from 'next/script';

export default function RootLayout({ children }) {
return (
  <html lang="en">
    <head>
      <Script
        src="https://api.zenovay.com/z.js"
        data-tracking-code="YOUR_TRACKING_CODE"
        strategy="afterInteractive"
      />
    </head>
    <body>{children}</body>
  </html>
);
}

Next.js (Pages Router)

Add to your _document.tsx:

pages/_document.tsxTSX
import { Html, Head, Main, NextScript } from 'next/document';
import Script from 'next/script';

export default function Document() {
return (
  <Html>
    <Head>
      <Script
        src="https://api.zenovay.com/z.js"
        data-tracking-code="YOUR_TRACKING_CODE"
        strategy="afterInteractive"
      />
    </Head>
    <body>
      <Main />
      <NextScript />
    </body>
  </Html>
);
}

Vue.js

Add to your index.html or use in App.vue:

index.htmlHTML
<!DOCTYPE html>
<html>
<head>
<!-- Zenovay Analytics -->
<script defer
  data-tracking-code="YOUR_TRACKING_CODE"
  src="https://api.zenovay.com/z.js">
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>

WordPress

Option 1: Using a Plugin (Recommended)

  1. Install the Insert Headers and Footers plugin
  2. Go to Settings → Insert Headers and Footers
  3. Paste this in "Scripts in Header":
WordPress Header ScriptHTML
<!-- Zenovay Analytics -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js">
</script>

Option 2: Edit Theme

Add to header.php before </head>:

wp-content/themes/your-theme/header.phpPHP
<!-- Zenovay Analytics -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js">
</script>
</head>

Shopify

  1. Go to Online StoreThemes
  2. Click ActionsEdit code
  3. Open theme.liquid
  4. Add before </head>:
theme.liquidHTML
<!-- Zenovay Analytics -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js">
</script>
</head>

Webflow

  1. Go to Project SettingsCustom Code
  2. Paste in the Head Code section:
Webflow Head CodeHTML
<!-- Zenovay Analytics -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="https://api.zenovay.com/z.js">
</script>

Squarespace

  1. Go to SettingsAdvancedCode Injection
  2. Paste in the Header section

Verify Installation

1. Check Browser Console

Open your browser's developer tools (F12) and look for:

[Zenovay] Script executing... (v2.0.6)
Zenovay Analytics loaded { trackingCode: 'YOUR_TRACKING_CODE', enabled: true }

2. Enable Debug Mode

To see detailed logs, enable debug mode in your Dashboard Settings or add the debug attribute:

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

トラッカーが送信するすべてのイベント — タイプ、プロパティ、Cookie レス モード、GPC 状態、同意状態 — をページ内でビジュアルに確認するには、ドメイン設定で Debug Overlay を有効にし、URL に ?zenovay_debug=1 を付けて任意のページを読み込んでください。個人情報はマスクされます。

3. Check Real-Time Dashboard

Visit your Zenovay Dashboard and check the Real-Time view to see your visit appearing live.

Script Attributes

Customize behavior with data attributes:

AttributeTypeDefaultDescription
data-tracking-codestringrequiredYour tracking code (e.g., ZV_ABC123)
data-debugbooleanfalseShow console logs
data-allow-localhostbooleanfalseTrack localhost visits

Ad Blocker Protection

Some ad blockers may block api.zenovay.com. Use our First-Party Proxy for 100% tracking accuracy:

If you're seeing blocked requests in Firefox or Edge, set up a First-Party Proxy to route tracking through your own domain.

First-Party Proxy ScriptHTML
<!-- First-Party Proxy (bypasses ad blockers) -->
<!-- Requires proxy setup - see: docs.zenovay.com/guides/first-party-tracking -->
<script defer
data-tracking-code="YOUR_TRACKING_CODE"
src="/api/_z/script.js">
</script>

Content Security Policy (CSP)

If your site uses CSP headers, add Zenovay:

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

Troubleshooting

Script Not Loading

  1. Check for typos in your tracking code
  2. Verify the script is in <head> not <body>
  3. Check CSP headers - add api.zenovay.com to allowed sources
  4. Disable ad blocker temporarily to test

No Events in Dashboard

  1. Wait 30 seconds - events are batched
  2. Check browser console for errors
  3. Enable debug mode to see event logs
  4. Try incognito/private window to rule out extensions

Ad Blocker Blocking Script

Set up a First-Party Proxy to route tracking through your domain.

Using AI to Install

If you're using AI coding assistants (Cursor, Lovable, Replit), check our AI Integration Prompts for copy-paste prompts.

Next Steps

このページは役に立ちましたか?