...
analytics.subscribe("checkout_completed", event => {
const products = event.data.checkout.lineItems.map((product) => ({
productId: product.id,
productName: encodeURIComponent(product.title),
quantity: product.quantity,
price: product.variant.price.amount
}))
prz("event", "transaction", ` {"products": ${JSON.stringify(products)}}`)
});
You will have the complete code now ready to publish:
Hit Save, then Connect and this is now live!
...