Google Ads conversion tracking for WooCommerce – How to setup?

Learn to setup Google Ads conversion tracking for WooCommerce purchases using Google Tag Manager and GTM4WP.

Easy task at first glance

Setting up conversion tracking does not seem to be a complicated task. You create your conversion tag in the ad management platform, you usually get some unique IDs. A new tag here, a pageview trigger with your “thank you” page URL there and you are all set up. Easy, isn’t it?

Well, that might be the case for many conversion events but not in your WooCommerce shop if you setup your Google Ads conversion tracking code. Let’s have a look at the Google Ads (AdWords) conversion tag options in Google Tag Manager back in 2014:

Google Ads (AdWords) conversion tag in 2014

Conversion ID and label is generated by Google Ads itself. You might have one challenge with adding the end total value of the order. Now open your Google Tag Manager container for editing and add a Google Ads Conversion Tag. You will see something like this:

Google Ads (AdWords) conversion tag in 2021

And then you just look at the options and you feel like this:

Confused by the new options?

But no worries: this article will guide you through these new options. It will show you how to setup your Google Ads conversion tracking in your WooCommerce shop with Google Tag Manager and GTM4WP.

Ingredients to setup Google Ads conversion tracking

Allow me to save some text from this content and jump straight to the tag setup. Before that, you will need to go through some steps:

Step 1: add your Google Ads conversion tracking tag

I assume this is not the first time you add a tag into your container so I will skip showing you how to select the proper tag type and explain the first parameters:

Google Ads conversion ID and conversion label
  • Conversion ID: this ID is unique to your Google Ads account. Whenever you create a new conversion tracking code or a remarketing tag in the same account, the conversion ID will be the same. This is why I usually advise to save this ID into a “Constant” type variable so that it can be easily reused in your container
  • Conversion Label: this is unique to the tracking tag so this does not need to be stored in a variable, you can enter it directly into the input field.

Step 2: enter purchase related variables

Now here comes the magic: if you imported the GA4 container template as mentioned before, you will already have the proper Google Tag Manager variables to select into the next 3 input fields. This is why enhanced ecommerce data is so valuable: you can grab ecommerce data in a unified way that is actually independent of the site or the ecommerce platform.

Google Ads Conversion Value, Order ID and Currency Code parameters
  • Conversion Value: this should be the total revenue of your order. It will be stored in the data layer in the ecommerce.value key. The {{Ecommerce Value}} variable shown on the image already reads this data layer variable for you. It will be available once you imported the GA4 container template
  • Transaction ID: this parameter is useful to de-duplicate conversion values in Google Ads and prevent tracking of the same order multiple times. It is also a mandatory element to use conversion adjustments to make sure Google Ads can optimize bids towards your ROI goals and not the net revenue. This parameter is stored in the data layer variable ecommerce.transaction_id but you can simply select {{Ecommerce Transaction ID}} from the variable list
  • Currency Code: if I were the maintainer of this tag template, I would move this line above transaction ID as it is more connected to the conversion value. If you have a webshop where customers can buy your products in different currencies, it is important to let Google Ads know what currency should be used when calculating actual conversion value. This parameter is stored in the data layer variable ecommerce.currency but you can simply select {{Ecommerce Currency}} from the variable list

Step 3: Provide product-level sales data (optional)

Though this step is not mandatory for your Google Ads conversion tracking to work, it is not hard to setup and gives you additional reports in Google Ads. If you setup conversion reporting with cart data, you can better understand what product ads drove sales to different products on your site.

After putting a check mark into the “Provide product-level sales data” box, additional parameters show up:

google ads adwords provide product level sales data
  • Data Source: select “Custom Fields”
  • Merchant ID: enter your Google Merchant Center ID. If you open your GMC account, you can locate this ID at the top of the page, in the account selector dropdown, next to the name of your GMC account
  • Feed Country: the country associated with the feed where your items are uploaded. You need to use territory codes found in this XML file
  • Feed Language: the language associated with the feed where your items are uploaded. You should use ISO-639-1 codes
  • Discount: this should be the total amount of discount in the order. I will show you how to fill in this fields below this list
  • Items: this includes the product IDs, prices and quantities in the cart. Fortunately, the format of this data is exactly the same as the product data in GA4 ecommerce therefore you only need to select the GTM variable {{Ecommerce Items}}

