Setting up Dynamic Remarketing via Google Tag Manager

In this article, you will learn to set up dynamic remarketing in Google Analytics and Google Ads via Google Tag Manager.

This article is in conjunction with the article: Guide to Dynamic remarketing in Google Analytics & Google Ads where I introduced the concept of dynamic remarketing and how it can be implemented without using Google Tag Manager.

I would suggest you read this article first (if you have not already) to get the most out of the current article. I won’t be explaining the very basics of dynamic remarketing in the present article.

The whole process of setting up dynamic remarketing is quite complicated. It is probably the second most difficult tracking implementation in GA. The number one is, of course, enhanced ecommerce tracking set up.

There is no one switch available which I can show you, that you can just turn on, and boom dynamic remarketing is all set up and ready to go.

In order to make this whole process of setting up dynamic remarketing easier to understand, I have broken down the implementation process into the following 15 stages:

  1. Identify your remarketing audiences
  2. Identify your industry vertical and industry attributes
  3. Identify all the data points for dynamic remarketing
  4. Enable Remarketing in Google Analytics
  5. Link Google Analytics to Google Ads
  6. Setup Google Merchant Center account
  7. Publish Product data feed
  8. Link Google Merchant Center to Google Ads
  9. Push attributes of viewed products into the data layer
  10. Pull attributes of viewed products from data layer into Google Tag Manager
  11. Send attributes of viewed products from GTM to Google Analytics
  12. Create dynamic remarketing audiences in Google Analytics
  13. Send attributes of viewed products from Google Analytics to Google Ads
  14. Create and run Dynamic Remarketing campaigns in Google Ads
  15. Setting up Dynamic Remarketing using Google Ads Remarketing Tag (optional)

Get the E-Book (62 Pages)

#1 Identify your remarketing audiences

You can retarget the people: who abandoned the checkout, who abandoned the basket and/or who abandoned any other shopping activity. You can also retarget audiences for other important events based on your website objectives (non-ecommerce events such as lead form submitted or sign up) or any conversion events for your website.

You can retarget repeat customers, new customers or prospects. Among repeat customers, you can individually re-target high value and low-value repeat customers. Likewise among new customers, you can individually re-target high value and low-value new customers.

In fact, in the article 100+ Google Analytics Remarketing audiences for Retargeting, I outlined more than 100 different ways to remarket to your target audience.

Identifying a remarketing audience is important as dynamic remarketing setup varies from audience to audience.

So, before you set up dynamic remarketing (which is basically a dynamic version of remarketing), you need to clearly define your most important remarketing audiences.

Users who abandoned the checkout will always be one of your most important remarketing audience because of their highest propensity of making a purchase in subsequent sessions (if correctly remarketed)

#2 Identify your industry vertical and industry attributes

Identify the industry vertical (like travel, finance, education, etc) that best describe the products/services you offer. Identifying industry vertical is important as dynamic remarketing setup varies from industry to industry.

Available industry verticals are as below.

  1. Retail vertical – retail refers to the activity of selling goods or services directly to consumers or end-users.
  2. Education vertical – education refers to the institutions which facilitating learning, or the acquisition of knowledge, skills, values, morals, beliefs, and habits. Educational methods include teaching, training, storytelling, discussion and directed research.
  3. Flights vertical – all website which facilities online flight booking services
  4. Hotels and rentals vertical – hotel booking websites.
  5. Jobs vertical – job listing websites.
  6. Local vertical – websites which provide local services.
  7. Real estate vertical – websites which provide services related to real estate e.g. sale or rental of properties.
  8. Travel vertical – websites which provide travel-related services.
  9. Custom vertical – if your website doesn’t come under any of the verticals mentioned above, you can create your own custom vertical.

Once you have identified your industry vertical, you then need to identify your industry attributes.

For example, if you work in the retail industry then the attributes for your industry (in the context of Dynamic Remarketing) would be product ID, product category page, product detail page, product price, etc.

Similarly, if you work in the Real estate industry then the attributes for your industry (in the context of Dynamic Remarketing) would be listing ID, listing page type, etc.

To get the list of required and optional attributes for your industry vertical  follow the steps below:

Step-1: Visit this page: https://support.google.com/analytics/answer/3455600?hl=en

Step-2: Scroll down and click on the relevant drop-down menu in the section ‘Add Attributes for your Vertical’:

Here, ecomm_prodid, ecomm_pagetype and ecomm_totalvalue are attributes of the products viewed on your ecommerce website.

ecomm_prodid – represents product id. You can send more than one product ID to Google Analytics.

ecomm_pagetype – represents type of page visited by a user: home page, search result page, product category page, product detail page, shopping cart page, checkout page etc

ecomm_totalvalue – represents value of the viewed product(s).

The list of verticals and the list of attributes listed in the Google documentation are just examples.

You can implement dynamic remarketing for any type of business or industry vertical, whether or not the industry vertical is listed in the Google documentation. Likewise, you can use attributes for your industry vertical in addition to the one listed in the Google documentation.

In fact, there are two categories of remarketing attributes:

#1 Standard remarketing attributes like ecomm_prodid, ecomm_pagetype and ecomm_totalvalue

#2 Non-Standard remarketing attributes which are additional attributes you want to pass to Google Analytics like: loggedIn_users, members, nonMembers, highValue_customers etc.

The number and type of attributes that you use will depend upon your re-marketing audience and website navigation structure.

Note: I have written this article under the assumption that your industry is retail. I picked up this industry as it is one of the most common industry vertical. But my article is equally valid for any other industry.

#3 Identify all the data points for dynamic remarketing

Identify all the web pages and web page elements to which you are going to add the data layer code for dynamic remarketing.

The web pages for dynamic remarketing could be:

  • Product detail pages
  • Shopping cart page
  • Checkout page
  • Funnel step pages

Note: home page, product category pages and search result pages are not a good candidate for dynamic remarketing as you can’t do precise retargeting with dynamic remarketing ads.

The web page elements for dynamic remarketing could be:

  • Add to cart button
  • Checkout button
  • Remove from cart button
  • Calculate shipping button
  • Apply coupon code button
  • Proceed to next checkout step buttons

Identifying all the web pages and web page elements in advance for dynamic remarketing will help you in understanding the scope of the work.

#4 Enable Remarketing in Google Analytics

To enable remarketing and advertising reporting features in Google Analytics you need to include Demographics and Interest Reports, remarketing with Google Analytics, and also carry out the steps below:

Step-1: Login to your Google Tag Manager account and click on the ‘Variables Tab’

Step-2: Under ‘User-defined variables’ select your Google Analytics settings variable.

Step-3: Click on the pencil icon to edit the variable configuration.

Step-4: Click on ‘More settings’.

A list will populate with additional settings.

Step-5: Now Click on ‘Advertising’.

Step-6: Select the checkbox named ‘Enable Display Advertising Features’.

Step-7: Click on ‘Save’.

Step-8: Now navigate to the ‘Tags’ tab in GTM and select the tag which uses the settings variable to deploy Google Analytics tracking code on your website.

Step-9: Now click on the ‘Enable overriding settings in this tag’ checkbox and then click on ‘More settings’.

Step-10: Click on ‘Advertising’.

Step-11: Select ‘Inherit from settings variable’.

And then click on ‘Save’ to save the configuration.

Alternatively, if you have done a lot of customization in your Google Analytics Tracking code like me and you use a custom HTML tag to deploy Google Analytics tracking code on your website then you need to add the following line of code to your Google Analytics tracking code:

ga(‘require’, ‘displayfeatures’);

Your final code may look like the one below:

#5 Link Google Analytics to Google Ads

Linking your Google Analytics account to your Google Ads account is pretty straightforward. Follow the below steps to start the linking.

