Mobile app version of vmapp.org
Login or Join
Sarah324

: Some Adsense domain's ads are causing document.write() statements that remove the html from the page All that is output on the page is the domain name of the advertiser, for example 'www.solar-aid.org'.

@Sarah324

Posted in: #Advertising #GoogleAdsense #Javascript

All that is output on the page is the domain name of the advertiser, for example 'www.solar-aid.org'. The rest of the content is stripped, I believe because of a document.write() statement.

I'd like to know if this is a common issue or something wrong with our setup. There are three domains causing the issue, which we've blocked from Adsense as a result.


solar-aid.org
kiva.org
grameenfoundation.org


Given the type of organizations I think they may be within the default group of 'public service ads' within the Backup Ads setting. If the issue doesn't completely resolve itself soon (one customer of ours complained today, even though I blocked them 5+ days ago), I'll disable public service ads and select the 'fill space with a solid color' option.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

In JavaScript, document.write() simply prints out text. I am pretty sure that it wouldn't strip the page of HTML unless it were missing a quote, in which case it would strip everything until the next quote appeared in the page.

If you could post some code of one of those domains, it would be a lot more helpful. Just like in HTML, JavaScript needs everything to be closed in the proper place in order to function correctly. However, usually the browser will see the syntax error, and simply stop executing all JavaScript on the page.

Knowing how your webpage is built too would help, if it has major PHP elements, or it's plain HTML or HTML with CSS/JavaScript.

I'm going to assume that you're using HTML with CSS/JavaScript for your webpage, and that the ad is at the top of the page or the first thing in the HTML body. A possible fix would be to sift through the code and look for syntax errors.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme