I am running a web application where I want to place context-sensitive ads in.

The content being displayed is private data of my users (not visible to the public), like email content and such. Thus, for privacy reasons, I don't want this information to be redirected to 3rd partys, such as Google servers.

Now, if I'd display AdSense ads, what exactly does this script do in order to display the ads? Does it just parse the content of the site and then display relevant ads or does it actually send the content to Google servers in order to find the right ads to display?

3 Answers 3


No, Adsense does not send the content of every page to Google - that would be pretty inefficient and hog a lot of bandwidth - and in fact is not technically possible with cross-domain restrictions.

Instead, the Adsense crawler (different from the normal Googlebot crawler) visits the page separately and decides what the context of the page is. Then when a page with Adsense is visited, the URL of the current page is sent to Google and it returns ads based on the predetermined context.

In the case of pages behind a login, under normal circumstances Adsense will see whatever non-logged-in users would see, e.g. a login page, and serve ads based on that (most likely generic ads about your site's category).

However, it appears there is a special method to allow Adsense access to login-protected pages, by setting up a special login account for it. This will be useful if all users are seeing the same content behind the login.

In your case it sounds like users are seeing customised content, so you'll never be able to target them perfectly, but you can make an Adsense login and show some typical content to generate ads appealing to as many of your users as possible.

  • so how does adsense ads being displayed for pages which are restricted to registered users. what is the logic. thanks. Oct 26, 2011 at 3:05
  • @MonsterMMORPG sorry I don't understand your question. Oct 26, 2011 at 10:10
  • @MonsterMMORPG You can provide the AdSense bot a username+password combination so that it can crawl that "protected" content as well.
    – Timo Ernst
    Oct 27, 2011 at 14:59

Adsense uses Javascript to add adverts to the site. If you include javascript from an external source, that script can call back to itself and read your site from within. It does not need any other connections. It can even be put on a setTimeout or SetInterval to read your site asyncronously, inluding anything that is typed into input boxes, textareas. It can watch your users mouse position.

Anything that is possible in javascript, reading form values, innerHTML, cookies, mouse position, screen size etc etc, the same can be done and the results sent back to the external server.

You could read the initial script, and it may not contain a reference to such type of actions, but once a javascript is included, it can call a new file containing the site-scrapping script.


that would be pretty inefficient and hog a lot of bandwidth

Actually, doing it any other way would be. Why create a new connection when one is already made. One that could read the site from within and in such an easy way and send the variables back to google via the querystring. Which one is faster, getting the contents of a current connection by starting a new one with an XML reader, or send the targeted contents of the current page back via the querystring.

  • The Adsense crawler reads the page independently and caches. It doesn't crawl the page every time a request is made. May 30, 2017 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.