You can accomplish this task quite easily: either install a plugin from the Wordpress repository or you can use a WooCommerce hook.

What is a hook?

I'll let WooCommerce themselves answer this.

Hooks in WordPress essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.

You can find out more about hooks here.

Using a hook to add a Google Conversion code

The hook you're going to want to use is the woocommerce_thankyou hook. This will allow you to add your custom tracking/conversion code into the thank you page a user will see after sucessfully completing an order. The below code needs to be added into your themes functions.php file.


add_action( 'woocommerce_thankyou', 'custom_tracking_conversion_code' );
function custom_tracking_conversion_code() {

    // echo custom tracking code here

}

That's it!

You're all done, make sure to escape quotations or use the opposite " and ' to one another when echoing out the tracking code. Visit the WooCommerce hooks introductory guide here for more information.