Providing the total amount of discount is the only challenge. Here you need to do some more steps:

  • Open GTM4WP plugin settings page and go to Integration->WooCommerce
  • Locate the “Order data in data layer” option and turn it on if it is currently turned off. This will add some more data into the data layer that has nothing to do with enhanced ecommerce tracking. This option is for any other use case. In our case we will use this to easily get the total amount of discount in the order

Now go back to your Google Tag Manager container and open the Variables section, then start creating a new variable:

Create a new variable in Google Tag Manager
  • From the list of variable types select “Data Layer Variable”, then enter this value into the “Data Layer Variable Name” field: orderData.totals.total_discount
  • You may want to enter a default value to make sure this is set to 0 in case the discount value is missing for some reason
Create the Order Total Discount variable

Save this new variable, go back to your Google Ads conversion tag and select it in the “Discount” field

Step 3: Provide new customer data (optional)

This step is optional as well but with GTM4WP v1.4 or newer it is super easy to use and gives you additional advantages in your Shopping campaigns. With that, you can set your Smart Shopping campaign to focus on new customer acquisition. To make this work, you can enter an additional value in your campaign settings to have a different (higher) value for new customers in your webshop.

Turning on new customer data in your Google Ads conversion tag.

There are only two very easy steps to use this feature: turn on the checkbox and select “Data Layer” from the “Data Source” drop down. That’s it, you are all set!

Step 4: Provide shipping data (optional, currently US only)

This option is currently only useful if you are advertising in USA. Here you have the opportunity to show in your Shopping ads that you are able to ship the products fast and free of charge. You can validate your shipping settings through the Google Ads conversion tag in GTM.

Provide shipping data for your Google Ads conversion tag
  • Shipping Postal Code: here you need to enter the zip code in the order where goods will be shipped to. See the steps bellow the image
  • Shipping Country: enter the country where the goods will be shipped to. See steps bellow the image
  • Estimated Delivery Data: this is the trickiest data you need to provide. This value is not present in the data layer. To provide this data, most probably you will need to create some additional JavaScript codes in your GTM container to calculate the date based on various factors
  • Shipping Cost: enter the amount your customer needs to pay for the shipment. See the setup steps below the image

To be able to fill in postal code, country and shipping cost, you will need to create 3 more GTM variables. Make sure you turned on the “Order Data in the data layer” option as described in step 3. There you can also see how to start creating a new GTM variable with the type “Data Layer Variable”.

You will need to go through this 3 times, each time with a different data layer variable name:

  • Shipping Postal Code: orderData.customer.shipping.postcode
  • Shipping Country:
  • Shipping Cost: orderData.totals.shipping_total

After creating this 3 new GTM variables, open your Google Ads conversion tag again and enter them into the corresponding input boxes.

Step 4: Enable Restricted Data Processing if necessary

This option is mandatory if you are required to comply with the California Consumer Privacy Act (CCPA). Google Ads can change how data is sent and processed based on this value. Unfortunately, there is no one way to set this value, it is usually dependent on the consent banner on your site and the options you show to your visitors. Each consent banner stores consent states in different 1st party cookies therefore I cannot give you one solution that will work with all consent management platform.

Step 5: Add the purchase trigger

You might already have this trigger in your container, thus check it before creating a duplicate instance.

The trigger should be created with the type: Custom Event and the name of the event should be: purchase

Create a purchase trigger for your Google Ads conversion tag

Google Ads conversion tracking is easy to setup

Though not all options are available immediately, most of them can be setup very quickly and without programming knowledge. Delivery time is one exception but hopefully you will have someone to help with that too.