Tracking sales in woocommerce
-
Hello,
I need to track my sales with woocommerce. I googled and found this article:
http://docs.woothemes.com/document/custom-tracking-code-for-the-thanks-page/and here’s what I added in my functions.php file:
add_action( ‘woocommerce_thankyou’, ‘my_custom_tracking’ );
function my_custom_tracking( $order_id ) {
$order = new WC_Order( $order_id );
$total->get_order_total();
$tracking_code = ‘<iframe src=”https://media.adverkeyz.com/trk/dep.php?t=132465&am=%5BAMOUNT_HERE%5D&curr=EUR” width=”1″ height=”1″ frameborder=”0″ scrolling=”no”></iframe>’;
$tracking_code = str_replace(‘[AMOUNT_HERE]’, $total, $tracking_code);
echo $tracking_code;
}I’d like to know if what I did here is ok or not.
Can anyone please help ?
Thanks a lot.
- The topic ‘Tracking sales in woocommerce’ is closed to new replies.