Step-1: Sign in to your Google Analytics property and click on ‘Admin’.

Step-2: Under the ‘Property’ column, click on ‘Google Ads Linking’.

Step-3: Click on ‘+New Link Group’.

Step-4: It will automatically fetch your Google Ads account (with the same Google ID). Select the account and click on ‘Continue’.

Step-5: Now under ‘Linking configuration’, provide a name in the input box ‘Link group title’ and then switch the toggle button to ‘On’ for all web site data and then click on ‘Link Accounts’.

Congratulations! Your accounts are now linked.

It is important that you link the two accounts so that later you can use dynamic remarketing audiences of Google Analytics in Google Ads.

#6 Setup Google Merchant Center account

More details about the merchant account setup can be found here: https://support.google.com/merchants/answer/188924?hl=en&ref_topic=3163841

#7 Publish Product data feed

Google uses a product data feed from your Merchant account to create dynamic remarketing ads. So it is critical that you have got a Google Merchant Center account with a live product data feed.

Product data feed is a text or XML file which stores all of the information about your products.

Without Google Merchant Center account and live product data feed, you can’t set up and run dynamic remarketing.

Following steps are involved in publishing a product data feed:

  1. Create your product feed according to feed specifications and Google Shopping Policies.
  2. Register your feed
  3. Upload your feed
  4. Troubleshoot your feed

#8 Link Google Merchant Center to Google Ads

Link your Google Merchant Center Account to your Google Ads account. More details about such integration can be found here: https://support.google.com/merchants/answer/6159060?hl=en

This integration is required so that Google Ads can use the product data feed from the Merchant account to create dynamic ads.

#9 Push attributes of viewed products into the data layer

In dynamic remarketing, we retarget users with ads of the product(s) they viewed on your website.

Now in order to accomplish this task, we need to capture attributes (like product ID, product price) of viewed products from your website.

There are two ways of capturing viewed products’ attributes:

#1 Push the attributes of viewed products into data layer

#2 Use Google Tag Manager to capture the attributes via custom JavaScript variables.

Using custom JavaScript variables to capture the attributes of viewed products is a shaky implementation.

This is because when you use custom JavaScript variables, your tracking depends upon the HTML DOM. Any change in the DOM structure can easily break your tracking.

Therefore, we are going to use data layers to capture attributes of viewed products.

Depending upon the size of your website and level of customization your CMS offer (through templates), you may have to create and hardcode a lot of data layers to your web pages and web page elements for dynamic remarketing setup.

Add the following data layers to all the webpages which list the products you want to retarget via dynamic remarketing:

<script>
var dataLayer = [];
dataLayer.push({
‘ecomm_prodid’:’[product_id]‘,
‘ecomm_pagetype’ : ‘[page_type]‘,
‘ecomm_totalvalue’ : [product_price]
});
</script>

Make sure that you add this data layer immediately above the GTM container code.

[product_id], [page_type] and [product_price] are server variables which retrieves product id, page type and product price from a page.

The page can be a product detail page, shopping cart page, checkout page and/or one of the funnel step pages.

In case you need to capture attributes for multiple viewed products, use an array.

For example, if a user has added two products in his shopping cart then on the checkout page, your data layer should look like the one below:

<script>
var dataLayer = [];
dataLayer.push({
‘ecomm_prodid’:'[<product_id1>,<product_id2>]‘,
‘ecomm_pagetype’ : ‘<page_type>‘,
‘ecomm_totalvalue’ : <total_value>
});
</script>

Here,

[<product_id1>,<product_id2>] is an array of the ids of the products added to the shopping cart.

<product_id1>,<product_id2>, <page_type> and <total_value> are all server variables.

The server variable <total_value> retrieves the total value of the products added to the shopping cart.

You can add a data layer code to a web page element like ‘Add to cart’ button through a JavaScript event handler like ‘onClick’. For example:

