Re: Cookie consent mode

How to set default consent cookies to 'denied' using Customer Privacy API?

gjulio96
Shopify Partner
5 0 1

Hi!
I'm trying to set all the default consent cookies to "denied" using Customer Privacy API in a script in liquid file (below content_for_header so that to be called immediately) like this:

window.Shopify.customerPrivacy.setTrackingConsent({
"analytics": false,
"marketing": false,
"preferences": false,
"sale_of_data": false,
}

 

but it seems that is not working. I still see a gtag that set the default values the granted. 

 

What I'm doing wrong? There is any solution without the need for yet another app?

 

Thank you!

Replies 5 (5)

Sam_ian
Shopify Partner
63 3 11

Hello Gjulio96

The Best way to set cookie consent V2 banner using google approved CMP like cookiebot and Google tag manager(GTM).It works 100%. Events fire only when users give consent.

Your COFFEE TIP! Can Create something incredible!
Require Assistance with google Analytics?
EMAIL ME!
Solved? accept it as solution with like
gjulio96
Shopify Partner
5 0 1

We are using cookiebot and GTM. We reached to set the first default consent to denied but we still see an second call setting those default values to denied like in the attachment:Screenshot 2024-04-02 alle 12.25.32.png

Sam_ian
Shopify Partner
63 3 11

Can i inspect your GTM setup?

Your COFFEE TIP! Can Create something incredible!
Require Assistance with google Analytics?
EMAIL ME!
Solved? accept it as solution with like
gjulio96
Shopify Partner
5 0 1

Screenshot 2024-04-03 at 08.41.03.png

Mike-Consentik
Shopify Partner
169 28 36

Hi @gjulio96 

 

The code you are using: 

window.Shopify.customerPrivacy.setTrackingConsent({
"analytics": false,
"marketing": false,
"preferences": false,
"sale_of_data": false,
}

only comply Shopify customer privacy.

I recommend you using a consent banner app to stay compliant with Google Consent Mode v2.

Our app Consentik to stay compliant, Google Consent Mode V2 is available in Premium plan.

Please tell me if you have any concerns with app

If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support