Using a third party javascript? AdSense Publishers beware!

A warning to all AdSense publishers. It makes good business sense to dump all your cookies and take a spin around your website and see if any AdSense ad units pop up where you did not place any.

WebmasterWorld member morpheus83 happened to notice some strange behavior on his website – a mysterious 336×280 AdSense ad unit showed up on his site. An ad unit he didn’t place, and one that reveals a different publisher ID than his own. But on subsequent page views, that AdSense ad unit was nowhere to be seen. But lo and behold, it eventually showed up again.

A little digging around found the culprit – a third party javascript placed on the site to “tell a friend” about the site. These javascripts are popular with webmasters, and in 2003 this website already had 2,000 members signed up and using the service. Members recently received an email asking them to switch to a new code.

In this incidence, the offending script is:

<!——— START CODE ———–>
<div align="center">
<script src=""></script>

<a href=>Tell a friend</a>
<!———- END CODE ————>

I have changed the site and ID # that was targeted by this to, but tellafriends is the site targeting others with this. And on the page, there is very clearly two different publisher IDs on two different AdSense ad units, one being the site owners, and one being served through the javascript at

With the new updated AdSense terms, this would put the site owner of in violation of the terms, since you can only have two publisher IDs on the same page by permission from Google AdSense.

Incidentally, clicking the “Ads by Google” shows the website as the site the ads appear on, rather than as being served from

The tellafriends javascript is written so that the cookie will only allow this rogue AdSense to show only once every two days. And since webmasters rarely scroll down to the bottom of the page where the “tell a friend” buttons usually are, it could go unnoticed for a while. In this instance, however, the 336×280 ad unit size expanded the left navigational column, making it noticeable to the publisher. If a smaller width ad unit had been used, it could have been much longer before it was noticed.

An interesting – and clever – way to spam AdSense. Perhaps the new owner of tellafriends (the rumor is that it had been sold) thought there must be plenty of dead websites that webmasters were no longer maintaining, and this trick would go unnoticed for some time.

So if you use any third party javascript on your site, take the time to check for any rogue ad units (or other advertisements) showing up. This particular script worked properly for years until just recently. And it shows just how easily and vulnerable your site can be to ads being placed without your permission or knowledge.

And just incase you think this would be a clever way to spam AdSense, it is clearly AGAINST the AdSense terms to do what tellafriends is doing.

Share this with others!
  • Twitter
  • Digg
  • Sphinn
  • StumbleUpon
  • Reddit
  • Technorati
  • Mixx
  • Google Bookmarks
  • Facebook

8 comments to Using a third party javascript? AdSense Publishers beware!

  • Tell a Friend Script Adds AdSense

    JenSense reports on a WebmasterWorld thread named Adsense by a hacker? which describes how an old Tell a Friend script added a “300 x 250 adsense box at the bottom of the page” without knowledge or authorization that this would…

  • These people are also in breech of adsense TOS. Your not allowed to put ads on sites where you don’t control the content. I hope someone has reported them to Google!

  • Why can’t people just use their skills for good instead of evil?

  • Tim

    Probably because they earned money from it.

  • > Why can’t people just use their skills for good instead of evil?

    Isn’t making money “good”? 🙂

    Money makes people very creative. I think that goes for webmasters, SEOs and SEs alike. Admitted, sometimes too creative but thats in the rules of the game.

    The same form of JavaScripts have, by the way, been used for years on other “free tools distribution” – you sign up for some service that you include by a JavaScript but have you ever seen what they show with JavaScript off? 🙂

  • This really shocked me, don`t know how people can be so intelligent and yet so dumb.

    They are giving a pretty good chance of banning themselves and get kicked out from the programs even before they get to earn some money.

  • Tell a Friend Script Adds AdSense

    AdSense publishers beware! If you are using a third party script, there is a way they can put AdSense ad unit on the page where you use the script. A forum user at WebmasterWorld happened to notice this. A mysterious 336×280 AdSense unit showed up o…

  • Am I breaking the TOS if I have Adsense in my RSS feed and it’s used on someone elses page? How can I prevent that?

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>