So you are spending money on AdWords clicks for your WooCommerce store?How do you know if you are getting value for money?

Are customers spending money with you after you’ve bought their click? Is it worth it? Whats your return on investment? Luckily, Google gives us answers to this by implementing their AdWords Conversion  Tracking Code.

Setting up the conversion is covered in Google’s AdWords Documentation. Once you have the conversion, you will have some conversion code from the wizard to implement.

Whilst there are plugins for this exact purpose, a lot of them are bloated, can slow down your site or simply over engineered for this simple store function.

Here’s how we add the AdWords Conversion code to the checkout page without a plugin.
Simply replace the tracking code below with the code provided by Google.

It starts at

<!-- Google Code for Conversion Page -->

and ends at

</noscript>

Full code

<?php
add_action( 'woocommerce_thankyou', 'lwd_conversion_tracking' );     
 
function lwd_conversion_tracking() {     
?>
<!-- Google Code for Medical Booked Conversion Page --> <script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 00000000;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "00000000"; 
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/00000000/?label=00000000&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<?php
}
?>
Share on Google+

Lime Web Development is a small and focused specialist web development agency based in Chorley, Lancashire. We primarily produce PHP web applications in WordPress, WooCommerce and CakePHP.

Add Conversion Tracking Code to your WooCommerce Thank You Page

Leave a Reply

Your email address will not be published. Required fields are marked *