If you use WooCommerce (WordPress), please follow these instructions:
Alternative way for WooCommerce (WordPress):
[CLIENT ID]
with the client ID provided by your Voyage account manager.<?php
add_action( 'woocommerce_thankyou', 'voyage_purchase' );
function voyage_purchase( $order_id ) {
$order = wc_get_order( $order_id );
?>
<script type="text/javascript">
/* <![CDATA[ */
(function(){if(window.voyage)return;window.voyage={q:[]};var fns=["init", "track"];
for(var i=0;i<fns.length;i++){(function(fn){window.voyage[fn]=function(){
this.q.push([fn,arguments]);}})(fns[i])}})();voyage.init("[CLIENT ID]", { popup: true});
/* ]]> */
</script>
<script async src="<https://assets.voyagetext.com/voyage.production.js>"></script>
<script type="text/javascript">
voyage.track("Purchase", { amountCents: <?php echo $order->get_total()*100; ?> });
</script>
<?php