• Resolved miichaaeel

    (@miichaaeel)


    We have integrated Consent Mode v2 in Advanced Mode via Google Tag Manager. Everything works well so far and the consent is recorded correctly. A correct consent update also takes place.

    However, the page_view is still recorded with the consent mode G100 and not with G111 as expected. The subsequent events on the exact same page and in the same session – without reaload (e.g. user_engagement) then have the correct code G111.

    What am I overlooking, or what could be the reason? Thank you very much for your help and for pointing me in the right direction.

    Assumption: I’m not sure, but somehow it almost seems to me as if the GA4 tag is already loaded before the consent update takes place. So of course the call to Google Analytics is made under the wrong conditions and with the wrong consent mode (G100 instead of G111). How can I change this? Via the plugin settings or do I have to make adjustments in Google Tag Manager?

    • This topic was modified 7 months, 1 week ago by miichaaeel.
    • This topic was modified 7 months, 1 week ago by miichaaeel.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter miichaaeel

    (@miichaaeel)

    Update: I think it has to do with the fact that I set “Script Insertion” and “Cookie Removal” to dynamic.

    If I set them back to static, then the respective code (GCS G100 or GCS G111) is correct throughout the page_view. Then, however, the cookies are no longer deleted when I “Revoke the Consent”, as is the case when I have both set to “dynamic”.

    So I have the choice that either the cookies are completely removed again (2x dynamic) or that I get the correct GCS (2x static). Both not optimal 🙁

    Translated with DeepL.com (free version)

    Plugin Author Moove Agency

    (@mooveagency)

    Hello,

    Thanks for using our plugins.

    You can try to activate the ‘Force Reload‘ option on the same settings page (General Settings).

    The force reload should solve the problem.

    If the problem still persists, you can try the following setup:

    Script Insertion Method” => STATIC
    Cookie Removal” => DYNAMIC

    Hope this helps.

    Thread Starter miichaaeel

    (@miichaaeel)

    I have adjusted the 3 options on the page mentioned as suggested

    • Force Reload =>enabled
    • “Script Insertion Method” => STATIC
    • “Cookie Removal” => DYNAMIC

    The issure was specifically about the fact that the page_view was not recorded correctly on subsequently visited pages (or only with G100). I suspect that with “dynamic” script insertion the consent is loaded too late. This can indeed be fixed with “Script Insertion Method” => STATIC. So this issue is solved.

    But then… what does not work, however, is that the cookies are consistently deleted again after the revoke of consent (reject after accepted before). The cookies do disappear briefly in the developer tools. However, one of them reappears immediately.

    _ga -> works correctly -> is removed permanently
    _ga_xxx -> appears again -> is not removed permanently

    What could be the reason for this? I did not have this effect when I set both options to “dynamic”.

    Plugin Author Moove Agency

    (@mooveagency)

    Hello,

    For the cookie removal problem we can’t find any working solution.

    Because the cookie was inserted by GTM, we can’t remove the JavaScript from the page source, therefore the GA cookie will be re-created after our plugin removes all the cookies as the window.gtag function is always present.

    You can try removing the GA4 property from GTM, and use our ‘Direct integration’ method for GA4 instead.

    Hope this helps.

    Thread Starter miichaaeel

    (@miichaaeel)

    Last week I checked everything in detail and now this week there is yet another misbehaviour.

    I accept the cookies and then change the page. Then the page_view is recorded there again with the GCS G100 instead of G111 as it should be (with the Google Chrome Addon Analytics debugger).

    I’m starting to get a bit perplexed. What else could I do?

    I still have the feeling that the script is sometimes executed too late despite being “static”. In the example (page mentioned in the first post of the forum topic), the collect script from Google analytics is loaded first with G100 and only later a second time with G111. I suspect that the consent update takes place too late. Is there any way to prioritise this further?

    Another guess in finding a solution: can it have something to do with the fact that if I leave the “Banner Initiation Delay” at the default 2000ms, everything is loaded with a delay and the Google Analytics tag is already fired before the consent is updated properly? If I set this value to 0, it somehow seems to work a bit more reliably, at least for the moment.

    Plugin Author Moove Agency

    (@mooveagency)

    Hello,

    Unfortunately we have no other ideas.

    You can either start using a different setup or use the method demonstrated in the video:
    https://vimeo.com/930616766

    Thanks

    Thread Starter miichaaeel

    (@miichaaeel)

    Hello

    I have already watched and read through all the videos and your documentaries several times and in detail before I registered here. I don’t want to bother you unnecessarily as you provide a free plugin, which is great.

    I think the two points are not working properly – but I was able to find a workaround and we can check off the matter here. Even if it’s not the absolute best case scenario. But if it’s really necessary, I would otherwise choose a paid CMP platform. I can’t have the same expectations of a free plugin.

    If it helps you, here are my findings – with the following settings.

    • We use your plugin with the Google Tag Manager integration (Consent Mode v2 advanced) – this is necessary because our customers also want to track cookieless if there is no consent yet. Firing Google Analytics only after consent has been given is therefore NOT an option.
    • The setup works so far. Tracking with GCS 100 and cookieless before consent and tracking with GCS 111 and cookies after consent (with the limitation mentioned below -> banner Initialization to 0)

    What does not work:

    • If the initialization delay is not set to 0 for the banner, the page_view is also captured with the wrong GCS for consent. In my opinion this is a bug. If I change this from the default 2000 to 0, then it works.
    • For the cookies, only the _ga is deleted, but not the _ga – why is not clear to me. Both are set via the GTM. It is strange to me, that one of this can be deleted – and the other not?

    For the complete deletion of cookies we have integrated our own Javascript – unfortunately this is now fired every time the page is loaded and the value thirdparty is set to 0 in the moove_gdpr_popup cookie. Unfortunately, there is no cookie_consent_update on save, because everything is then reset to the initial consent (everything denied). There is then only a reload of the page but no cookie_consent_update that could trigger a trigger.

    <script>

    (function() {
    var cookies = document.cookie.split(";");
    var domainParts = window.location.hostname.split(".");
    var domain = domainParts.slice(-2).join(".");

    // List of paths to delete the cookies from
    var paths = ["/", "/path1", "/path2"]; // add any other specific paths here

    for (var i = 0; i < cookies.length; i++) {
    var cookie = cookies[i];
    var eqPos = cookie.indexOf("=");
    var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
    name = name.trim();

    if (name.match(/^(_ga|_gid|_gat)/)) {
    for (var j = 0; j < paths.length; j++) {
    var path = paths[j];
    document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=" + path + ";";
    document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=" + path + ";domain=." + domain + ";";
    document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=" + path + ";domain=" + window.location.hostname + ";";
    }
    }
    }
    })();
    </script>

    Plugin Author Moove Agency

    (@mooveagency)

    Hello,

    Thanks for your comments.

    If the initialization delay is not set to 0 for the banner, the page_view is also captured with the wrong GCS for consent. In my opinion this is a bug. If I change this from the default 2000 to 0, then it works.

    The default value is set to 2000 otherwise the banner can have impact on the Web Core Vitals. For “most” users this is an optimal default setup as the banner appears with a delay, then the cookie scripts will be loaded (therefore the third party scripts don’t affect the performance scores even if they are enabled default). Plugin users can always reduce the default value to 0 by themselves in the CMS, this is editable at the bottom of CMS → GDPR Cookie Compliance -> Cookie Banner Settings tab.

    For the cookies, only the _ga is deleted, but not the _ga – why is not clear to me. Both are set via the GTM. It is strange to me, that one of this can be deleted – and the other not?

    The _ga-xxxx cookie is created by the Google Analytics tracking script. This loads the gtag function which re-creates that cookie once it is deleted and reappears on page load. If the GA script is added directly via our GDPR plugin, we can remove the script, destroy the gtag function and remove the cookie. But if it’s loaded via GTM, we can’t remove it.

    Hope this helps.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘consent mode v2: page_view with G100 despite consent’ is closed to new replies.