FeaturesAnalytics
PreviousNext

Google Analytics

Setup Google Analytics for your project.

In this page, we will see how to setup Google Analytics for an application.

To-do list

You will need to get your GA_MEASUREMENT_ID token. Here are the steps to get it:

Go to the Google Analytics website and create an account and a new property.

In Admin, under Data collection and modification, click Data Streams

Select the Web tab.

You will get your GA_MEASUREMENT_ID at the top right corner.

Google Analytics Measurement ID location

Google Analytics Measurement ID location

Environment variables

# ============================================
# 📊 ANALYTICS
# ============================================
 
# For Google Analytics
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
NEXT_PUBLIC_GA_DISABLE_LOCALHOST_TRACKING=true
NEXT_PUBLIC_GA_DISABLE_PAGE_VIEWS_TRACKING=false

How is this guide?

Last updated on 10/17/2025