Setting up Dynamic Remarketing via Google Tag Manager

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

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

I would suggest you to 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 number 2 most difficult tracking implementation in GA. The number 1 is off-course enhanced ecommerce tracking setup.

There is no one switch available which I can show you, that you can just turn on, and boom dynamic remarketing is all setup 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 following 14 stages:

Stage #1: Identify your Remarketing Audiences

Stage #2: Identify your Industry vertical and Industry attributes.

Stage #3: Identify all the data points for dynamic remarketing.

Stage #4: Enable Remarketing in Google Analytics

Stage #5: Link Google Analytics to Google Adwords.

Stage #6: Setup Google Merchant Center account.

Stage #7: Publish Product data feed

Stage #8: Link Google Merchant Center to Google Adwords

Stage #9: Push attributes of viewed products into data layer

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

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

Stage #12: Create dynamic remarketing audiences in Google Analytics.

Stage #13: Send attributes of viewed products from Google Analytics to Google Adwords

Stage #14: Create and run Dynamic Remarketing campaigns in Google Adwords.

#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 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 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.

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:

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

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

add attributes

attributes-retail

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 advanced for dynamic remarketing will help you in understanding the scope of the work.

#4 Enable Remarketing in Google Analytics

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

Select the checkbox named ‘Enable Display Advertising Features’:enable display advertising feature

This step is required to enable remarketing and advertising reporting features in Google Analytics.

Alternatively, if you have done 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 following line of code to your Google Analytics tracking code:

ga(‘require’, ‘displayfeatures’);

So your final code may look like the one below:custom html tag

#5 Link Google Analytics to Google Adwords

Linking your Google Analytics account to your Google Adwords account is pretty straightforward. Check out this article: https://support.google.com/analytics/answer/1033961 if you are not sure.

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

#6 Setup Google Merchant Center account

Watch the video below on setting up your 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 use 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 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 Adwords

Link your Google Merchant Center Account to your Google Adwords 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 Adwords can use product data feed from Merchant account to create dynamic ads.

#9 Push attributes of viewed products into 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 lot of data layers to your web pages and web page elements for dynamic remarketing setup.

Add 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.

Here,

[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 following three data layer variables in Google Tag Manager:data layer variables1

data layer variables2

 

#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 3 standard attributes (ecomm_prodid, ecomm_pagetype and ecomm_totalvalue) of viewed products then you need to create 3 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 following 3 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 following 3 custom dimensions to the tag:

custom dimensions

Your final configuration should look like the one below:

final configuration

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 Adwords.

Import following 4 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 & Adwords

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

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

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

dynamic attributes

new attribute button

dynamic attribute linking

dynamic attributes

dynamic attribute table

I have explained creating dynamic attributes in great detail in the article: Guide to Dynamic remarketing in Google analytics & Adwords

#14 Create and run Dynamic Remarketing campaigns in Google Adwords

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

display network only

remarketing radio button

Step-2: Click on the checkbox named ‘Use Dynamic ads’, set business type to ‘Retail and then click on the ‘Setup Remarketing’ button:

use dynamic ads

Step-3: Click on the ‘Use the Google Analytics tag instead of the Adwords remarketing tag’ checkbox:

send tag instructions

Step-4: Select your Google Merchant center feed , your bid strategy and enter your daily budget:

select product feed

Step-5: Create a new ad group, enter your enhanced CPC bid and then select your remarketing list (i.e. the dynamic remarketing audience imported from Google Analytics):

enhanced CPC

select remarketing list

Step-6: Create your ad template and then run your dynamic remarketing campaign in Google Adwords.

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

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

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

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

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 Adwords as they are based on the GA data.

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

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

Announcement about my new books

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.

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses find and fix their Google Analytics and conversion issues. If you have any questions or comments please contact me.

  • Over eleven years' experience in SEO, PPC and web analytics
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com

I am also the author of three books:

error: Content is protected !!