When I enable "Limit tracking for customers in Europe” setting - Shopify still places the cookies without consent, but as session cookies. This is still not GDPR compliant - but there is nothing we can do about that at the moment.
<script>
window.Shopify.loadFeatures(
[
{
name: 'consent-tracking-api',
version: '0.1',
},
],
error => {
if (error) {
throw error; // if you want to raise
}
new Banner(); // or whatever method your banner uses to initialize
},
);
</script>
<script>
function handleAccept(e) {
window.Shopify.customerPrivacy.setTrackingConsent(true);
document.addEventListener("trackingConsentAccepted", function () {
console.log("trackingConsentAccepted event fired");
});
}
</script>
I'm implementing this with google tagmanager and metomic cookie consent widget.
The second script will run when a user gives consent.
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |