AdWords
6.3K members online now
6.3K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

How to implement a Dynamic Remarketing Tag with GTM?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
Hi everybody,
 
I need your help to set up my first remarketing tag using Google Tag Manager.
I already started the process on Adwords and I have received 2 emails form them: one to help me to create my feed, the other one to help me to implement my tag.
 
What is ready ?
I already have my feed ready.
I have already tag all the pages of my website.
 
I need now to include the custom parameters in my tag (I tried to follow email instructions I received form adwords, a copy of this email is just below)
 

Include custom parameters in your tag

To enable the dynamic creative and bid optimization, include the required parameters in your tag. For proper setup, it's important to follow the specified naming convention for all parameters; otherwise, your site visitors might not be added to your lists and your dynamic remarketing campaigns might not run properly.
For custom business types include these required parameters in your tag: item ID (dynx_itemid), page type (dynx_pagetype). Additionally, the item ID you place in the "dynx_itemid" must match the ID from your feed.
To help you verify that the above IDs match the items in your feed, we've provided 10 sample IDs and corresponding URLs from your feed in this email that you can use to verify your tag setup. Your webmaster might find these examples useful.
There are also optional custom parameters you can include in your tag to fine tune your campaign and drive campaign performance even further - check this article for more details. For a complete list of custom parameters, visit the Google Developers codesite.
 
 
Here my Remarketing Tag ( I received from Google as well)
 
<!-- Google Code for Remarketing Tag -->
<!--------------------------------------------------
Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
--------------------------------------------------->
<script type="text/javascript">
var google_tag_params = {
dynx_itemid: 'REPLACE_WITH_VALUE',
dynx_itemid2: 'REPLACE_WITH_VALUE',
dynx_pagetype: 'REPLACE_WITH_VALUE',
dynx_totalvalue: 'REPLACE_WITH_VALUE',
};
</script>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 962293753;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/962293753/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
 
Because I use the Google Tag manager, do I need to use it this code like that?
On this page, I have found a process to do it with Google Tag Manager >> LINK
I tried to do the "Single Remarketing Tag" option >> LINK
I got stuck a the first step (Step 1: Create Custom HTML Tag) because of the Javascript code given on this step which is:
 
<script>
(function(){
 try {
  if ( /* Insert JS expression to test for product page here */ ) {
   var prodid, totalvalue;
   /*
    Insert custom JS code to extract value of
    prodid and totalvalue from current document
   */
   dataLayer.push({
    'event': 'fireRemarketingTag',
    'google_tag_params': {
      'ecomm_prodid': prodid,
      'ecomm_pagetype': 'product',
      'ecomm_totalvalue': totalvalue
    }
   });
  }
  else if ( /* Insert JS expression to test for cart page */ ) {
   var prodid, totalvalue;
   /*
    Insert custom JS code to extract value of
    prodid and totalvalue from current document
   */
   dataLayer.push({
    'event': 'fireRemarketingTag',
    'google_tag_params': {
      'ecomm_prodid': prodid,
      'ecomm_pagetype': 'cart',
      'ecomm_totalvalue': totalvalue
    }
   });
  }
  else if ( /* Insert JS expression to test for purchase page */ ) {
   var prodid, totalvalue;
   /*
    Insert custom JS code to extract value of
    prodid and totalvalue from current document
   */
   dataLayer.push({
    'event': 'fireRemarketingTag',
    'google_tag_params': {
      'ecomm_prodid': prodid,
      'ecomm_pagetype': 'purchase',
      'ecomm_totalvalue': totalvalue
    }
   });
  }
  else {
   dataLayer.push({
    'event': 'fireRemarketingTag',
    'google_tag_params': { }
   });
  }
 }
 catch (err) {}
}) ();
</script>
 
 
How can I costum it with the information from my remarketing tag and my feed ?
What is a DOM (step 1 as well) ?
How can I create a DOM ?
 
Thanks everyone,
Monika
1 Expert replyverified_user

Re: How to implement a Dynamic Remarketing Tag with GTM?

Top Contributor
# 2
Top Contributor

Hi Monika,

 

Welcome to AdWords Community.

 

There are two ways to do it, either by using data layers or by exacting IDs from the page using Javscripts. 

 

The detailed documentation for code implementation with GTM is here - https://support.google.com/tagmanager/answer/3002580?hl=en#OneTagPerFunnel

 

Thanks
Ratan Jha

Re: How to implement a Dynamic Remarketing Tag with GTM?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Ratan-Jha,

Yes this is the link I already gave you Smiley Wink

I tried to do the "Single Remarketing Tag" option >> LINK
I got stuck a the first step (Step 1: Create Custom HTML Tag) because of the Javascript code given on this step which is:

&lt;script&gt;
(function(){
try {
if ( /* Insert JS expression to test for product page here */ ) {
var prodid, totalvalue;
/*
Insert custom JS code to extract value of
prodid and totalvalue from current document
*/
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': {
'ecomm_prodid': prodid,
'ecomm_pagetype': 'product',
'ecomm_totalvalue': totalvalue
}
});
}
else if ( /* Insert JS expression to test for cart page */ ) {
var prodid, totalvalue;
/*
Insert custom JS code to extract value of
prodid and totalvalue from current document
*/
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': {
'ecomm_prodid': prodid,
'ecomm_pagetype': 'cart',
'ecomm_totalvalue': totalvalue
}
});
}
else if ( /* Insert JS expression to test for purchase page */ ) {
var prodid, totalvalue;
/*
Insert custom JS code to extract value of
prodid and totalvalue from current document
*/
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': {
'ecomm_prodid': prodid,
'ecomm_pagetype': 'purchase',
'ecomm_totalvalue': totalvalue
}
});
}
else {
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': { }
});
}
}
catch (err) {}
}) ();
&lt;/script&gt;


How can I costum it with the information from my remarketing tag and my feed ?
What is a DOM (step 1 as well) ?
How can I create a DOM ?
Marked as Best Answer.
Solution
Accepted by topic author Monika G
September 2015

Re: How to implement a Dynamic Remarketing Tag with GTM?

Top Contributor
# 4
Top Contributor

Hi Monika,

 

It's a bit more technical. If you are not already aware about DOM, it is going to difficult for you to implement it. I would advise you to connect with your website developer. 

 

DOM  stands for Document Object Model which is a programming interface for languages like HTML, XML etc. documents. To make it even clear for you - when a HTML document is loaded into browsers, it becomes a document object

 

Anyway, let's leave that definition. To implement custom parameters with your dynamic remarekting code with GTM, you will need  to use custom JS code which will be extracting values of respective customer parameters like prodid and totalvalue on every page. Now, this custom JS code would depend more on your website's current structure. Where are those IDs shown on pages? In URL? Anywhere else?

 

The JS will extract ID from those places and will put in the custom parameter field. Yes, it should match with your feed as well.

 

I told you, it's going to be technical Smiley Tongue .  The best approach would be to contact your website developer for such implementations. He will need to write a piece of JS depending on your website's structure.

 

Thanks
Ratan Jha

 

Re: How to implement a Dynamic Remarketing Tag with GTM?

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Ratan-Jha,

 

Thanks a lot for your answer.
I thought that GMT was excellent to not go through your developers team when you can understand code and you're ready muck it in...
but it seems I was wrong !

 

I also found this >> LINK

Imagine I have a product page. If I understood you well, this means the the id of the product can be found on CORS9 content ? It can be an url, a html tag... but it can be find on my website ?

var google_tag_params = { 
  dynx_itemid
: 'CORS9'
};

 

The next code is correct because it can be found on product page ?

var google_tag_params = { 
  dynx_pagetype
: 'offerdetail'
};

 

And how can I complete totalvalue, because it depends on the product page ?

var google_tag_params = { 
  dynx_totalvalue
: 30
};

Re: How to implement a Dynamic Remarketing Tag with GTM?

Top Contributor
# 6
Top Contributor

Hi Monika,

 

GTM is a very helpful tool indeed. Implementing custom parameters needs almost an equal level of technical exposure even when you do it outside GTM. 

 

Yes, that ID (e.g. CORS9 in example) should be available anywhere on the page. It may be in URL, any html tag, etc. Then, you will need JS code to extract it and put it into dynx_itemid: '' field on all product pages. Every product page will have a unique product ID, as submitted with the feed. 

 

Product ID and Total Value are not required on homepage and on category pages. It is required only on product pages. 

 

Thanks
Ratan Jha

Re: How to implement a Dynamic Remarketing Tag with GTM?

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Ratan-Jha,

Oooooh great ! Thanks a lot for your help !

Monika