Ad rotation: Using the user-agent header to serve up Google ads to Google and Yahoo! ads to Yahoo!

Apparently some AdSense publishers who are rotating between AdSense and YPN (Yahoo! Publisher Network) ads on the same page are having difficulty with ad targeting when the YPN ads are shown. (Even everyone's favorite rich blogger, Darren Rowse, felt it worthy to mention it.) The solution that Tim Flight came up with was to rotate the ads based on elapsed time and not on each impression.

The real problem, however, seems to be that Yahoo! doesn't like seeing a page with its code on it suddenly without the code. If that's true, there's a better solution based on the “User-Agent” header. You see, the search engines actually identify themselves to your web server when they're fetching pages for indexing. If you have access to some server-side scripting, you can actually change your pages to only serve up the YPN code to Yahoo!'s crawlers and AdSense code to Google's. And for everyone else, just rotate them as you normally would.

See my articles Masquerading Your Browser and How to Detect Internet Explorer (which could just as easily be “How to Detect Yahoo!” or “How to Detect Google”) for more information on this topic. My free HTTP Header Viewer tool also lets you see what your browser is sending at this very moment. If you've played with server-side scripting before, these kinds of changes should be very easy to make.

Eric Giguere is the author of Make Easy Money with Google, a real (printed!) introductory AdSense book for non-technical people, available at all fine bookstores. Be sure to download the free sample chapter for more information about the book.

Socialize This Post (Please!)

Add to OnlywireAdd to Onlywire

Tags

Comments

Comments are closed.

Subscribe without commenting