Exception in queued GPT command TypeError: Cannot read property 'addService' of null Google dfp

When you are trying to load Google dfp you will find that it's very easy to load. It just works in most of the cases.

But in case if you are not doing it according to the documentation you might end up JavaScript errors like below:

Error

Exception in queued GPT command TypeError: 
Cannot read property 'addService' of null

Cause of the error

The error happend because the same ad unit was in the DOM multiple times.

Solution of the error

The following ad unit was loaded multiple times:
<div class="ad-placeholder adunit" id="nettBanner3" data-dimensions="300x250,320x320,320x250,580x400,980x150,980x300,980x400,980x500,980x600" data-size-mapping="nettBanner3SizeMap" data-name="nettBanner3"></div>

As soon as duplicated ad units were removed the error was gone. :)

Comments