import {register} from '@shopify/web-pixels-extension'; register((api) => { // you can access the web pixel
extension API in here api.analytics.subscribe('page_viewed', (event) => { console.log(`Event Name is:
${event.name}`); // Event Name is: page_viewed
// Set a cookie with the standard API api.browser.cookie.set('my_user_id', 'ABCX123');
console.log(`Customer Name: ${api.init.data.customer.firstName}`); // Customer Name: Bogus
console.log(api.settings); /** * { * "accountID": 234 * } */ }); });