Hello Vercel Community
I am currently hosting a Next.js application on Vercel and I am having trouble with Google Analytics (GA4) tracking. I’ve followed all the recommended steps to integrate the tracking code into the website, including using the correct gtag.js
snippet in the <head>
section of my layout.tsx
file.
Here are the details of my setup:
- Google Analytics property ID: G-XXXXXXXXXX
- Tracking method: Google Tag Manager with the
gtag.js
snippet
Even though the tracking code has been implemented correctly, I am receiving the following message from Google Analytics:
“Data collection is not active for your website. If tags have been installed for more than 48 hours, make sure they are set up correctly.”
I’ve also tried verifying the setup using Chrome Tag Assistant, and the tag seems to be firing correctly on the site, but Google Analytics still doesn’t show any data being collected.
I’ve checked multiple scenarios such as:
- Correct placement of the Google Analytics tracking code.
- Ensured the tracking code is placed in all pages.
- Checked for any ad blockers or browser extensions that could interfere with the tracking.