Can you lazy-load ads?

I was wondering if anyone has come across or personally looked at lazy-loading ads?

Take for example, a leaderboard at the top of a page. It uses a <script> tag which almost certainly does a document.write to put the leaderboard in that spot.

Problem is, if their server is slow at responding it will slow down the entire page from loading…

Has anyone been able to lazy-load ads without having any issues with, for example, the tracking pixels?

Thanks!

For the leader board you could initially leave the space blank and then put the banner in a position: absolute; wrapper and put that at the bottom of the page.

Very crude example:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Banner test</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <style type="text/css">
    #content {
      margin-top: 200px;
    }
    #header {
      position: absolute;
      top: 0;
      left: 0;
      height: 200px;
    }
  </style>
</head>
<body>
<div id="content">
  Content content content content
</div>
<div id="header">
  <script type="text/javascript" src="http://my.ad.server/path/to/ad/script.js" />
</div>
</body>
</html>

That’s not exactly lazy-loading, but it will wait with loading the banner until the rest of the page is loaded.
I’m not sure if ad providers allow this btw, you might want to check that.

Ya, unfortunately that basically ONLY works for the leaderboard…

We have a number of ad spots, and at least 1 other ad spot comes in before the heart of the content…

Thought about loading them in footer than inserting into a predefined spot, but I worry that it’s possible we’ll have issues with double-tracking or even missed tracking, which would be BAD :frowning:

Yep, it sucks. Our sales people love their ads and its just a price you pay. We use Yahoo and it seems like there is no other alternative.

I have attempted to augment the Yahoo API and all I have been ever able to do is load a single ad using my very convoluted method. I was essentially trying the change ads when an new page was loaded with AJAX a while back so was looking for a similar solution to what you are but with no luck. The problem always seems to boil down to dynamically included scripts. Haven’t looked at since though because impressions are most important over behavioral enhancement.

I haven’t looked into the issue in a while but what you may want to experiment with is using an iframe that links to a page with just the ad. That way I believe it could be changed (reloading the iframe page) while keeping the parent page (page with the useless info) intact. That is something I have been meaning to experiment with but haven’t got around to.