-
-
Save Garconis/83b16d3a7cbd211e0342ee631e03c886 to your computer and use it in GitHub Desktop.
Add analytics tracking to the WooCommerce order received / thank-you page
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
/** | |
* Add Tracking Code to the Order Recieved Page | |
*/ | |
function wc_ninja_checkout_analytics( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$currency = $order->get_order_currency(); | |
$total = $order->get_total(); | |
$date = $order->order_date; | |
?> | |
<!-- Paste Tracking Code Under Here --> | |
<!-- End Tracking Code --> | |
<?php | |
} | |
add_action( 'woocommerce_thankyou', 'wc_ninja_checkout_analytics' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment