`; } // PAGEVIEW EVENT export function pageview(event) { window.top.postMessage({ event: 'page_view', pageType: event.context.pageType, currency: event.context.currency, }, "*"); } // PRODUCT VIEWED EVENT export function product_viewed(event) { window.top.postMessage({ event: 'view_item', ecommerce: { currency: event.productVariant.price.currencyCode, items: [{ item_name: event.productVariant.product.title, item_id: event.productVariant.sku || event.productVariant.id, price: event.productVariant.price.amount, quantity: 1 }] } }, "*"); } // ADD TO CART EVENT export function product_added_to_cart(event) { window.top.postMessage({ event: 'add_to_cart', ecommerce: { currency: event.productVariant.price.currencyCode, items: [{ item_name: event.productVariant.product.title, item_id: event.productVariant.sku || event.productVariant.id, price: event.productVariant.price.amount, quantity: event.quantity }] } }, "*"); } // CHECKOUT STARTED EVENT export function checkout_started(event) { window.top.postMessage({ event: 'begin_checkout', ecommerce: { currency: event.checkout.currencyCode, items: event.checkout.lineItems.map(item => ({ item_name: item.product.title, item_id: item.sku || item.variantId, price: item.originalUnitPrice.amount, quantity: item.quantity })) } }, "*"); } // PURCHASE EVENT export function checkout_completed(event) { window.top.postMessage({ event: 'purchase', ecommerce: { transaction_id: event.checkout.orderId, value: event.checkout.totalPrice.amount, currency: event.checkout.totalPrice.currencyCode, items: event.checkout.lineItems.map(item => ({ item_name: item.product.title, item_id: item.sku || item.variantId, price: item.originalUnitPrice.amount, quantity: item.quantity })) } }, "*"); } });})(self.webPixelsManager.createShopifyExtend('198836549', 'custom'));