# Google analytics no longer tracks page views with privacy controls and cookie solution deployed

**URL:** <https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067>\
**Category:** General requests\
**Created:** [January 7, 2024, 3:22am UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067 "2024-01-07T03:22:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://yyz2.discourse-cdn.com/flex048/user_avatar/support.iubenda.com/dan/32/23_2.png) [@dan](https://support.iubenda.com/u/dan)\
**Post date:** [January 7, 2024, 3:22am UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067/1 "2024-01-07T03:22:44Z")

</div>

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?

&nbsp;

```
<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>
```

&nbsp;

* * *

_Importato da [support.iubenda.com](http://support.iubenda.com) (topic #42000305963) · 👁 907 visualizzazioni_

---

<div class="post-metadata">

**Author:** ![lutzmex](https://yyz2.discourse-cdn.com/flex048/user_avatar/support.iubenda.com/lutzmex/32/11_2.png) [@lutzmex](https://support.iubenda.com/u/lutzmex)\
**Post date:** [May 13, 2024, 9:10pm UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067/2 "2024-05-13T21:10:01Z")

</div>

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.

```&nbsp;

```
<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](https://cs.iubenda.com/sync/543404.js)”></script>
<script type=“text/javascript” src=“[//cdn.iubenda.com/cs/tcf/stub-v2.js](https://cdn.iubenda.com/cs/tcf/stub-v2.js)”></script>
<script type=“text/javascript” src=“[//cdn.iubenda.com/cs/tcf/safe-tcf-v2.js](https://cdn.iubenda.com/cs/tcf/safe-tcf-v2.js)”></script>
<script type=“text/javascript” src=“[//cdn.iubenda.com/cs/iubenda\_cs.js](https://cdn.iubenda.com/cs/iubenda_cs.js)” charset=“UTF-8” async></script> 
```

I need to maintain this setup for GDPR compliance and would appreciate guidance on resolving this issue.

---

<div class="post-metadata">

**Author:** ![blackrichard423](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@blackrichard423](https://support.iubenda.com/u/blackrichard423)\
**Post date:** [May 24, 2024, 9:57am UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067/3 "2024-05-24T09:57:42Z")

</div>

How can I resolve the issue of Google Analytics not tracking page views after embedding privacy controls and cookie solutions for GDPR compliance?

---

<div class="post-metadata">

**Author:** ![daniele.comarca](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@daniele.comarca](https://support.iubenda.com/u/daniele.comarca)\
**Post date:** [June 3, 2024, 11:35am UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067/4 "2024-06-03T11:35:24Z")

</div>

Hi,&nbsp;

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:

1. **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.

2. **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](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,

---

<div class="post-metadata">

**Author:** ![malikhassanad71](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@malikhassanad71](https://support.iubenda.com/u/malikhassanad71)\
**Post date:** [June 8, 2024, 11:51am UTC](https://support.iubenda.com/t/google-analytics-no-longer-tracks-page-views-with-privacy-controls-and-cookie-solution-deployed/4067/5 "2024-06-08T11:51:32Z")

</div>

thank you soo much its solve
