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

Ads are not loading intermittently. Hard refresh works. #186

Open
asimqt opened this issue Mar 2, 2020 · 2 comments
Open

Ads are not loading intermittently. Hard refresh works. #186

asimqt opened this issue Mar 2, 2020 · 2 comments

Comments

@asimqt
Copy link

asimqt commented Mar 2, 2020

Version: 0.17.1. (Experienced same behavior with 0.11 also)

Ads are rendering as:

<DFPSlotsProvider dfpNetworkId={defaultNetworkID}
                           collapseEmptyDivs={collapseEmptyDivs}
                           targetingArguments={targetingArguments}
                           sizeMapping={adConfig.viewPortSizeMapping}
                           lazyLoad={lazyLoad}
                           singleRequest={singleRequest}>
    <AdSlot {...adConfig} />
  </DFPSlotsProvider>

There's a wrapper component like:

<AdService {...props}/>

where AdService is wrapping Adslot with DFPSlotsProvider as above.

Sometimes I'm getting below error:

Screenshot 2020-03-02 at 1 14 32 PM

More debugging showed me:

Screenshot 2020-03-02 at 1 15 00 PM

It seems like, registeredSlots have adSlot 3, 4 and 5, but we're still trying to render adSlot 0. Somehow the slots are updated with increased indexes, but the library is unaware of that. I thought maybe in somewhere I'm calling DFPManager.refresh(); but that's not the case.

Any idea why this happening? I spent more than 2 days in this.

@asimqt asimqt changed the title Ads are not loading intermittently Ads are not loading intermittently. Hard refresh works. Mar 2, 2020
@jaanauati
Copy link
Owner

hi @asimqt, according what you describe your code is rendering more than one instance of our custom component: AdService, which ends up in multiple instances of the <DFPSlotsProvider>, right?.

There should be only one instance of DFPSlotsProvider in the page, declaring more than one will lead to unexpected/buggy behaviors like what you describe.

<DFPSlotsProvider>
<div>
<AdSlot />

...

<AdSlot />
....
</div
</DFPSlotsProvide>

Please update your code so that it follows this pattern and let me know if u still have issues.

Thank you.

@asimqt
Copy link
Author

asimqt commented Mar 4, 2020

Yes. You're correct. I'll rewrite my code and will let you know.

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

No branches or pull requests

2 participants