onClick=”dataLayer.push({‘ecomm_prodid’:’[product_id]‘,’ecomm_pagetype’ : ‘[page_type]‘,’ecomm_totalvalue’ : [product_price]});

#10 Pull attributes of viewed products from data layer into Google Tag Manager

In order to pull attributes of viewed products from data layers, you need to create one data layer variable for each attribute of a viewed product you want to capture.

For example, if you are capturing the 3 standard attributes (ecomm_prodid, ecomm_pagetype and ecomm_totalvalue) of viewed products then you need to create the following three data layer variables in Google Tag Manager:

#11 Send attributes of viewed products from GTM to Google Analytics

In order to send attributes of viewed products from Google Tag Manager to Google Analytics, you need to create one custom dimension for each attribute of a viewed product you want to capture.

For example, if you are capturing the three standard attributes (ecomm_prodid, ecomm_pagetype and ecomm_totalvalue) of viewed products then you need to create three custom dimensions.

There are two steps involved in creating custom dimensions:

  1. Create custom dimensions in your Google Analytics property.
  2. Modify your Google Analytics tracking code.

Create the following three custom dimensions in Google Analytics via the admin section:

custom dimensions GA

You can learn more about creating custom dimensions in Google Analytics from this article: https://support.google.com/analytics/answer/2709829#set_up_custom_dimensions

Now, login to your Google Tag Manager account and edit the tag you used to deploy Google Analytics tracking code on your website.

Add the following three custom dimensions to the tag:

Your final configuration should look like the one below:

You can learn more about creating custom dimensions in Google Tag Manager from this article: https://support.google.com/analytics/answer/6164990?hl=en

#12 Create dynamic remarketing audiences in Google Analytics

You need to create dynamic remarketing audiences in Google Analytics so that later you can use them while creating dynamic remarketing campaigns in Google Ads.

Import the following four dynamic remarketing audiences for retail vertical in Google Analytics: ‘Cart viewers’, ‘General Visitors’, ‘Product Viewers’ and ‘Purchasers’:

dynamic remarketing audiences examples

I have explained importing dynamic remarketing audiences in great detail in the article: Guide to Dynamic remarketing in Google Analytics and Google Ads

#13 Send attributes of viewed products from Google Analytics to Google Ads

You need to create Dynamic Attributes in Google Analytics in order to send the attributes of the viewed products to Google Ads. Create one dynamic attribute for each attribute of the viewed product you want to capture.

So if you are capturing the three standard attributes of viewed products then you need to create the following three dynamic attributes in Google Analytics:

I have explained creating dynamic attributes in great detail in the article: Guide to Dynamic remarketing in Google Analytics and Google Ads

#14 Create and run Dynamic Remarketing campaigns in Google Ads

Step-1: Login to your Google Ads account and create a new ‘Display Network Only’ campaign of type ‘Remarketing’

Step-2: Under ‘Targeting’, select ‘Manual targeting’.

Step-3: Select your remarketing audience (website visitors, product viewers, etc.)

Step-4: Click on the checkbox named ‘ Use dynamic ads feed for personalised ads ‘, set business type to ‘Retail’.

That’s how you can set up dynamic remarketing in Google Analytics and Google Ads via Google Tag Manager.

Setting up Dynamic Remarketing using Google Ads Remarketing Tag (optional)

In Google documentation on setting up dynamic remarketing via GTM, you will see Google Ads remarketing tag being used.

The data layer variables for each attribute of the viewed products are sent from GTM to Google Ads via custom parameters:

Though this method is easier to implement, I did not use this method because I use dynamic remarketing audiences from Google Analytics for creating dynamic remarketing campaigns in Google Ads as they are based on the GA data.

Also, in this way, I can reuse dynamic remarketing audiences for other purposes.

However, if you want to use your Google Ads Remarketing Tag for setting up dynamic remarketing then check out this article: https://support.google.com/tagmanager/answer/6106009

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!