So you want to track your conversion for ad-words? Here is how you do it for woo-commerce. 


Get the Conversion Tracking Code from AdWords

Log into your AdWords account. Select "tools" then "Conversions". WooCommerce Conversion Tracking Code For AdWords WooCommerce Conversion Tracking Code For AdWords Next select "+ Conversions" and add one. You can see I added one called "purchases". Conversions Conversions When you click on the name your created it will give you a conversion code. I am clicking on purchases. Conversion Code Conversion Code  

Go To WordPress and Enter Conversion Code

Now you want to go to your WordPress dashboard and open up your functions.php in your theme. It is better if you use a child theme so your changes are never overwritten. Put your tracking code in where it tells you too below. You do not need to get the order total but I will leave it in the code below if someone wants it.
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );

function my_custom_tracking( $order_id ) {

// Lets grab the order
$order = wc_get_order( $order_id );

echo ' PUT YOUR CONVERSION TRACKING SCRIPT HERE LEAVE THE QUOTES ';
}

Go To Appearance then Editor

Appearance - Editor Appearance - Editor

Then Choose Theme Functions.php

The theme functions will be on the right hand side of the screen. Theme Functions Theme Functions  

Enter Your Conversion Tracking Code and Save File

Make sure that you have your tracking code in there!!! Save Update File Save Update File Congratulations you now have a conversion pixel installed so you can track your orders!


Sign Up To Comment