Tracker
MITInstall on any stack
Drop v5.js into Next.js, WordPress, Shopify, Astro, Remix, SvelteKit, Webflow, or a raw HTML file.
The script must load on every public page. Put it in the document head with defer. Do not load it on admin or preview routes if you want to keep editors out of the numbers — or use `v5_ignore`.
HTML
index.html
<script defer data-domain="example.com"
src="https://analytics.example.com/js/v5.js"></script>Next.js
app/layout.tsx
import Script from 'next/script'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
src="https://analytics.example.com/js/v5.js"
data-domain="example.com"
strategy="afterInteractive"
/>
</body>
</html>
)
}Pair this with `@vector5/middleware/next` so crawlers that never hydrate still count.
WordPress
Add the tag in your theme's header.php before wp_head(), or inject it with a small plugin / "Insert Headers and Footers" style tool. Use the production domain, not localhost.
header.php
<script defer data-domain="example.com"
src="https://analytics.example.com/js/v5.js"></script>
<?php wp_head(); ?>Shopify
Online Store → Themes → Edit code → theme.liquid, just before </head>.
Astro, Remix, SvelteKit, Webflow
- Astro — put the script in
src/layouts/Layout.astro<head>. - Remix —
app/root.tsxinside<head>via a<script>tag. - SvelteKit —
src/app.htmlor+layout.sveltewith<svelte:head>. - Webflow — Project Settings → Custom Code → Head.
Something off? Open an issue · Edit on GitHub

