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

Callback for "not in viewport" and such. #102

Open
loqtor opened this issue Aug 15, 2019 · 0 comments
Open

Callback for "not in viewport" and such. #102

loqtor opened this issue Aug 15, 2019 · 0 comments

Comments

@loqtor
Copy link

loqtor commented Aug 15, 2019

Hey,

More an enhancement than an issue probably, but I think that it'd be nice if the library gave you a way to know when the ad was not rendered because of reasons unrelated to it being empty or the script not being loaded.

The case I'm considering is either when the ad is not in viewport or the slot that matches the current viewport size is not properly defined.

The reason I'm raising this is because in my app the ads come from the API and one of them wasn't rendering, even though I had not changed anything on my end.

So, I started debugging and I noticed that one of the slots was empty, but Bling was not actually letting me know that the ad could not be rendered.

The change I'm thinking of is just having a prop that's called onError. It'd pass as a parameter an errorType (i.e.: OUT_OF_PAGE_ERROR when isInViewport is false, SLOT_ERROR when the slots are not properly defined) and you can then do whatever you need based on the type of error that took place.

I hope that made sense. Happy to send a pull request if you find it interesting.

Cheers!

@loqtor loqtor changed the title Callback for _not in viewport_ and such. Callback for "not in viewport" and such. Aug 15, 2019
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

1 participant