Inserting Google Adsense, Inmobi and Admob Ads in WordPress Mobile Version

When a huge percentage of your visitors are on mobile phones, you definitely need to optimize your site for mobile view to encourage them to keep visiting. Also, there’s need to monetize your mobile traffic by inserting inmobi, admob, buzzcity or google adsense for mobile ads to make some extra income. There are several plugins to make your wordpress blog mobile which includes WordPress Mobile Pack but the one I prefer most is MobilePress. If you try visiting this blog on mobile, should see the mobile version exactly as shown below.

how to insert google adsense into wordpress mobile version

MobilePress allows you to insert google adsense, inmobi and admob ads into your WordPress mobile site but it can only be done through Aduity, a third party site. I’ve been trying to visit aduity since I installed MobilePress but the site is never available. I’m not sure if the problem is temporary or they’re totally off the internet and not coming back. Anyway, I had to insert inmobi and google adsense for mobile ads and finally figured out a way to do it.

To get this done, you have to directly edit your MobilePress theme by logging in to your cPanel or fetching the needed files through FTP.

1. Log in to cPanel file manager or use your FTP login details to access your file manager from ftplive.com

2. Copy your ad code to a text file and save as adsense.php, inmobi.php or admob.php depending on your choice.

Note that if you’re creating a google adsense for mobile unit, you shouldn’t select ads for high end phones only, your selected ad type should be one that would be for both high end and low end phone. This code is in php which is preferable because it can be rendered on all phones.

The same thing goes for inmobi, buzzcity, admob and others, just copy the code to a notepad and save.

3. Upload this to public_html

4. Go to /public_html/wp-content/plugins/mobilepress/system/themes/default

If you’re using a custom theme, the directory should be /public_html/wp-content/mobilepress/themes/themename

Here, we’re dealing with just two files depending on where you to display the ads: header.php and footer.php .

5. If you want the advert to display at the top, you’ll have to edit header.php and insert the ad where you want it to display with php include function. Preferably, paste this in the very last line:

<div class="aduity"><?php include('adsense.php'); ?></div>

You can as well use this code anywhere else you want to display the advert in your WordPress mobile theme.

6. If you need to show the ad unit at the footer, edit footer.php and paste that same code on the very first line.

7. Now check your wordpress site on mobile to see if the ads are displaying. If not, give it some time before checking if you made a mistake. Inmobi sometimes takes up to theee days before displaying but adsense for mobile takes less than 10 minutes

It isn’t a bad idea customizing the look of your MobilePress if you know a bit of CSS. You can toy around with the CSS in the head section just to give it a unique look since you cant find MobilePress templates around. You can as well add some category links at the header to make navigation easier and all you’re deling with here is purely HTML. Just write the links where you want them to show.

If this post helps, hitting the google plus one or facebook like button is a great way to say thanks!

avatar
Don Caprio is a full time blogger / web designer living in Nigeria and apart from blogging, my other obsession is music. I'm a self-confessed Tupac fan, an iOS lover, an Android user, a Windows 8 power user, a writer with a 5-year old unfinished novel... and the list goes on and on. You can add me on Facebook, follow my updates on Twitter or add me to your circles on ! You can as well grab my feed and get updates through email.
avatar

@doncaprio

Tech blogger at http://doncaprio.com Web designer at http://doncaprio.org
Top 5 Reasons Why Android OS Sucks http://t.co/09TeyWGt7A via @doncaprio - 9 hours ago
avatar
avatar

Get free daily updates through email

