Cookie consent mode

gjulio96
Shopify Partner
3 0 0

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
3 0 0

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
3 0 0

Screenshot 2024-04-03 at 08.41.03.png

Mike-Omega
Shopify Partner
157 27 30

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 it’s helpful to you, please give it a like or mark as a solution.
Need any help for Shopify Design or Custom task, please contact via email: locdt@omegatheme.com
Consentik GDPR Cookie Banner: Effortlessly stay compliant with EU GDPR, CCPA