Fairly new to working with Pixels, and trying to create one from scratch using a Custom Pixel within a Client’s Shopify environment. However, it does not appear that using the documentation code to get a Cookie (browser documentation here :: https://shopify.dev/docs/api/web-pixels-api/standard-api/browser) is working, as it throws an error in the Custom Event editor.
The code, simplified, is as follows:
analytics.subscribe('checkout_started', (event) => {
const dyid_server = await browser.cookie.get('_dyid_server');
});
Doing this, however, gives the error “Missing semicolon” on the line with await.
I have attached a screenshot showing this error. The error prevents the Custom Pixel from being saved, and I am unsure what to do here. Thanks for any help you can give!
