-
-
Save iurevych/db861977962be1d4b8295c8de1be165f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Order confirmation page aka post purchase | |
if (Shopify && Shopify.checkout) { | |
var _checkout = Shopify.checkout; | |
_q.push(['register_purchase', { | |
email: _checkout.email, | |
order_number: _checkout.order_id, | |
subtotal: _checkout.total_price, | |
coupon_code: _checkout.discount && _checkout.discount.applicable ? _checkout.discount.code : null | |
}]); | |
} else { | |
// some non post-purchase stuff goes here that is loaded on every page. | |
// I removed it to focus attention on the code snippet under question. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment