How to load Clicky goals on the WooCommerce thank you page?
-
Hi,
Could someone help me with a little bit of code, since I’m not a developer?
I need to load this script for Clicky analytics on the order thank you page of my WooCommerce shop:
<script type="text/javascript"> var clicky_goal = { id: "123", revenue: "19.99" }; </script>
Please take a look at this link, and could you please modify the script on that page?
https://docs.woothemes.com/document/custom-tracking-code-for-the-thanks-page/What I want is to track the revenue on the WooCommerce thank you page. The revenue is always different, so it would be great if you can help me with this. I’ll use it in the functions.php of the theme.
I’ve added this to the functions.php but it did not work:
add_action( 'woocommerce_thankyou', 'my_custom_tracking' ); function my_custom_tracking( $order_id ) { // Lets grab the order $order = wc_get_order( $order_id ); <script type="text/javascript"> var clicky_goal = { id: "123", revenue: "$order->get_order_total();" }; </script> }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to load Clicky goals on the WooCommerce thank you page?’ is closed to new replies.