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&guid=ON&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
Solved! Go to Solution.
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
Hi Nickola,
Could you paste screenshots of the error on your console and your page load rule setup?
Regards
Rahul
Views
Replies
Total Likes
Here's the screenshot of the error, it suggests there's a missing <script> tag.
And this is a screen shot of the rule I've set up in DTM:
and this is the error i see when trying to change it to java-script:
Thanks
Nicola
Views
Replies
Total Likes
Hi Nicola,
I can't see the images. Could you try uploading them again please?
Regards
Rahul
Views
Replies
Total Likes
I've popped them into a google doc (https://docs.google.com/document/d/17B7k8KfadDGSUDHoC1aaaZzems9uUu7NKynjr2kaKYA/edit?usp=sharing)
Can you see them on there?
Thanks so much for having a look- really appreciate :)
Nicola
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Hi Nicola and Rahsing, I'm having the same issue, did you ever solve the problem?
Thanks,
Ron
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Thanks Parit. This solutions seems to be working well.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies