Display Google AdSense on password-protected pages

The Google AdSense FAQ says:

Place ads on pages that don’t require a login.

What if the main part of your site is a password-protected member area? No AdSense? No earnings? No! Here comes a quick technique that allows you to place AdSense with content relevant ads on every page you want.

Google AdSense

AdSense automatically delivers ads targeted to your content on a page-by-page basis. After you’ve visited a page that contains an AdSense banner, soon a bot named “Mediapartners-Google” will visit exactly that page. It’ll use exactly the same address. And it will get what the script (sites that require a login are using some kind of server-sided scripts) gives to it. That’s all we have to do. Change the content of the specific page. Mostly the script will display something like “Login required” when the Google bot comes, because it’s not logged in. Google will scan that page in order to display ads targeted to your content. That page normally won’t contain relevant content. You can change that. Add some meaningful content, and if you want to, you can put it in a div and set display: none to hide it.

That way, you can force AdSense to display the ads you want. Create a nice keyword list, or something else. Even on pages that display e.g. some boring user details, AdSense will display relevant ads.

Published by

Julian Bez

Julian Bez

Julian Bez is a software engineer and former startup founder from Berlin, Germany.

  • http://www.hostingadvices.com Augustine

    You can go one step further, if the area you protect doesnt contain very critical info. You can allow access to the pages to google media bot, without login. Anyone with some PHP (or whatever lang you use) can allow google bot, based on IP address range and user agent name. Note that google mediabot and normal googlebot are differnt, so no chance of your secure page appearing on a google cache.