Comments

  1. Great blog

  2. avatar Oto-obong Candid Success says:

    nice one, well I still have a slight problem with mine. I can't add it in the footer, its not showing instead the footer remains blank.

    • You can add it on the first line and btw, hope you're aware that only one google adsense for mobile unit is allowed on a page.

    • avatar Oto-obong Candid Success says:

      Don Caprio oh i see. Maybe that is the reason it wasnt showing cuz i added it in the header too.

    • Maybe that's why but I've seen mobstac users insert two which is against google's TOS. Using inmob isn't a bad idea, I even prefer it to google adsense for mobile because the ads are more mobile targeted and payment is in paypal.

  3. Okay, I am finding that if someone is using Google adsense (say for some months no problem and money increases double month over month) and then they sign up with advertising on Bing – even though Unique visits continues to climb, the adsense clicks suddenly drop by more then 60%!!! Nothing anyone can do I’m sure, which is why and how Google can do this crap, but I wanted to at least let people know what is happening. Its more then scammy its fraudulent! At least one website this is happening too is http://www.BridgeToRussian.com -FYI

  4. God bless you for sharing this, it really helps.

  5. Thats good example thanks

  6. Hello,we are trying to install mobilepress but its doesn’t seem to work.Are there any conflicts with mobilepress and W3 total cache.
    pradeepf recently posted..Fix/Reinstall Grub After Reinstalling Windows Without Ubuntu Live CDMy Profile

  7. Not working for me. I dont know what i did wrong. When saving the as php, do u use ANSI or US8 or something?

    • avatar Don Caprio says:

      It seems you’ve found your way around it. I check your blog on my mobile phone now and the ads are showing.

  8. Hi,

    I have tried this technique on my blog but it doesn’t work. Do you have any idea of what I can do to make it work…I think I’m missing it at in the SYSTEM folder. I’ve pasted the code at the last line of the file but I got the same line of code in the header.php. Hope you can give me some tips?
    Olawale Daniel recently posted..Google Chrome 18 Stable Version Available for DownloadMy Profile

    • I just found out my post editor automatically made a change to the code the last time I edited it and rendered it useless. It’s been fixed, you can try it now.

  9. Don am going for admob is it good
    kingsley recently posted..What Is The Causes Pancreatic Cancer?(explained)My Profile

  10. Can one place two ads on the template? lets say header and footer?
    Nwosu Desmond recently posted..How to recover deleted files from recycle binMy Profile

  11. Don Caprio i will love to know how you added the navigation on your mobile site…i will love to do same with http://www.netmediablog.com so i will love it if you write on it.
    Nwosu Desmond recently posted..How to recover deleted files from recycle binMy Profile

  12. Yea, adsense only allowed one ad space for mobile, you can add two but remember that is against policy and you could get the hammer, so stick to one and enjoy from your mobile traffic.
    Essien recently posted..Comment on Parse Your Google Adsense Code With Quick Html Parser by EmelineMy Profile

  13. i have been trying to create a mobile version of my blog so that i can add google mobile ads to it. I have use those plugin you mentioned & others bt it seens not be working. I don’t know why? Help pls.

  14. PLease, i need your help. sorry for commenting out of line. I want to Optimise my site in all wise. I have read a lot of reviews but still cant deside on the best premium wordpress theme to go for. I need a standered 3 column theme for http://www.jobsandscholarship.com/ Please help.
    Amy recently posted..Etisalat Nigeria Recruitment 2012 (15 Positions)My Profile

  15. A screen print at number 5 and 6 will really help explain this more to me. I got loss at number 5 and 6. How do i go about that one
    ida recently posted..President Jonathan Dismisses The Director General Of The Bureau For Public Enterprises,Bolanle OnogoruwatoMy Profile

  16. don thanks so much for your help just did as you instructed but am yet to confirm if it appears or not
    everest recently posted..CONGRATULATIONS ARE IN ORDERMy Profile

  17. Thanks for this wonderful information, its what i need desperately right now on my blog hariyorblog.com but i hope it works with mobiledetector plugin.

  18. Thanks Don this is the one that I’m looking for.
    Michael recently posted..Death of Lolong the Largest Crocodile in CaptivityMy Profile

  19. Great tip thanks a ton.
    Rohit recently posted..Tara Muzik on Intelsat 20 (C Band) at 68.5 EastMy Profile

  20. How about adding the ads code in between posts
    Samex4rill recently posted.. Reduce The Length Of Your Google Plus Profile Url

Speak Your Mind

*

CommentLuv badge