Title: Google Consent Mode
Last modified: February 8, 2023

---

# Google Consent Mode

 *  Resolved [byte37](https://wordpress.org/support/users/byte37/)
 * (@byte37)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/google-consent-mode-9/)
 * Goodmorning Dev Team,
   I’m trying to implement your code you wrote on this guide
   for the [Google Consent Mode](https://www.cookieyes.com/documentation/implementing-google-consent-mode-using-cookieyes/#Method_2_I_2):
 *     ```wp-block-code
       <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](https://wordpress.org/support/users/cookieyesteam/)
 * (@cookieyesteam)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/google-consent-mode-9/#post-16453318)
 * Hi [@byte37](https://wordpress.org/support/users/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](https://wordpress.org/support/users/byte37/)
 * (@byte37)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/google-consent-mode-9/#post-16453329)
 * Hi there, 
   thanks for ther answer.The website is: [https://perlecase.it/](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](https://wordpress.org/support/users/cookieyesteam/)
 * (@cookieyesteam)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/google-consent-mode-9/#post-16455675)
 * Hi [@byte37](https://wordpress.org/support/users/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.
 *     ```wp-block-code
       <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](https://wordpress.org/support/users/cookieyesteam/)
 * (@cookieyesteam)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/google-consent-mode-9/#post-16472426)
 * Hi [@byte37](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [CookieYes Team](https://wordpress.org/support/users/cookieyesteam/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/google-consent-mode-9/#post-16472426)
 * Status: resolved