Google Analytics
Google Analytics
Make sure you already have a Google Analytics account before proceeding.
Framecast AI supports Google Analytics out of the box. You just need to create a property and add the tracking values to your .env file.
Create a Google Analytics Property
Go to your Google Analytics dashboard and click the Settings icon from the sidebar. Click Create and select Property from the dropdown. Fill in the required details (Property Name, Business Details, Business Objectives) and click Create. Choose Web as the platform, enter your website URL and a stream name, then click Create & Continue.
Get Your Tracking Values
After creating the property, a setup dialog will appear. Select the Install Manually option. You will see two values you need to copy:
- The full
srcURL (looks likehttps://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX) - The measurement ID (looks like
G-XXXXXXXXXX)
Update Your .env File
Open your .env file and replace the Google Analytics placeholders with the values you copied:
# Full script URL including https://
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID_VALUE=G-XXXXXXXXXXReplace G-XXXXXXXXXX with your actual measurement ID in both lines.
You can verify the integration is working by clicking the Test button in the Google Analytics setup dialog. Once confirmed, analytics will start tracking automatically.