In the admin prefs, the client has the option of adding a Checkout Summary Hook. Any html entered in this field will get injected into the head tag of the checkout summary page when a user checks out. You can use this to add custom tracking pixels, for example. Be careful what you add here because it will wind up on every checkout summary page. Try not to break things.
There will be a globally accessible javascript variable called completed_checkout
. It has the following properties:
Here’s an example of using this code for a facebook tracking pixel:
<script type="text/javascript"> var fb_param = {}; fb_param.pixel_id = 'THEID'; fb_param.value = completed_checkout.total_string; fb_param.currency = completed_checkout.currency; (function(){ var fpw = document.createElement('script'); fpw.async = true; fpw.src = '//connect.facebook.net/en_US/fp.js'; var ref = document.getElementsByTagName('script')[0]; ref.parentNode.insertBefore(fpw, ref); })(); </script>