Troubleshooting analytics tracking
Fix common analytics problems: missing data, blocked scripts, CSP errors, double-counted pageviews, traffic showing as Direct, cross-domain and timezone issues.
| Symptom | Start here |
|---|---|
| No data at all, or it stopped | No data |
| Fewer visitors than expected | Ad blockers, GA4 differences |
| Console errors mentioning Content Security Policy | CSP errors |
| Pageviews doubled on a single-page app | SPA double counting |
| Almost everything is "Direct" | Referrer policy |
| Tracking broke after enabling a cache or optimization plugin | Caching plugins |
| Visits split between domains, or your own domain shows as a referrer | Cross-domain |
| "Today" doesn't match, or days look shifted | Timezones |
Still stuck? Add data-debug="true" to the script tag and read the
console (Debug mode), then contact support from the
help menu with your site id and what you see.
Analytics showing no data? Work through this checklist: check the script is on the page and loads, that hits are sent and accepted, and the date range is right.
How ad blockers and privacy browsers affect analytics, how to check whether the tracker is blocked, and what you can do about it.
Fix Content Security Policy errors that block the analytics tracker: add the host to script-src and connect-src, handle nonces, and find where your CSP is set.
Fix pageviews counted twice on single-page apps: duplicate router calls, the script included twice, tag manager history triggers, and checking with debug mode.
Why most of your traffic might show as Direct, how referrer policies on your site and on other sites affect sources, and how UTM parameters fix attribution.
Stop WP Rocket, LiteSpeed Cache, Autoptimize, Cloudflare Rocket Loader and other caching or optimization tools from breaking the analytics tracker script.
Track several domains or subdomains as one site or as separate sites, keep visits together without cookies, and stop your own domain showing as a referrer.
Why today or a day's numbers might not match what you expect: reports use the site's timezone, visits end at midnight UTC, and how the API handles dates.