Our site let's user post content and we display ads on them and share some part of ad revenue with user just like YouTube. Now the issue is how to programmatically know if an ad was successfully displayed on user's post? We want to count the number of ads successfully displayed on user's post so that we can share the revenue accordingly. Are there any functions like onAdLoadSuccess(), or onAdError() etc so that we can write our own logic inside these functions to maybe save totalAdCounts in a database?
Asked
Active
Viewed 1,046 times
1
-
Does this answer your question? [How to detect Adblock on my website?](https://stackoverflow.com/q/4869154/11613622) or maybe [How can I detect if my AdSense ad is blocked?](https://stackoverflow.com/q/5053317/11613622) – brc-dd Sep 22 '21 at 17:56
1 Answers
2
You can use data-ad-status
to detect whether given ad slot has been filled. It's the closest variant to onAdLoadSuccess() adsense has: https://support.google.com/adsense/answer/10762946?hl=en

Mikita Belahlazau
- 15,326
- 2
- 38
- 43