Menu

Google Analytics (GA4)

Google Analytics (GA4) is Google’s free analytics product. It’s great for basic site analytics like pageviews/unique visitors, traffic sources, page paths, and conversion events.

Good to know

  • NEXTY.DEV disables tracking scripts in development to avoid polluting analytics data.
  • To verify locally, open app/[locale]/layout.tsx and remove the process.env.NODE_ENV === "development" check.
  • If you don’t need local verification, just set the production environment variables and the scripts will be enabled automatically.

Step 1: Create a GA4 property and a data stream

  1. Open the Google Analytics console: https://analytics.google.com/
  2. Click Admin (bottom-left) → Create property
Create a GA4 property
Create a GA4 property
Create a GA4 property
Create a GA4 property
Create a GA4 property
  1. After the property is created, copy the ID that starts with G- and paste it into the environment variable NEXT_PUBLIC_GOOGLE_ID.
Create a web data stream