3

A site that I have limited access to, but can run any code on this page after DOM is ready, has synchronous rendering enabled for GTM.

It explicitly executes enableSyncRendering() and also loads the gtm.js itself synchronously (as it is required for enableSyncRendering() to have any effect, according to GTM documentation).

I need to render an ad in this environment asynchronously, after DOM is ready. Is it possible to revert to asynchronous mode? Executing googletag.pubads().enableAsyncRendering(); does not do anything, and does not affect on subsequent code executions.


I prepare a test page that has the same GTM initialization as the website has, and execute commands to render an ad from console after DOM is ready.

The line: googletag.pubads().enableSyncRendering(); appears statically on the page before enableServices();

If I comment out the line an ad is rendered. If I return the line it does not.

The code that I execute:

googletag.cmd.push(function() { 
   googletag.defineSlot('/xxxx/xxx/xx/xxxx/xxxxx', [300, 250], 'div-gpt-ad-xxxxxxxxxxxx-0').addService(googletag.pubads()); 
   googletag.display('div-gpt-ad-xxxxxxxxxxxx-0'); 
   console.log("The ad should have been loaded about... now."); 
});
3
  • This is about GPT, not GTM, right ? Oct 30, 2014 at 13:27
  • Eike Pierstorff, it's about Google Tag Manager, that is used to display GPT.
    – Sych
    Oct 31, 2014 at 19:42
  • It is difficult to understand the question, you seem to use GPT and GTM interchangeably. As I understand it, implementing DFP/GPT via GTM is not supported.
    – Alastair
    Dec 4, 2014 at 16:00

1 Answer 1

1

Google do not recommend implementing DFP/GPT via Google Tag Manager (GTM).

I had this response from Google Publisher Support:

...we don’t recommend using GTM with DFP Tags. At present, we don't have any Help Center article regarding this apart from: https://support.google.com/tagmanager/answer/2787990?hl=en&ref_topic=2772416

We are planning to include the option to use GTM for publisher website in near future but at the moment we don't have any ETA. However you can keep an eye on this Help Center article to keep yourself updated on new releases or for any updates related to DFP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.