• Resolved byte37

    (@byte37)


    Goodmorning Dev Team,
    I’m trying to implement your code you wrote on this guide for the Google Consent Mode:

    <script>
    
        window.dataLayer = window.dataLayer || [];
    
        function gtag() {
    
            dataLayer.push(arguments);
    
        }
    
        gtag(“consent”, “default”, {
    
            ad_storage: “denied”,
    
            analytics_storage: “denied”,
    
            functionality_storage: “denied”,
    
            personalization_storage: “denied”,
    
            security_storage: “granted“,
    
            wait_for_update: 2000,
    
        });
    
        gtag(“set”, “ads_data_redaction”, true);
    
    </script>
    
     

    I’ve added in the header the custom code, then right after the gtag code script and then wordpress right after loads the cookieyes script.

    But with your code provided i get an error in the console, specifically in this line:?

    gtag(“consent”,?“default”,?{

    With this error:
    Uncaught SyntaxError: illegal character U+201C

    Could you please help me?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi @byte37,

    Greetings from CookieYes!

    To better help you, it would be great if you could share your website URL with us so we can take a closer look.

    Thread Starter byte37

    (@byte37)

    Hi there,
    thanks for ther answer.
    The website is: https://perlecase.it/
    And now there’s only your custom code in the header (i didn’t put the gtag code to avoid GDPR problems).

    Looking forward for your solution!

    Thanks

    Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi @byte37,

    We appreciate you sharing the URL with us. Upon closer inspection, we have identified that the inverted quotes in the code are not properly formatted. This issue may have arisen when you copied and pasted the script. To resolve this, please use the corrected script provided below.

    <script>
    
        window.dataLayer = window.dataLayer || [];
    
        function gtag() {
    
            dataLayer.push(arguments);
    
        }
    
        gtag("consent", "default", {
    
            ad_storage: "denied",
    
            analytics_storage: "denied",
    
            functionality_storage: "denied",
    
            personalization_storage: "denied",
    
            security_storage: "granted",
    
            wait_for_update: 2000,
    
        });
    
        gtag("set", "ads_data_redaction", true);
    
    </script>
    Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi @byte37,

    This thread has been inactive for a bit, so we are going to mark it as resolved now. Please feel free to open a new thread or follow-up if you have any further questions or still need help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Google Consent Mode’ is closed to new replies.