5分で読めます
AI統合プロンプト
AI コーディングアシスタント(Cursor、Lovable、Replit、Windsurf など)でこれらのプロンプトを使用して、ウェブサイトに Zenovay トラッキングをインストールしてください。
Zenovay APIで構築していますか? AIアシスタント向けAPIプロンプトをチェックアウトしてください。ダッシュボード、ウィジェット、マップ、メールダイジェストなど、外部APIを使用して構築するための8つのすぐに使えるプロンプトがあります。
YOUR_TRACKING_CODE を Zenovayダッシュボード から取得した実際のトラッキングコードに置き換えてください。ZV_ABC123XYZ のような形式です。
基本的なインストールプロンプト
このプロンプトをコピーして、AIアシスタントに貼り付けてください:
このプロンプトをコピーTEXT
I need to add Zenovay Analytics tracking to my website.
My tracking code is: YOUR_TRACKING_CODE
Please add the Zenovay tracking script to my website:
Add this script to the <head> section of my HTML or root layout file:
<script defer data-tracking-code="YOUR_TRACKING_CODE" src="https://api.zenovay.com/z.js"></script>
For React/Next.js apps:
- Add it to the root layout file (app/layout.tsx or pages/_app.tsx)
- Use the Next.js Script component with strategy="afterInteractive"
The script should load on every page. That's all - Zenovay handles everything automatically.Next.js専用プロンプト
Next.jsプロジェクト向けTEXT
Add Zenovay Analytics to my Next.js project.
My tracking code is: YOUR_TRACKING_CODE
In my app/layout.tsx (or pages/_app.tsx for Pages Router), add:
import Script from 'next/script'
Then in the <head> section:
<Script
src="https://api.zenovay.com/z.js"
data-tracking-code="YOUR_TRACKING_CODE"
strategy="afterInteractive"
/>
Make sure the Script component is imported from 'next/script'.React(Vite/CRA)プロンプト
Reactプロジェクト向けTEXT
Add Zenovay Analytics to my React project.
My tracking code is: YOUR_TRACKING_CODE
In my main App.jsx or App.tsx file, add this useEffect:
import { useEffect } from 'react';
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);
}, []);
Add this inside the main App component, not inside a nested component.ファーストパーティプロキシプロンプト(アドバンス)
広告ブロッカーをバイパスしたい場合は、これを使用してください:
ファーストパーティプロキシの設定TEXT
I need to set up a first-party proxy for Zenovay Analytics to bypass ad blockers.
My tracking code is: YOUR_TRACKING_CODE
This requires two changes:
1. SET UP THE PROXY
For Next.js, add this to next.config.js:
module.exports = {
async rewrites() {
return [
{
source: '/api/_z/:path*',
destination: 'https://api.zenovay.com/fp/:path*',
},
]
},
}
For Cloudflare Pages, create functions/api/_z/[[path]].ts with a proxy function.
2. UPDATE THE SCRIPT
Change the script src from:
src="https://api.zenovay.com/z.js"
To:
src="/api/_z/script.js"
And pass the tracking code as a query param:
src="/api/_z/script.js?id=YOUR_TRACKING_CODE"
This routes tracking through my own domain, making it first-party.Cloudflare Pagesプロキシプロンプト
Cloudflare PagesファーストパーティプロキシTEXT
Create a Cloudflare Pages Function to proxy Zenovay Analytics requests.
Create this file: functions/api/_z/[[path]].ts
The function should:
1. Catch all requests to /api/_z/*
2. Forward them to https://api.zenovay.com/fp/*
3. Pass the client IP in X-Zenovay-Real-IP header
4. Handle CORS preflight requests
5. Forward POST bodies for tracking events
Here's the implementation:
export async function onRequest(context) {
const { request, params } = context
const path = (params.path || []).join('/')
const targetUrl = 'https://api.zenovay.com/fp/' + path + new URL(request.url).search
if (request.method === 'OPTIONS') {
return new Response(null, {
status: 204,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
},
})
}
const headers = new Headers(request.headers)
headers.set('X-Zenovay-Real-IP', request.headers.get('CF-Connecting-IP') || '')
headers.delete('Host')
const init = { method: request.method, headers }
if (request.method === 'POST') {
init.body = await request.arrayBuffer()
}
const response = await fetch(targetUrl, init)
const responseHeaders = new Headers(response.headers)
responseHeaders.set('Access-Control-Allow-Origin', '*')
return new Response(response.body, {
status: response.status,
headers: responseHeaders,
})
}
Then update my tracking script to use /api/_z/script.js?id=MY_TRACKING_CODEWordPress/Shopifyプロンプト
WordPressまたはShopify向けTEXT
Add Zenovay Analytics to my WordPress/Shopify site.
My tracking code is: YOUR_TRACKING_CODE
For WordPress:
- Install the "Insert Headers and Footers" plugin
- Go to Settings > Insert Headers and Footers
- Paste this in "Scripts in Header":
<script defer data-tracking-code="YOUR_TRACKING_CODE" src="https://api.zenovay.com/z.js"></script>
For Shopify:
- Go to Online Store > Themes > Edit code
- Open theme.liquid
- Add before </head>:
<script defer data-tracking-code="YOUR_TRACKING_CODE" src="https://api.zenovay.com/z.js"></script>
Save the file.トラブルシューティングプロンプト
トラッキングが機能しない場合TEXT
My Zenovay Analytics tracking isn't working. Help me debug it.
My tracking code is: YOUR_TRACKING_CODE
Check these things:
1. Is the script in the <head> section? It must be in <head>, not <body>.
2. Is the script loading? Open DevTools (F12) > Network tab > search for "z.js"
- Should return status 200
- If 404, the script path is wrong
- If blocked, need first-party proxy
3. Check console for errors (F12 > Console)
- Should see: "[Zenovay] Script executing..."
- If no Zenovay logs, script isn't loading
4. Is tracking enabled? Look for:
- "Zenovay Analytics loaded { enabled: true }"
- If enabled: false, check if localhost or DNT is blocking
5. For debugging, add data-debug="true" to the script tag:
<script defer data-tracking-code="YOUR_CODE" data-debug="true" src="..."></script>
This will show detailed logs in the console.Vercelデプロイメントプロンプト
Vercelプロジェクト向けTEXT
Add Zenovay Analytics to my Vercel-deployed project with first-party proxy.
My tracking code is: YOUR_TRACKING_CODE
1. Add rewrites to next.config.js:
module.exports = {
async rewrites() {
return [
{ source: '/api/_z/:path*', destination: 'https://api.zenovay.com/fp/:path*' },
]
},
}
2. In my layout file, add:
import Script from 'next/script'
<Script
src="/api/_z/script.js?id=YOUR_TRACKING_CODE"
strategy="afterInteractive"
/>
3. Deploy to Vercel - the rewrites will work automatically.
This bypasses ad blockers by routing through my Vercel domain.クイックリファレンス
| フレームワーク | スクリプトを追加する場所 |
|---|---|
| HTML | index.html の </head> の前 |
| React | App.jsx/tsx の useEffect |
| Next.js | app/layout.tsx または pages/_app.tsx |
| Vue | public/index.html または App.vue |
| WordPress | Insert Headers and Footers プラグイン |
| Shopify | theme.liquid の </head> の前 |
| Webflow | Project Settings > Custom Code > Head |
| Squarespace | Settings > Advanced > Code Injection |
ヘルプが必要ですか?
このページは役に立ちましたか?