11 months ago Lion KingParticipant
How to Insert Google Ads Conversion Tracking to Woocommerce.
Quick ‘How to’ today for something very important that should be done by every site owner who also uses Google Ads.
I was a bit surprised recently to see that there is no ‘click and connect’ solution made by Google Ads for Woocommerce as I was looking for a simple way to explain to a client. This seems very odd.
A little reminder : conversion tracking allows you to track every time a user buys something from your shop and understand his behavior.
It will help understand what drove him here and how much this cost you in advertising.
This is crucial to calculate your ROI (Return On Investment), basically, what this sale cost you.
You will also be able to use the smart bidding functionality offered by Google that will automatically improve your conversion rates and cost.
This then helps you optimize your campaigns and create more campaigns with the right information.
I have seen several site owners spending a lot of money on Google Ads without having this on their website, most of the time this means throwing money by the window !
Another quick tip related to Google merchant center : make sure you only advertise products in stock !! This is a major issue too less considered, you cannot convert if you cannot sell the product !
Back at it now. Here is the process for tracking conversion with Woocommerce.
1. Get your code from Google
To do that you need to go to your Google Ads account, in the top menu bar, click on tools, then on conversion.
You will then get the list of your conversions. If you have not created one yet you will have to create a conversion, you can call it “woocommerce sale” for example.
Next, you will have to click on this conversion and go to the step “Configuring tags”, and then select “configuring yourself”.
On the new page, you have to go to the bottom to “Event snippet” and you will see the code you need to insert to your Woocommerce. Copy this code
You should have something like this :
2. Go to your Woocommerce ‘Thank you’ page
To do that you have to go, with your FTP, to the following folder :
And open the page ‘thankyou.php’
3. Insert the code
At the end of this file, you can paste your code like this
You can save now and visit your site to make sure nothing is broken and you did this step correctly. If you get a PHP error just remove the code and check that you did everything right.
4. Change the default conversion value
By default, Google put a static value for your conversion code. In my example, the value is set at 10€, which means that every conversion will come back to Google with a 10€ total order price.
We do not want that since the goal is to calculate the ROI. So we will need to add the dynamic Woocommerce order price.
I order to do that we will need to use $order->get_total()
Here is your final code:
5. Verify that your code is working well.
You can create a test virtual product at 0€ and make an order as a guest.
On the ‘Thank you’ page you can check the page code source and see if the value is correctly showing.
You can also save the URL of this order ‘Thank you’ page and use it to verify the conversion from Google.
To do that you have to go into the conversion list, and click ‘verify’ or ‘debug’ depending on your conversion status.
I hope this helps
Follow the crowd and you be just another cheep.
You must be logged in to reply to this topic.