Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does adblock block adsense ads?

I've been working on something to block ads (or rather hide them) utilizing plain javascript. For ads specific to a website using something like this:

document.querySelector("img[src*='domain.com/path/to/ad/']").style.display="none"

Actually works to find the specific image and hide it. However, google seems to be inserting their ads in an iframe that contains it's own document with a header/body/footer. It looks like this:

google ads

I haven't been able to find a way to select the adsense ad and do something with it. How would you go about selecting anything within that block?

like image 570
jasono Avatar asked Jul 13 '14 05:07

jasono


People also ask

Does AdBlock affect AdSense?

For example, perhaps you run Google Adsense or some Google AdSense alternatives. If an ad blocker is detected you could have it fallback to an affiliate ad instead. Typically affiliate ads are just image banners and shouldn't be impacted by ad blockers.

Does Adblocker block Google ads?

If you use Google Chrome, use the Adblock Plus extension to get rid of all annoying advertising. Adblock Plus blocks all annoying ads on the web, like YouTube video ads, flashy banner ads, Facebook ads and much more. It even blocks pop-ups which are not blocked by your browser.

Does AdBlock affect YouTube monetization?

If a consumer is using an ad blocker, they're not being shown ads, therefore the creators of the videos they watch aren't able to receive revenue from those viewers. While this can impact their income, we've discovered that the majority of YouTube users aren't using these tools.


1 Answers

I believe it uses a combination of things such as the url the add originates from, the size of the banner and the code for the ad within the html of the page.

I think that adblock actually keeps the ad from loading and not just hiding it.

Why are you wanting to hide the ad. Is it your webpage you placing the javascript?

like image 165
user3823888 Avatar answered Oct 16 '22 21:10

user3823888