Step-by-step guides to install EazyStats tracking code on your platform
Follow these simple steps to integrate EazyStats analytics into your Next.js App Router (v13+) application.
The recommended way to add scripts to all pages in a Next.js App Router application is by using the root layout file.
Typically located at app/layout.jsx or app/layout.tsx
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html lang="en">
<head>
<Script
data-website-id="your_website_id"
data-site-domain="yourdomain.com"
src="https://eazystats.com/tracker.js"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
);
}
Important: Make sure to replace the placeholder values:
your_website_id → Your actual Website ID from EazyStatsyourdomain.com → Your website's root domainEazyStats is disabled on localhost to avoid tracking your own development traffic. The analytics will only work on your live website.
After deploying your changes, follow these steps to verify everything is working:
Deploy and visit your live website
View your dashboard for incoming data
Data appears within a few minutes
You can also add the script directly to your public/index.html file if you prefer:
<script
defer="" data-website-id="your_website_id" data-site-domain="yourdomain.com" src="https://eazystats.com/tracker.js"
> </script>_app.jsafterInteractive for optimal performanceYour Next.js app should now be tracking visitors with EazyStats. Check your dashboard to see your analytics!