How do you add a conversion tracking code to the WooCommerce Thank You Page? Well, with a simple snippet (and no plugin) you can!

No matter whether you’re using Google AdWords, Facebook or other forms of marketing – the Thank You Page is such an important section of an ecommerce store and needs some TLC!

WooCommerce: Add Conversion Tracking to the Thank You Page
WooCommerce: Add Conversion Tracking to the Thank You Page WooCommerce: Add Conversion Tracking to the Thank You Page

WooCommerce Snippet: Add Conversion Tracking Code to Thank You Page


/**
 * @snippet       Add Conversion Tracking Code to Thank You Page
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=19964
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 3.5.2
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_action( 'woocommerce_thankyou', 'bbloomer_conversion_tracking_thank_you_page' );

function bbloomer_conversion_tracking_thank_you_page() {
?>
   <!-- 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&guid=ON&script=0"/>
   </div>
   </noscript>
<?php
}

Share:

Leave a Reply