5

Say I have a blog, running with Google Ads.

And I have the total control of that blog. It's not hosted on somewhere else.

Is it possible for me to detect the content of the ads that's been displayed to my readers? For instance, if the keyword Quora is displayed, I want to remove the ads.

I've tried this: How to get the body's content of an iframe in Javascript?

But I can't get the HTML out.

Bharata
  • 13,509
  • 6
  • 36
  • 50
AGamePlayer
  • 7,404
  • 19
  • 62
  • 119

2 Answers2

5

Is it possible for me to detect the content of the ads that's been displayed to my readers?

This is not possible because of Cross-origin resource sharing (CORS) rules:

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served. A web page may freely embed cross-origin images, stylesheets, scripts, iframes, and videos. Certain "cross-domain" requests, notably Ajax requests, are forbidden by default by the same-origin security policy.

Read full article in the link above.

The Google Adsense Advertising will be created using a JavaScript file which is not on your server.

How to block an advertising (The answer from Google Adsense support)

You can block an advertising in "Ad review center". Citate from official Google Adsense support site:

Ad review center overview

The Ad review center is a feature that gives you more transparency and control over the ads that appear on your site. When you enable the Ad review center, you can review individual ads after they're shown and assess whether you want to continue showing them on your pages.

enter image description here

Some important things to know about the Ad review center:

  • You can find it on the Allow & block ads page in your AdSense account
  • It supports ads of all targeting types (contextual, personalized, and placement)
  • You can use its filter and search functions to help you find ads to review and block
  • It doesn't support all AdSense products
  • You can only block ads at the product level, not on a site-by-site basis

For help getting started with the Ad review center, see our guide to reviewing ads.

You could do too: Block ads by general category: at the site level or at the product level

Important information: each from this links above you can read in your language (e.g. Chinese) too. You can change the language in the bottom of each page.

Community
  • 1
  • 1
Bharata
  • 13,509
  • 6
  • 36
  • 50
2

...detect the content of the ads that's been displayed ... I want to remove the ads

Besides the technical explanation, I don't think hiding of an ad sent from ad publisher for displaying to user is ethical. Because ad publisher will be thinking ad is displaying. Ad owner will be charged for that ad, you gonna earn money from it. In other words, you can't hide the ad after placed to page and displayed.

In my opinion Adsense users have to respect to ad platform's decision about what ad's gonna be displayed. Because agreement between Adsense and user is this.

But if Google Adsense is provide an option for blacklisting for some words, you can use it. I think, that's what you need.

Hope this helps.

P.S.: Maybe Adsense Support can help you about blacklisting. Have you tried to contact them?


Update

I found an article (has a video explanation) about blocking ads based on some rules (URL, ad network etc.)

ufukty
  • 312
  • 3
  • 10