react-dfp
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.
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.
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.
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?
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 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?
lazyload issue
you have not defining slot id