If you serve your own advertisements using OpenX you are among the growing number of people that have taken control of their own ad serving platform. I have been using it on clients sites as well as my own sites for several years and have no plans of changing to any other system, OpenX has worked very well for me on small sites as well as high volume sites with thousands of ads.
What many people don’t know however is that by default OpenX wastes resources and slows down the loading of your pages and in some instances can cause your page load times to be so terrible that people will just move on to another site. I should clarify this a bit, it’s not the fault of OpenX as they do make available the option to rectify this, but its not a default thing and many people never look any further than the quickest and easiest way to serve your ads on your site.
If you install OpenX on your own server, you will likely be using a bit of code in each ad location that looks something like this:
var m3_u = (location.protocol==’https:’?’https://example.com/openx/www/delivery/ajs.php’:
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ‘,’;
document.write (‘&cb=’ + m3_r);
if (document.MAX_used != ‘,’) document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? ‘&charset=’+document.charset : (document.characterSet ? ‘&charset=’+document.characterSet : ”));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
//]]>–></script><noscript><a href=’http://example.com/openx/www/delivery/ck.php?n=a3832040&cb=132354835318351′ target=’_blank’><img src=’http://example.com/openx/www/delivery/avw.php?zoneid=11&cb=554851354385368516846843&n=a3832040′ border=’0′ alt=” /></a></noscript>
While this will work just fine, it’s not ideal as every single ad you serve has to be called from your server one at a time, if you have 10 125×125 ad banners in your sidebar, a banner in your header and 2 or 3 other ad placements on your site using this format can have a dramatic impact on your overall site performance.
The invocation code for single page call is handled at the website level within your OpenX installation, simply log into your admin section and click on Inventory, then websites and select the site you want to implement this on. Once you click on the site you want (if you have more than one there) you will see a row of tabs across the top, simply click where it says “invocation code” and select the options as you would normally and click generate.
Once generated you will be looking at a page containing all the codes for the zones you have set up for that site, it breaks them down by number and even shows you a box simulating the size and shape of the ad in that zone.
In order to implement this method of ad delivery you must insert a piece of code to your header that looks like this:
Then you insert the individual code for each zone in their respective locations, these codes will look something like this:
// ]]> –></script>
As you can see, this isn’t a terribly difficult process and the benefits can be dramatic. If you are using OpenX I strongly encourage you to use this method if you aren’t already. Any questions or comments, you know what to do.
Leave a Reply