nfl / react-gpt

A React display ad component using Google Publisher Tag
MIT License
145 stars 84 forks source link

AdUnit path as well as the slot size remains but the page results changes in that case the new slot is not created #80

Open mdshaheer opened 6 years ago

mdshaheer commented 6 years ago

I have a scenario in my project where in I navigate from Listing page to Listing page and will change the results. For each of these actions we are making a DFP call to get new Ads. But as the AdUnitPath and Slot size remains the same am not seeing we are destroying the old slot and adding a new one hence the slot remains blank. Do you think you have a fix for the same? Previously before using react-gpt when I was doing the implementation by my own I was adding the timestamp for the div Id to make sure every time I call DFP i will call with new id.

potench commented 6 years ago

Can you provide some sample code or a test case in the tests that shows this happening? https://github.com/nfl/react-gpt/blob/60f6ce0ccd02e3c423b772b42de50ba776d883e7/docs/Guides.md#refresh-vs-re-render If no props are changing (you said same adUnitPath and size) then you probably need to call Bling.refresh()