How to setup Google Ads Dynamic Remarketing for WooCommerce?

Google Ads Dynamic Remarketing is an advanced way to engage with visitors and customers of your eCommerce shop. In this scenario you can leverage precise behaviour data sent to Google Ads to target your audience with personalised ads maximising conversion rates.

Prerequisites

This setup is more complex and involve additional integrations. Before starting implementing Google Ads Dynamic Remarketing GTM Preset ensure that you are ready with following:

Google Product Feed integration

In order to serve dynamic, personalised product ads you need to synchronise your WooCommerce listings with Google Product Feed. There are different solutions to perform this integration but one to consider is to use a 3rd party plugin called WooCommerce Google Product Feed. Before proceeding ensure that you have your products loaded into Google Product Feed and you know what is the ID of those products. This will be key in the 1st step of the guide below.

Ability to add custom PHP code

Google Tag Manager for WooCommerce can be extended and customised with simple PHP snippets that needs to be pasted in functions.php file of your WordPress theme. This is a common approach of modifying and adjusting themes and plugins in WordPress and WooCommerce ecosystem. It allows to keep changes under control and makes it easy to test them in staging environment. That said it requires minimal technical knowledge and write access to the file, either through (S)FTP or WP-Admin.

Steps

Here are 5 steps that needs to be performed to get Google Ads Dynamic Remarketing setup up and live.

1. Adjust tracking parameters

As mentioned before Dynamic Remarketing requires getting WooCommerce products loaded into Google Product Feed - when products are loaded they are assigned a given ID - some popular WooCommerce plugins providing this functionality prepends the WooCommerce ID with a custom prefix. This is why an adjustment in tracking needs to happen. Additionally, Google Ads requires additional tracking parameter called "google_business_vertical" to be present on tracked products.

Both of those required changes are covered by this PHP snippet.

add_filter("gtm_ecommerce_woo_item", function($item, $product) {
    $item->setExtraProperty("google_business_vertical", "retail");
    $item->setItemId("woocommerce_gpf_" . $product->get_id());
    
    // Alternatively use the line below to include product SKU instead of WooCommerce ID
    // $item->setItemId("woocommerce_gpf_" . $product->get_sku());
    return $item;
}, 10, 2);

Review it, adjust the code and save it to your active theme functions.php file.

IMPORTANT: While the extra property is a backwards compatible change, switching the item_id may affect your existing integrations and reporting.

2. Configure and obtain audience source Conversion ID

Once your changes in PHP are done, not it's time to obtain the Conversion ID that will allow to send data to Google Ads and build custom audiences there.

First navigate to Audience Manager. You can find it in Tools and Settings > Shared Library:

In Audience Manager select Your data sources and Google Ads tag. At the bottom of that screen find "Tag setup" section and select "Use Google Tag Manager":

It will open up another section with Conversion ID. Copy this value.

3. Install GTM Preset

With Conversion ID now it's time to import the Google Ads Dynamic Remarketing preset. Please follow the general guide here.

Don't publish the preset yet.

4. Set the Conversion ID

Once preset is imported, before publishing it find Variable called "Google Ads Dynamic Remarketing Conversion ID". Open it:

Edit the value of this Constant Variable and past the Conversion ID obtained in step 2 above.

Save the changes.

5. Publish the preset

Review the GTM workspace. By default the remarketing tag is triggered by ecommerce events prior to purchase, you can adjust it now.

Once you are good you can publish your changes.

If other elements of you setup are correct (including synchronisation to Google Product Feed) you should be able to create and launch Dynamic Remarketing campaigns.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.