How to track conversions with Shopify
Checkout Completed Event
1
2
3

4

5
analytics.subscribe('checkout_completed', (event) => {
const el = document.createElement('script');
el.setAttribute('src', 'https://a.magsrv.com/tag_gen.js');
el.setAttribute('data-goal', 'XXXXX');
const cost = event.data.checkout.subtotalPrice?.amount || event.data.checkout.totalPrice?.amount;
el.setAttribute('data-value', cost);
document.body.appendChild(el);
});6
7


Product Added to Cart Event

Additional Event Setup
Last updated
Was this helpful?

