Got your Google Conversion Tracking Code ? Don’t know how to setup that in your WordPress Woocommerce website? OK , let me show you how to add that code to the Woocommerce thank you page.

1. Go to your WordPress Dashboard > Appearance > Editor.

2. Find the functions.php file from the right column of the editor.

google-convertion- tracking-code

3. go the the bottom of the functions.php file and paste the below code.


add_action( 'woocommerce_thankyou', ‘chili_tracking_code’ );
 
function chili_tracking_code() {
?>
[Your code goes here]
<?php
}

Example below.


add_action( 'woocommerce_thankyou', ‘chili_tracking_code’ );
 
function chili_tracking_code() {
?>
<!-- Google Code for Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 000000000000;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "kjsdhfkjhkfsdfsdf";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/000000000000/?label=kjdhfsdjfkjkjshdkkkjsdkk&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<?php
}

Thats it. You are ready to go.