Skip to content

Instantly share code, notes, and snippets.

@codee47
Forked from mikejolley/functions.php
Last active December 24, 2015 11:29
Show Gist options
  • Save codee47/6791119 to your computer and use it in GitHub Desktop.
Save codee47/6791119 to your computer and use it in GitHub Desktop.
Add script to thank you page in woocommerce.
<?php
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
// Lets grab the order
$order = new WC_Order( $order_id );
/**
* Put your tracking code here
* You can get the order total etc e.g. $order->get_order_total();
**/
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment