Getting Started
Installation Guide
Learn how to install Invoker Analytics on different platforms and frameworks.
Basic Installation
The simplest way to install Invoker Analytics is to add the tracking script to your HTML. Place this code just before the closing </head> tag:
HTML Script Tag
<script defer data-domain="your-domain.com" src="https://api.invoker-analytics.com/js/script.js" ></script>
Framework-Specific Installation
Next.js (App Router)
Add the script to your root layout file:
// app/layout.tsx
import Script from 'next/script'
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<head>
<Script
defer
data-domain="your-domain.com"
src="https://api.invoker-analytics.com/js/script.js"
/>
</head>
<body>{children}</body>
</html>
)
}Configuration Options
The tracking script supports several configuration options via data attributes:
| Attribute | Required | Description |
|---|---|---|
data-domain | Yes | Your website domain (e.g., example.com) |
data-api | No | Custom API endpoint (for self-hosted instances) |
defer | Recommended | Loads script without blocking page render |
Verifying Installation
After installing the script, verify it's working correctly:
- Open your website in a browser
- Open the browser's Developer Tools (F12)
- Go to the Network tab and filter by "script.js"
- Refresh the page and verify the script loads with a 200 status
- Check your Invoker dashboard for incoming pageviews
Troubleshooting
Script not loading
- Ensure the script tag is placed in the
<head>section - Check for any Content Security Policy (CSP) blocking the script
- Verify your domain matches exactly what's in your Invoker settings
Pageviews not appearing
- Wait a few minutes - data may take up to 5 minutes to appear
- Check if ad blockers are blocking the request
- Ensure you're not viewing from a blocked IP or country