jaanauati / react-dfp

A React implementation of the Google DFP/GPT api. https://react-dfp.surge.sh
MIT License
127 stars 53 forks source link

Invalid arguments: PubAdsService.refresh([]). #213

Open garmeeh opened 3 years ago

garmeeh commented 3 years ago

Version: 0.20.0

When calling DFPManager.refresh(); in a useEffect I get the following error google tag console:

image

Edit:

When I pass a slot id it correctly refreshes that slot. The docs mention that you do not need to explicitly set the slot to refresh. Is this a bug or maybe I have configured something wrong.

squgeim commented 3 years ago

I don't know if this is related, but I found the functionality to refresh ad has changed in recent version. Instead of passing gptSlot as expected by PubAdsService, it is now passing slotId.

https://github.com/jaanauati/react-dfp/blob/e5b46729e1b92178027008c849440f15fb0edde6/js/manager.js#L360-L362

This used to work up to version 0.20.0:

https://github.com/jaanauati/react-dfp/blob/126d4fea858ba34982d76e752b7a374ac58698fb/js/manager.js#L356-L359

scott-thrillist commented 3 years ago

@squgeim thanks for diagnosing the issue.

@daraclare can you take a look at this bug. I tried updating to the latest version and am getting this error as well.

Mohamad-Kamar commented 2 years ago

@jaanauati Please inform us on any updates for the deprecated google functions, we are facing the same warnings in our project.