Problem:
Your GA4 gtag.js snippet appears correctly implemented, includes a user_id, and passes the real-time configuration test in the GA4 Admin interface (Test your website shows a green tick). However, no data is appearing in your GA4 reports weeks later, and you see the "Data collection isn't active" warning.
Likely Causes & How to Troubleshoot:
The successful admin test usually just verifies that the tag syntax is detectable on the URL provided. It doesn't always guarantee that data is being successfully transmitted and processed from your live site during normal user visits. The most common reasons for this discrepancy are:
Hits Not Sent from Live Site:
Action: Open your live website. Use your browser's Developer Tools
(F12). Go to the Network tab. Refresh the page.
Verify: Filter the requests for collect?v=2&tid=G-Lxxxxxxx (replace
G-Lxxxxxxx with your Measurement ID). Do you see requests with a 200
or 204 status code being sent to Google Analytics when pages load? If
no requests are appearing here, the tag isn't firing correctly on the
live site, potentially due to:
Incorrect Deployment: The code isn't actually live in the on
all pages, or there's a typo only on the live version. Double-check
the live source code.
JavaScript Errors: Check the Console tab in Developer Tools for
unrelated JS errors that might be halting script execution before the
gtag runs.
Hits Blocked:
Action: Test your live site using an Incognito/Private browsing window with browser extensions (especially ad/tracking blockers) disabled.
Verify: If requests now appear in the Network tab (or data appears in DebugView - see next point), the issue is likely client-side blocking by browser extensions or privacy settings for many of your users.
Check Content Security Policy (CSP): Look in the Console tab for errors related to CSP blocking *.googletagmanager.com or *.google-analytics.com. If you have a CSP header, ensure these domains are allowed in script-src and connect-src.
Hits Not Received/Processed by GA:
- Action: Use GA4's DebugView.
Install the "Google Analytics Debugger" Chrome extension and turn it ON.
In your GA4 Property, go to Admin > Data display > DebugView.
Visit your live website in Chrome (with the extension ON).
- Verify: Do you see events (page_view, first_visit, etc.) appearing in the DebugView interface within a few seconds?
If YES: Data is reaching Google. The problem might be significant reporting delays (unlikely after weeks), or Data Filters (Admin > Data Settings > Data Filters) accidentally excluding all your traffic (check if 'Developer Traffic' filters are misconfigured or too broad).
If NO: Combined with seeing no hits in the Network tab, this strongly points to the tag not firing or hits being blocked client-side (Points 1 & 2).
In summary: Focus first on the Network tab on your live site and GA4 DebugView. These will quickly tell you if the browser is sending data and if GA is receiving it, narrowing down whether the issue is tag implementation/firing, client-side blocking, or GA filtering. The passing admin test can be misleading in these scenarios.
collect
requests to Google endpoint using the correct measurement id? Do you get a proper server response? I also really don't like how you hardcode the user_id to a static string, but that should only result in there being 1 user in GA. Maybe that's exactly what GA doesn't like.