Weeks back, the folks at Google Adsense included more countries into their Adsense For Mobile Content program and Nigeria made the list. Unfortunately implementing the google adsense for mobile content code on my wordpress blogs was nerve racking as I kept encountering this error:
PHP Fatal error: Call to undefined function read_global() in *****/index.php on line **
I did a little bit of googling and finally solved the issue with this fix: Fix Call to Undefined Function read_global() Error in Google AdSense Mobile Content PHP Ad Code.
This tutorial is meant to make things easier for those of you who want to add the php version of the all phones compatible Google adsense for mobile content code to your wordpress blogs.
There seems to be no issues with the code for high end phones like the iPhone.
HOW TO SETUP GOOGLE ADSENSE FOR MOBILE CONTENT FOR WORDPRESS BLOGS USING PHP
Log into your Google Adsense account >> Adsense setup >> Get Ads as shown below
Scroll down the page and select Adsense for Mobile Content as shown below
Select Single Page and under Device Type, select All Phones. For Ad Unit, leave it as Text and image ads (default)
NOTE: You can only place one google adsense ad unit on mobile pages.
1. Format: There are two kinds of available ad formats; single or double. Do please take note that if you choose Single, your adsense for mobile content code can be added anywhere on your blog while if you choose Double, your ad can only appear at the bottom of your page.
2. Markup: I'm personally using MobilePress wordpress plugin across my sites and the Markup language is xhtml. If you don't know the markup language of your mobile site, read this post from Google Adsense: http://www.google.com/adsense/support/as/bin/answer.py?answer=68725.
3. Character Encoding: You can leave this as auto. In my case I'm using UTF-8
4. Colors: Modify the colors of your ads to fit that of your blog.
Choose Ad Channels: Ad Channels for Google adsense for mobile content are different from those used in Adsense for Content thus you have to create a new one if you plan on monitoring your earnings via channels.
Under Scripting Language choose PHP then copy your adsense code.
PLEASE TAKE NOTE OF THE AREA CIRCLED IN RED BELOW AS IT'S VERY IMPORTANT
By default when you add this code to your wordpress blog, it might throw up the php error I mentioned earlier on. To fix this issue, download this fixed Google adsense for mobile content code and change the parts circled in red just above $GLOBALS['google']['ref']=read_global('HTTP_REFERER');
What I mean is simply copy the part circled in red from your own adsense code and then paste it into the modified code to replace the lines of code in the same exact spot!
Paste your edited code where you'd like it to appear in your wordpress mobile theme and you are very much good to go.
You might have to wait as long as 24 – 48 hours for ads to start showing on your mobile site.
Feel free to leave a comment below if you have any questions whatsoever.
A big thank you to Jide Ogunsanya for making this possible too . Cheers
You’ll also like:
- How To Install Disqus Comments On WordPress AMP Pages
- How To Add Google Adsense - Analytics To Wordpress AMP Pages
- AdMob To Stop Serving Mobile Web Publisher Ads In October 2011
- How To Check - Fix Google's Accelerated Mobile Pages Errors
- How To Show Alternate Ads - Content To Opera Mini Visitors
Please rate & share this article to help others. Thanks
I\'ve spent days looking for this. I know there should be a way to integrate Adsense code into WordPress Mobile Themes but reading through your article shows me the solution. I will try it and see if it will work for me.
Let me know how it goes for you :)
I think the interface has change. I can\'t find Markup, Scripting language and some others in my Adsense setup interface. Also, you don\'t tell us how and where to paste the adsense code.
Make sure you selected the All Phones option.
Please help, a friend of mine said Blogger has many limitations and that your account can be terminated anytime. He suggested namecheap.com to me to use it to self-host my own domain. What do you think I should do? How about WordPress?
This should come handy when I decide to use adsense on my WP blog. I\'ll come back for it..
Thanks for sharing..
You\'re welcome ;-)
Nice post.I was looking the method of integrating the Adsense with WordPress mobile.Thanks for the information.
Thanks for sharing this. It\'s very detailed. Great one!
Hi! I\'ve been using the google mobile adsense on my blog for about three weeks now and I think it converts more than the normal adsense ads.
Thanks for sharing.
I\'ll look into this properly by next week because I\'m currently using the double mobile adsense which appears at the bottom of my blog\'s mobile version.
Thanks for the info. I\'ll switch to double ads at the end of the posts and see how the click through rate (CTR) fares ;-)
thank you this is very helpful for me I an a new publisher
how to do on blogspot sir....
I don\'t know for now. Check your Blogger dashboard
Can this works for people using blogger blog?
Nope. It can\'t
WPTouch is worth helpful than other adsense plugin. Thouh it is complex while setting up but works great.
I tried out WP-Touch but like you said I had issues getting it to work with most mobile devices and it wasn\'t rendering some blog posts properly so I decided to stick with Mobilepress
Tes. I also moved to Mobilepress. It is very simple to apply changes and I can see them
They\'ve made changes to the code recently thus all you need do now is copy and paste freely without fear of errors ;-)
can i modify the way ads appear on my mobile site to adjust to screen size?
@elumkings yes you can . Just make use of responsive AdSense code