I have google ads placed in my website and i want to show a small indicator at left side of the page.
If google ads is showning/filled. the indicator circle will be green If google ads is not showing/unfilled. the indicator circle will be read.
Google ads guide URL : https://support.google.com/adsense/answer/10762946?hl=en
To get the data we can use like ins.adsbygoogle[data-ad-status="unfilled"] for not showing and ins.adsbygoogle[data-ad-status="unfilled"] for showing.
My code to create indicator using javascript :
<script>
if (ins.adsbygoogle[data-ad-status="unfilled"]) {
document.write('<div style="background:red; height:10px; width:10px"></div>');
} else if (ins.adsbygoogle[data-ad-status="filled"]) {
document.write('<div style="background:red; height:10px; width:10px"></div>');
} else {
exit;
}
</script>