Woo Commerce is the widely used theme for building eCommerce platform in wordpress. Sometimes it is required to track leads on how many users purchased/checkout the goods using Google AdServices. Here, I will provide a simple script which can be added to functions.php to add the google script to your WooCommerce theme.
Here woocommerce_thankyou is a function for Woo Commerce to add to the thank you page and google_conversion_tracking is the callback function for that. You need to create a google ad account to get the tracking codes like conversion id and label. Once you have that, change the places in the code with your id and conversion label. You are done :).
Check with the tracking dashboard on google apps.
For any new addition or modification, please feel free to knock Devkinz: