Adsense for mobile - CGI/Perl installation

GarriPeople


Home | Internet | ( 1 ) | Subscribe

Posted by on Wednesday August 3, 2011 10:4:11:

One of the great things about Google adsense is that it allows users to also make money from mobile advertising. You already make good bucks from normal desktop pages and yet again you have increased opportunities if you have a mobile version of your site.
Most adsense publishers in several countries now have mobile adsense options unlike what it used to be in the past. Now more countries, including Nigeria have the option of also using mobile ads from adsense.

As a adsense publisher, n order to be able to integrate google's mobile ads, your site has to be in
- Cgi/Perl
- PHP
- JSP
- ASP

So if you have a site that is based on those formats, you can easily copy and past adsense codes into your website code.

Since I already have a website that runs on Perl, I just simply copied the code from my adsense account and placed it in a sub function like these:

- I opened up my cgi and created a function called &mobile_ad and inside it I pasted the code from Perl - Adsense for mobile:

===
sub mobile_ad {
Paste Adsense Code here
}

- I also made sure that these three items are working and installed on my web host for CGI:

use LWP::UserAgent;
use Time::HiRes qw(gettimeofday);
use URI::Escape;

- Under my mobilized web display in Perl, I set up the code at the bottom ot the page:

if($mobilize) {
&mobile_ad;
}

- Finished. It is all set up

Now, I tested my site by visiting it from my mobile phone and it was showing ads. I also tried to visit it using an opera desktop browser but it did not show. I guess it has a way of detecting mobile browsers and desktop.

One thing I noticed is that when you test it without a mobile device, it may be showing a comment tag in the form . That shows that you have successfully installed mobile adsense on your site but it is not yet showing probably because there are no ads yet or it is not being viewed on an acceptable device.