Invoker Analytics/Documentation
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:

AttributeRequiredDescription
data-domainYesYour website domain (e.g., example.com)
data-apiNoCustom API endpoint (for self-hosted instances)
deferRecommendedLoads script without blocking page render

Verifying Installation

After installing the script, verify it's working correctly:

  1. Open your website in a browser
  2. Open the browser's Developer Tools (F12)
  3. Go to the Network tab and filter by "script.js"
  4. Refresh the page and verify the script loads with a 200 status
  5. 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