react-dfp icon indicating copy to clipboard operation
react-dfp copied to clipboard

googletag.defineSlot was called more times than there are DIVs in the DOM associated with ad slots while in Single Request Mode.

Open Andriiuxa opened this issue 5 years ago • 6 comments
trafficstars

Hi there, I've been banging my head into the wall trying to figure out how to get rid of this warning. Basically everytime an <AdSlot /> component gets rerendered this warning appears in the Google Console Warning xxx googletag.defineSlot was called more times than there are DIVs in the DOM associated with ad slots while in Single Request Mode. This will impact impression counts. . This happens when singleRequest is on, if I turn it off I get this warning for each component rerendered Warning,googletag.defineSlot was called without a corresponding DIV on the page..

Any ideas?

PS: <DFPSlotsProvider /> only has dfpNetworkId as prop provided, and <AdSlot /> component only have adUnit and sizes provided.

Andriiuxa avatar Apr 28 '20 14:04 Andriiuxa

Here is a codesandbox link https://codesandbox.io/s/dawn-platform-recj0?file=/src/App.js @jaanauati, make sure you have google console open, and try switching between pages.

Andriiuxa avatar Apr 29 '20 10:04 Andriiuxa

That's annoying, thanks for the sandbox link.

Does the same happen when you comment out all the ad slots and just put a single one directly in app.js?

scottydev avatar Apr 29 '20 18:04 scottydev

I am not 100% sure what you meant by that, something like this: https://codesandbox.io/s/friendly-mcnulty-9exox?file=/src/App.js ? If yes, then no, it will not cause this issue, since there is nothing to cause <AdSlot /> to rerender. @scottydev

Andriiuxa avatar Apr 30 '20 07:04 Andriiuxa

@Andriiuxa we have the same error Warning, googletag.defineSlot was called without a corresponding DIV on the page. did you ever figure out what caused it?

daraclare avatar Mar 23 '21 17:03 daraclare

lazyload issue

ramdgupta avatar Sep 16 '21 11:09 ramdgupta

you have not defining slot id

ramdgupta avatar Sep 16 '21 11:09 ramdgupta