Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Incorrect Customer Privacy API & Web Pixel Connection

Incorrect Customer Privacy API & Web Pixel Connection

mattdenoronha
Shopify Partner
35 1 15

We have a web pixel set up with the following customer privacy settings

 

[customer_privacy]
analytics = false
marketing = false
preferences = false
sale_of_data = "disabled"

Despite this, the web pixel only fires if the cookie consent banner is accepted. Which shouldn't be the case as the docs say:


To configure a pixel to run without requiring consent (strictly necessary / essential), set the above purposes to false

 

Is there an issue with web pixels here?

Replies 6 (6)

Liam
Community Manager
3108 344 894

Hi Mattdenoronha - you have the `toml` settings for the app pixel set up correctly. It's possible that your app pixel isn’t properly subscribed to events or the cookie banner is a 3rd party system that is blocking the pixel.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

mattdenoronha
Shopify Partner
35 1 15

Hi Liam,

 

Thanks for your reply.

 

We've tested this with just logging something to the console, both inside and outside events. The cookie banner is the default one that appears after enabling it in Shopify.

 

On pageload, no events are triggered and nothings logged to console. As soon as the cookie banner is accepted, the test message is logged and events work again. Despite the privacy settings we've set.

 

learning-development-store.myshopify.com is our test store. The web pixel should log 'CM Init' on load, but waits for cookie banner approval.

mattdenoronha
Shopify Partner
35 1 15

We may have found the cause. On running app dev and opening the app, the extension reverted back to requiring 'marking' and 'analytics' permissions - which I believe is the default.

 

We do also try to readd the extension on first accessing the app, which intentionally fails as the extension already exists. Not sure if this reverts the permissions, but I doubt it.

 

We need to stop the dev app running and redeploy the app to return the permissions back to those set in the TOML (although may not need the redeploy, this might just speed it up).

 

Not sure if the above is expected behaviour - that the development app versioning running should change the extension's permissions?

@Liam 

Liam
Community Manager
3108 344 894

Hi Matt - I have connected with our internal dev team on this and they're looking into this!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

AdamSturrock
New Member
4 0 0

Hey Liam, any update on where this is with the internal dev team? We'd like to start testing as we prepare to move our app away from script tags ASAP ahead of script tags being deprecated.

adi110
Shopify Partner
5 0 1

Based on our tests, if cookie consent is rejected then the Web Pixel API won't load at all. Which means, it will not trigger any event you're subscribed to.