5ThirtyOne



Preventing content from "shifting" for Adblockers

Mar 13th 2007
27 Comments
respond
trackback

Consistent page with or without ads

Anyone who inserts contextual advertisements into their pages - like Google Adsense - are aware of the fact that some readers block advertisements. Oftentimes, methods for removing advertisements from view alter the structure of a page, in turn, changing the layout. For some websites or blogs, this does not pose a problem. For websites created to present both content and advertisements in harmony, removing ad elements may have a negative impact on a pages layout.

Ultimately, the author controls layout

Contrary to what some readers [would like to] believe, the author ultimately controls how content is displayed on a site. The author also reserves the right to present advertisements [hopefully, in a tasteful manner]. The argument for both sides of the fence is lengthy and one which this post does not address. What we will address is the use of simple HTML/CSS to designate advertisement elements. Areas of a page which do not collapse are disappear from view using rudimentary adblocking tools like Firefox’s Adblock extension.

Prevent the adblock "shift"

When users remove standard advertisement scripts from view, the ad element collapses moving surrounding elements. In order to control the layout of a page from shifting, I wrap the ad script with a div which I then apply a fixed width & height to using CSS. I also add a "title" to the div to let readers with adblocking enabled know what is missing.

1px bordered Adsense block

The corresponding HTML for a 468×60 text link Google Banner might look like:

<div id="adsense_468">
<p id="adtitle">Advertisement</p>
<center>...INSERT ADSENSE CODE...</center>
</div>

With a few lines of CSS, add a fixed width & height to the #adsense_468. Similar to the advertisement presentation for the Grid Focus, we’ll also add a 1px border and use position: absolute; to move the title to the top right corner.

#adsense_468 { width: 495px; height: 70px; border: 1px solid #BBB; padding-top: 5px; position: relative; }
#adsense_468 #adtitle { font-size: 11px; position: absolute; display: block; background: #FFF; padding:0 3px; top: -8px; right: 12px; }

The question now is, who out there is adblocking? Come clean! ;)

Take Care of your Hosting Issues

Worried that you are paying to much for your hosting? Get the best website hosting available. They can also take care of your domain registration needs, making it easier than ever to host a site without breaking the bank.



27 Comments

  1. I wish I could set ad-blocking up for specific sites, but sadly I cant so the ad-blocker stays off for me. I like some websites ad’s such as 531, Subtraction, Phill Ryu, etc.

  2. I don’t use adblock unless you have one of those
    “shoot the monkey” flash ads

  3. Michael

    \o_ .o(”I do”)

  4. Nope, no adblock here. I hate just seeing chunks of webpages missing.

  5. I agree with Andre- adblocking makes some pages look funny with chunks missing. So, why enforce one?

    Even if there is no shifting going on, there is now a big block of empty space!

  6. No adblocking here as well. Sometimes, and that really not often, some ads can be usefull even.

  7. I don’t adblock due to pages looking weird. I’ve tried it in the past and found the missing gaps more annoying than the ads.

  8. I use OmniWeb’s built-in adblocker, and everything looks fine, it just covers up the ad, rather than messing up the page.

  9. You’ve inspired me to finally add ad’s to my site (in an unobtrusive way, of course)!

  10. Making contextual ads actually look nice has to be the holy grail of any business-savvy designer. :) Since someone has to ask, can I be so intrusive to ask what is your CTR by any chance, Derek? I’m quite interested…

  11. No adblocking here, either. They don’t usually bother me. Unless they blink, make noise or obscure the content; then I vote with my “feet” and don’t visit again.

    And I clicked on one of your google ads for good measure. :-]

  12. I adblock like it’s nobodies business.

  13. Myles

    I adblock. Ads suck no matter how they’re presented. They’re annoying & they’re everywhere. Why would I want to see them on your site compared to Yahoo’s site? They’re just as annoying regardless of where they’re at, what site they’re on, or how they’re presented.

    Don’t take it personally.

  14. is there a way to kicking out adblock?

  15. Adblock is client side. Not much anyone can do to prevent visitors from blocking advertisements using web browser plugins.

  16. Myles

    Adblock is client side. Not much anyone can do to prevent visitors from blocking advertisements using web browser plugins.

    Thank God.

  17. Thank God indeed. The day websites can control what we do through our browsers is the end of it all. I even hate when Javascript resizes my browser window.

  18. Adblock is client side. Not much anyone can do to prevent visitors from blocking advertisements using web browser plugins.

    One…You (the user/client) can disable Adblocking for certain sites that you trust.

    Two.. As a site owner YOU can um force people to see the ads you serve by making them part of your regular content Buy Pepsi! as opposed to hosting them in www adspace bannerserver.com - There IS a bulletproof way, but I wont say it here since I hate ads!

  19. I do block some ads since i am on 56k and it can drag sites down badly. some ads i dont mind but flash must die

  20. I recently was at a client looking at my site behing their firewall and the ads all had a “Not Perimitted” box over every ad. How disappointing this is and I wonder how common it is?

  21. Ernest

    Adblock is client side. Not much anyone can do to prevent visitors from blocking advertisements using web browser plugins.

    One…You (the user/client) can disable Adblocking for certain sites that you trust.

    Two.. As a site owner YOU can um force people to see the ads you serve by making them part of your regular content Buy Pepsi! as opposed to hosting them in www adspace bannerserver.com - There IS a bulletproof way, but I wont say it here since I hate ads!

    That method really sucks though. Nothings bulletproof, and you cant do alot to stop adverts. They gonna find you one way or another.

  22. I wish I could set ad-blocking up for specific sites, but sadly I cant so the ad-blocker stays off for me. I like some websites ad’s such as 531, Subtraction, Phill Ryu, etc.

    For everyone who was saying anything about liking certain ads… There is the ability to add exceptions to your filter.
    Example:

    type “@@http://*5thirtyone.com/*” into your filter for adblock, and it will allow everything to display on this site.

  23. without the quotes of course.

  24. Adblock does offer the option to whitelist pages or entire domains from a contextual menu. Right-click on the Adblock text in your status bar and choose one of the options. Works the same as your tip J0be with less typing.

  25. bmk

    I block every ad I can. If a page isn’t pretty, so what? If I want “pretty”, I’ll go to an art gallery. If a page isn’t readable because the “missing” ads make it unreadable, I chalk it up to poor web design and move on to a usable link.

Incoming Links



Leave a Reply

Comments may be held for moderation. If your comment does not appear immediately, do not repost. I reserve the right to remove any inappropriate or off-topic comments. Please use the forum if your comment is not appropriate for the current article.

Flickr Visit »

  • Vacuum packaged
  • Pre-inflation
  • Covered
  • Compressed filling
  • Filler beat down
  • Airing out
  • Arrived via Fedex
  • SumoSac corner
  • Oddly simple to understand
  • MBA + Dell
  • Boo's new bed
  • Seen in Ballard
  • Warehouse
  • Shadowed
  • Detach washer from bumper
  • Wiring test
  • Grill delete
  • Almost
  • Dremel time
  • Supplies