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

Invalid arguments: PubAdsService.refresh([]).

Open garmeeh opened this issue 3 years ago • 3 comments

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.

garmeeh avatar Mar 18 '21 11:03 garmeeh

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

squgeim avatar Jul 14 '21 18:07 squgeim

@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.

scott-thrillist avatar Jul 20 '21 19:07 scott-thrillist

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

Mohamad-Kamar avatar Jun 24 '22 09:06 Mohamad-Kamar