Skip to content
new ogbongeblog logo
  • Advertise
  • Blog
  • Contact

How I Make Adsense Responsive Ad Code To Display 300×250 Banner On Mobile

May 26, 2017

·

Uncategorized
jidetheblogger Avatar
jidetheblogger

If you discover that your Adsense responsive ad code doesn’t display the size of ad banner you would like it to display, you can modify your ad code to meet the requirements of your responsive site. So, instead of your responsive ad code to be displaying 300×100 banner above the fold, you can force it to display 300×250 mobile banner. This of course, is allowed by Google Adsense.

In this tutorial, I want to show you how I modify my responsive ad code to display 300×250 ad banner above the fold on mobile.

Below is what my modified ad code looks like :

<style>
. OBResponsiveTop { width: 300px; height: 250px; }
@media(min-width: 500px) { . OBResponsiveTop { width: 468px; height: 60px; } }
@media(min-width: 800px) { . OBResponsiveTop { width: 728px; height: 90px; } }
</style>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<div style=’display:block;text-align: center’>
<!– OBResponsiveTop –>
<ins class=”adsbygoogle OBResponsiveTop “
     style=”display:inline-block”
     data-ad-client=” ca-pub-XXXXXXX11XXX9 “
     data-ad-slot=” 7XXXXX1 “></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

The code above does these:

  • For screen widths up to 500px: a 300×250 ad unit is displayed.
  • For screen widths between 500px and 799px: a 468×60 ad unit is displayed.
  • For screen widths of 800px and wider: a 728×90 ad unit is displayed.
  • and the displayed ad unit displays at the center. 
make adsense responsive ad banner display 300x250 ad banner on mobile

To adapt this sample code for your own blog:

1. Create a responsive ad unit in your AdSense account, and note down the following information from your responsive ad code:

  • Your publisher ID, for example, ca-pub-1234567891234567
  • Your ad unit’s ID (data-ad-slot), for example, 1234567890.

2. In the sample code:

  • Replace all instances of OBResponsiveTop with a unique name, e.g. front_page_123, etc.
  • Replace ca-pub-XXXXXXX11XXX9 with your own publisher ID.
  • Replace 7XXXXX1 with your own ad unit’s ID.

3. Copy and paste your modified ad code into your blog’s HTML where you’d like the ads to appear.

Once you’ve placed your ad code, test your ads on different devices and screens to make sure that the responsive behavior is working correctly.

That’s all.

Please Share :
adsense blogger tips wordpress

Like What You Read?

Sign Up to get similar articles delivered to your email inbox.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

10 responses to “How I Make Adsense Responsive Ad Code To Display 300×250 Banner On Mobile”

  1. chidiebere uzu Avatar
    chidiebere uzu
    May 26, 2017

    AdSense improving every day…. Boss my e-mail reply ooo Uuchidiebere@gmail.com

    Loading…
    Reply
  2. NaijaEssential's Blog Avatar
    NaijaEssential’s Blog
    May 26, 2017

    Nice tips. Will try it. Check out my blog and tell me whats up http://www.odiboapeter.com

    Loading…
    Reply
  3. BelieveAll Avatar
    BelieveAll
    May 27, 2017

    Thank you boss

    How I caught her cheating

    Loading…
    Reply
  4. NAIJASTURF BLOG Avatar
    NAIJASTURF BLOG
    May 27, 2017

    thank you for this great information

    Loading…
    Reply
  5. Adesoji Awobajo Avatar
    Adesoji Awobajo
    May 27, 2017

    wow.. very helpful, thanks sir…. Commenting from SAFAXNET BLOG

    Loading…
    Reply
  6. Benito Avatar
    Benito
    May 27, 2017

    Please, I want to edit the mobile width of my blogger site, because if I place AdSense 336×280 inside post, it doesn't show fully on mobile screen. So I want to edit the mobile inside post body width to match the ad size. Please tell me which code to edit to achieve this in my template, thanks.

    Loading…
    Reply
  7. peter egwuatu Avatar
    peter egwuatu
    May 30, 2017

    I was able to do it as well. Thanks for your help Mr jide. From Pegikrol

    Loading…
    Reply
  8. Wisdom Michael Avatar
    Wisdom Michael
    June 10, 2017

    Thanks bro for this tutorial.But I was unable to apply to my blog. I think am not getting it right…

    Naijcrackgist

    Loading…
    Reply
    1. Mba Christian Ihechi Avatar
      Mba Christian Ihechi
      June 12, 2017

      Wow. Interesting and it does work. Thank you for the trick.

      Loading…
      Reply
  9. fedex Avatar
    fedex
    June 13, 2017

    please i have been trying this on my website. please what could i be doing wrong. i followed it just the exact way you tutored

    Loading…
    Reply

WANT TO ADVERTISE?

Chat on WhatsApp

RELATED POSTS

  • Adsense Now Allows Placement of 320×250 Ad Banner Above The Fold On Mobile Pages
  • How To Hide A WordPress Widget On Mobile Devices
  • How To Determine Width of Image that will fit into Blog Header and Sidebar

FEATURED


  • CREDICORP launches C.L.I.C.K.D. Scheme with FG’s 3MTT Programme, expanding affordable consumer credit for locally-assembled laptops and devices for digital workers

    CREDICORP launches C.L.I.C.K.D. Scheme with FG’s 3MTT Programme, expanding affordable consumer credit for locally-assembled laptops and devices for digital workers

  • What Happens to Your Online Accounts When You Die?

    What Happens to Your Online Accounts When You Die?

JOIN AI WEB DESIGN GROUP


  • AI Website Design Training Whatsapp Group by Jidetheblogger

    AI Website Design Training Whatsapp Group by Jidetheblogger

← GiftCards.NG: Buy Amazon, PlayStation, iTunes Gift Cards Online in Nigeria
Adsense Now Allows Placement of 320×250 Ad Banner Above The Fold On Mobile Pages →

Join 25,000+ subscribers

Receive our latest blog posts in your inbox.

Search

Social

Facebook

Instagram

Twitter

new ogbongeblog logo

Copyright © 2026 | About | Advertise | Featured | Sitemap | Privacy Policy | Powered by WordPress

Your cart (items: 0)

Products in cart

Product
Details
Total
Subtotal ₦0.00
Shipping and discounts calculated at checkout.
View my cart
Go to checkout

Your cart is currently empty!

Start shopping

Notifications

%d

    LIKE My Fan Page

    Privacy Policy | Copyright © 2012,OgbongeBlog.All Rights Reserved. Powered by Blogger .
    Create a Mobile Site
    View Site in Mobile | Classic
    Share by: