Traffic Monitoring Setup for AdminOps
This page outlines a practical setup for Google Analytics 4, Google Search Console, and optional privacy-first analytics (Plausible or Fathom) in a Next.js App Router project hosted on Vercel.
1) Google Analytics 4 (GA4)
- Create a GA4 property for adminops.cloud in your Google Analytics account.
- Create a Web data stream and copy the Measurement ID (format: G-XXXXXXXXXX).
- In Vercel project settings, add environment variable NEXT_PUBLIC_GA_MEASUREMENT_ID.
- Redeploy the project so the variable is available in production.
- Verify traffic in GA4 Realtime after visiting your live site.
The GA4 script is loaded in app/layout.js when NEXT_PUBLIC_GA_MEASUREMENT_ID is present.
2) Google Search Console (GSC)
- Open Search Console and add a Domain property for adminops.cloud.
- Verify ownership using DNS TXT record via your DNS provider.
- Submit your XML sitemap once available (for example, /sitemap.xml).
- Monitor indexing coverage, Core Web Vitals, and query impressions weekly.
3) Optional privacy-friendly analytics
Plausible
- Create a Plausible site entry for adminops.cloud.
- Add Vercel environment variable NEXT_PUBLIC_PLAUSIBLE_DOMAIN with value adminops.cloud.
- Redeploy and verify events in Plausible dashboard.
Fathom
- Create a Fathom site and copy your Site ID.
- Add Script tag in app/layout.js using next/script and your Site ID env variable.
- Deploy and confirm pageviews in Fathom live view.
Where tracking scripts belong in Next.js
Place analytics scripts in app/layout.js so they load for every route. Use environment variables to control script injection by environment and keep production IDs out of source control.
Recommended env variables
- NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
- NEXT_PUBLIC_PLAUSIBLE_DOMAIN=adminops.cloud
- NEXT_PUBLIC_FATHOM_SITE_ID=YOUR_FATHOM_SITE_ID