Google Blogoscoped

Tuesday, September 18, 2007

Google AdSense for Mobile

Google has released their AdSense for Mobile program for a couple of countries now after testing it for some while*. To use this, log-in to AdSense, Google’s ads for webmasters program earning you money per ad-click, and switch to AdSense Setup -> AdSense for Mobile.

Once you’ve chosen your ad format (single or double, text-link only at the moment) and colors, and specify your document format – “wml (WAP 1.x)”, “xhtml (WAP 2.0)”, or “chtml” – you will be provided with a code snippet to insert into your pages. As opposed to normal AdSense, which use JavaScript on the client-side, the mobile AdSense is a server-side script. Google offers code for PHP, Perl, JSP and ASP.

Sounds easy enough? Well, there’s some confusion about just what entails a “mobile” site. By Google’s definition, a mobile site is not a “normal” website. For instance, they say you’re only allowed to use a maximum of 1 AdSense unit on any mobile site (whereas more units are allowed on non-mobile sites). The thing is, HTML is a device-independent format by design, so the same webpage may be both a mobile page and a desktop page... and a print page, and a feed page, and a search engine bot page, and a text-to-speech page, and so on (the Cascading Stylesheets framework is specifically able to then handle device-dependent layout on top of the device-independent HTML). This blog and other sites I templated for instance display on many mobile devices**, so now I don’t really know whether or not I’m supposed to add an additional mobile-optimized AdSense unit below the JavaScript AdSense or if that’s against the program policies.

Wanting to try include the PHP snippet into this blog’s framework, there’s a second problem. Google only seems to offer a code snippet which instantly writes its output to the client, using e.g. the “echo" method in PHP. This blog however caches all pages and generates strings first. That seems to be an approach which doesn’t work together with Google’s mobile AdSense approach.
Finally, trying to put the mobile ads into a games site of mine (which offers many mobile-optimized games which work with and without JavaScript) broke as well, though through no fault of Google’s: the 1and1 server I’m hosting with doesn’t allow requesting external PHP scripts via the “require” function.

In any case, maybe you have more luck with mobile AdSense!

*Google’s press release on this lists the following countries: “US, England, France, Italy, Germany, Spain, Ireland, Russia, Netherlands, Australia, India, China, and Japan ((available in the coming weeks).”

**Not all, but many... some mobile browsers, like Windows Mobile 5.0 Internet Explorer, (ab)use the desktop stylesheet to render it for the handheld!

[Thanks Alek, D.R. and 非官方的google黑板报.]


Blog  |  Forum     more >> Archive | Feed | Google's blogs | About


This site unofficially covers Google™ and more with some rights reserved. Join our forum!