Skip to content

Instantly share code, notes, and snippets.

@oliwoodsuk
Created November 6, 2024 01:20
Show Gist options
  • Save oliwoodsuk/462b5fe00180709357e43c648164a740 to your computer and use it in GitHub Desktop.
Save oliwoodsuk/462b5fe00180709357e43c648164a740 to your computer and use it in GitHub Desktop.
Tracking pre-order event in Shopify Analytics directly
<script>
window.addEventListener(ppConvertingButtonClicked, (e) => {
window.ShopifyAnalytics.lib.track('AddToCart', {
product_id: e.detail.productId,
quantity: e.detail.quantity
});
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment