Google Remarketing code not working in DTM

nicola_tincknel

15-10-2015

Hi,

 

I have implemented the following third party code into page load rules in DTM:

<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 971225648;
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/971225648/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

It only recognises it as Non-Sequential HTML, however.

When debugging the site, it show's up as red and an unhappy face so I'm assuming it's not working. (sorry I'm new to this!)

 

Any advise would be hugely appreciated.

 

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

ParitMittal

30-08-2016

Hi Al,

It should be very do-able.

it is notable that they have different code is you want to deploy it async

instead of "//www.googleadservices.com/pagead/conversion.js" you have to call "//www.googleadservices.com/pagead/conversion_async.js"

and then do some magic to make sure that file loads before you reference it

Please add the following code "Non Sequential JS" Third Party Tag

var dcJS = document.createElement('SCRIPT'); var done = false; dcJS.setAttribute('src', '//www.googleadservices.com/pagead/conversion_async.js'); dcJS.setAttribute('type','text/javascript'); document.body.appendChild(dcJS); dcJS.onload = dcJS.onreadystatechange = function () { if(!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { done = true; callback(); // Handle memory leak in IE dcJS.onload = dcJS.onreadystatechange = null; document.body.removeChild(dcJS); } }; function callback(){ if(done){ /* <![CDATA[ */ window.google_trackConversion({ google_conversion_id : XXXXXXX, google_custom_params : window.google_tag_params, google_remarketing_only : true }); //]]> } }

Thanks & Regards

Parit Mittal

Answers (8)

Answers (8)

ald42885741

30-08-2016

I am also having the same issue. Did anyone get the Google Remarketing tag to play nicely with Adobe DTM? Or is the conclusion that Google Remarketing tag should be implemented separately outside of DTM?

Thanks,

Al

Rahsing

15-10-2015

Thanks! I can see them now. Let me look at it and get back to you.

Just as a first point of check, shouldn't you be commenting out the text on line 13?

just put '/*' before the line and '*/' after it and check if that works.

Kindly revert if the problem persists (I'll look to see if I can find anything else).

Regards

Rahul

nicola_tincknel

15-10-2015

Here's the screenshot of the error, it suggests there's a missing <script> tag.

 

Displaying image.png

 

 

Inline images 2

 

 

And this is a screen shot of the rule I've set up in DTM:

 

Displaying image.png

and this is the error i see when trying to change it to java-script:

Displaying image.png

 

Thanks

Nicola