Issue with Google Analytics Not Tracking on Vercel-hosted Website

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:

  1. Correct placement of the Google Analytics tracking code.
  2. Ensured the tracking code is placed in all pages.
  3. Checked for any ad blockers or browser extensions that could interfere with the tracking.

Hey @rulopx. I don’t have enough info about your project to say what’s going wrong for sure. I’ve seen people have trouble with client-side versus server-side GTM configurations.

There’s a Next.js with Google Analytics example repo that you can use for reference. And if you want to get some additional eyes to help with debugging, you can share a minimal reproducible example, code snippets, or additional project details here. That way the rest of us can see the same issue and suggest more specific solutions :slightly_smiling_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.