Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
garmeeh opened this issue Mar 18, 2021 · 3 comments
Open

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

garmeeh opened this issue Mar 18, 2021 · 3 comments
Labels

Comments

@garmeeh
Copy link

garmeeh commented Mar 18, 2021

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
Copy link

squgeim commented Jul 14, 2021

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.

react-dfp/js/manager.js

Lines 360 to 362 in e5b4672

const pubadsService = googletag.pubads();
const slotsToRefreshArray = slots.map(slotId => registeredSlots[slotId].slotId);
pubadsService.refresh(slotsToRefreshArray);

This used to work up to version 0.20.0:

react-dfp/js/manager.js

Lines 356 to 359 in 126d4fe

const pubadsService = googletag.pubads();
pubadsService.refresh(
slots.map(slotId => registeredSlots[slotId].gptSlot),
);

@jaanauati jaanauati added the bug label Jul 16, 2021
@scott-thrillist
Copy link
Collaborator

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants