Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I'm trying to set up conversion tracking (sending ecommerce data to the data layer via Customer Events custom pixel, and retrieving and sending it to the respective vendors like GA4 through GTM) and Consent Mode (via CookieBot).
However, I'm struggling with passing the consent data from the top JavaScript context (since CookieBot is installed via theme.liquid file) to the Sandbox context (that's where all the conversion events are happening via Customer Events).
I've tried using postMessageAPI for the theme.liquid to send consent data to sandbox context, and addEventListener() method in Customer Events to listen for those messages. However, I'm getting the following warning in console:
In a sandboxed environment, addEventListener may not behave as expected.
Due to which this is not working.
Does anybody know of a workaround?
Hi Karolk95,
Thanks for your query.
could you please share your website?
which datalayer did you use to track ?theme dependent or independent?
Hello Sam,
the website is www.moblax.cz
I've used data layer inside Customer Events (sandboxed one).
Thanks