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.tsxand remove theprocess.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
- Open the Google Analytics console:
https://analytics.google.com/ - Click Admin (bottom-left) → Create property
- After the property is created, copy the ID that starts with
G-and paste it into the environment variableNEXT_PUBLIC_GOOGLE_ID.