Solved
google analytics no longer tracks page views with privacy controls and cookie solution deployed
After embedding privacy controls and cookie solutions - google analytics no longer tracks page views. Real time shows close to zero page views, but shows hundreds of users. If i remove the embedded code, page views track again.
this is the code I am embedding. I need to have it on for GDPR compliance and adsense, and i'd like to have it on for state law as well. What do I need to do to fix this problem?
<script type="text/javascript"> var _iub = _iub || []; _iub.csConfiguration = {"applyGdprForCH":false,"askConsentAtCookiePolicyUpdate":true,"countryDetection":true,"enableFadp":true,"enableLgpd":true,"enableTcf":true,"floatingPreferencesButtonDisplay":"bottom-right","gdprAppliesGlobally":false,"googleAdditionalConsentMode":true,"lang":"en","lgpdAppliesGlobally":false,"perPurposeConsent":true,"reloadOnConsent":true,"siteId":xxxxxx,"tcfPurposes":{"2":"consent_only","7":"consent_only","8":"consent_only","9":"consent_only","10":"consent_only","11":"consent_only"},"cookiePolicyId":7843777, "banner":{ "acceptButtonCaptionColor":"#FFFFFF","acceptButtonColor":"#0073CE","acceptButtonDisplay":true,"backgroundColor":"#FFFFFF","closeButtonRejects":true,"customizeButtonCaptionColor":"#4D4D4D","customizeButtonColor":"#DADADA","customizeButtonDisplay":true,"explicitWithdrawal":true,"listPurposes":true,"prependOnBody":true,"rejectButtonCaptionColor":"#FFFFFF","rejectButtonColor":"#0073CE","rejectButtonDisplay":true,"showPurposesToggles":true,"textColor":"#000000" }}; </script> <script type="text/javascript" src="//cs.iubenda.com/sync/543404.js"></script> <script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/stub-v2.js"></script> <script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/safe-tcf-v2.js"></script> <script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
How can I fix the issue of Google Analytics no longer tracking page views after embedding privacy controls and cookie solutions for GDPR compliance?
After embedding privacy controls and cookie solutions to comply with GDPR and other regulations, Google Analytics has stopped tracking page views accurately. Real-time data shows close to zero page views but hundreds of users. When the embedded code is removed, page views are tracked again. The current embedded code configuration includes various consent parameters for GDPR, LGPD, and other privacy laws. It's crucial to have these controls active for compliance with GDPR, Adsense, and sta te laws.
```
I need to maintain this setup for GDPR compliance and would appreciate guidance on resolving this issue.
How can I resolve the issue of Google Analytics not tracking page views after embedding privacy controls and cookie solutions for GDPR compliance?
Hi,
Thank you for reaching out with your query regarding the issue of Google Analytics not tracking page views after embedding privacy controls and cookie solutions for GDPR compliance. I understand how important it is to ensure accurate tracking while adhering to privacy regulations.
The primary reason for Google Analytics not tracking page views in this scenario is often due to the prior-blocking of Google Analytics scripts. This is a common and necessary measure to remain compliant with GDPR when a user rejects cookies. However, if you prefer to avoid this behavior, there are a couple of steps you can take to resolve the issue:
Avoid Prior-Blocking: Ensure that the Google Analytics tag is not subjected to prior-blocking. This way, the script will run regardless of the user's cookie preferences. However, this method should be used with caution to remain within the bounds of GDPR compliance.
Google Consent Mode: If you are utilizing an auto-blocking feature for your cookies, there is a specific setting that can help. You can select the checkbox labeled "Do not block scripts that adhere to Google Consent Mode." This allows Google Analytics to function appropriately while still respecting user consent preferences.
Furthermore this guide can help https://www.iubenda.com/en/help/153445-what-to-do-when-the-automatic-blocking-mode-is-blocking-too-much
By implementing one of these solutions, you should be able to restore the tracking functionality of Google Analytics while maintaining compliance with GDPR.
If you need further assistance or have any additional questions, please feel free to reach out.
Best regards,
thank you soo much its solve