I have an application with conversion tracking that we have implemented via Customer Event Pixels. The conversion events fire correctly, however the unique ID that is stored in a cookie is not included in the request due to the sandboxed nature of the JS. Further, it is not possible to retrieve this cookie with JS because it is, as it should be, a secure cookie (https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/Cookies) which browsers prevent from accessing via JS. I tested to confirm this by using the browser API (https://shopify.dev/docs/api/web-pixels-api/standard-api/browser).
This limitation drives us to reimplement these pixels in an alternate tag management solution (GTM in this case, but it could be any tag manager) which reduces the value of the customer event pixels and is still broken on checkout since GTM is loaded via a Shopify customer event pixel (i.e. in sandboxed JS) when using checkout extensibility.
I see a couple of other posts from developers describing a similar issue but without including the detail of whether the cookie is “secure” or not. I expect that all of these are related to the same fundamental issue: the browser does not allow JS to read secure cookie that would otherwise be included in the request from the top frame.
-
https://community.shopify.com/c/technical-q-a/web-pixels-conversion-tracking-and-cookies/m-p/2658133
If I’m misunderstanding something here, please let me know.