I just signed up with an advertising agency that does vertical CPM campaigns (Only topic oriented sites qualify).
But their JS ad serving code is so much slower then f.i. adsense.
So I looked for solutions to load the content and then the ad jscript.
the best solution I found was to do :
[top of html where ad goes]
[bottom of html just before </body>]
<div id="topleftloader" style="display:none;">[ad jscript goes here]</div>
document.getElementById("topleft").innerHTML = document.getElementById("topleftloader").innerHTML;
This approach works great, the page loads very fast and then the ad follows afterwards like an image.
problem is that due to the display:none the ad gets served twice per pageview. So for instance my adsense backup tags are reporting 2x the pageviews.
I tried to insert the adcode directly
i.e. document.getElementById("topleft").innerHTML = [adcode]
Can anyone help me send the code to the div tag without having the browser load the ad twice for each single show?
[edited by: Rufal at 2:59 am (utc) on April 11, 2009]