Support » Plugin: GDPR Cookie Compliance (CCPA ready) » Reject not working at the first time

  • Resolved quent1000

    (@quent1000)


    Hi ! I have seen some old topic before but it didn’t work for me.
    I use Google analytics 4 and when I click on the reject button the third party cookies are deleted but when I navigate to another page they come back! To permanently delete them, I have to go back to the cookies settings and save my settings again.

    Thank you for your help

    Plugin version 4.4.5

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @quent1000

    Thanks for using our plugins.

    We spent about 2hrs to find a solution to this 🙂

    It’s true, the GA4 cookies can’t be deleted. Our plugin removes the cookies on reject, but the GA script and function is still there, it will re-create the cookies before we reload the page. So to fix this, we would suggest going with Google Consent setup:

    https://support.mooveagency.com/topic/google-tag-manager-integration/

    The GA script should be hardcoded to head section:

    <script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    
    // Default ad_storage to 'denied'.
    gtag('consent', 'default', {
    'ad_storage': 'denied'
    });
    
    gtag('js', new Date());
    gtag('config', 'GA_MEASUREMENT_ID');
    </script>

    and only the following script should be added to our plugin:

    <script>
    gtag('consent', 'update', {
    'ad_storage': 'granted'
    });
    </script>

    Hope this helps.
    Thanks

    Thread Starter quent1000

    (@quent1000)

    Sorry for my late answer.
    Thank you for your quick answer, your solution works perfectly. I just added the analytics_storage tag to prevent the sending of statistical data if the user refuses it.

    
    'analytics_storage': 'denied'
    

    I will recommend the use of your plugin for future projects.

    Thanks again.

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @quent1000

    Glad to hear it’s all working for you now!

    If you have time, we would highly appreciate if you could help us and rated our plugin with 5 stars in the WordPress.org repository so other users can find it too:

    https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/?rate=5#new-post

    Many thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.