Hello everyone! Although it is The Holidays, the internet never sleeps. Instead, its more like a gentle snooze on the couch while holiday movies play in the background. This might be a good time to take advantage of the Big Snooze as people like to call it (or they soon will, because everyone follows my lead) and to update your copies of OpenX (or start using OpenX Hosted with the OpenX Market!) and to make sure your site is optimised and using the best invocation tag type for your needs! Yaaaaaay!
The subject for today pertains to the different types of tags you have in OpenX for delivering banners and how they relate to speed. Also included is a worked example of how to invocate your banners at the bottom of your pages and then re-position them once content has loaded.
First, lets try and clear up the types of invocation tags:
Please read the full comparison of invocation tags.
OpenX provides Image, Javascript, iFrame, XML-RPC, Local Mode and Single Page Call invocation tags. There’s choices a-plenty, as you can see. But don’t let this confuse you!
An Image tag is the barebone basic - it requires a cookie and can only deliver image banners (not SWFs or other HTML).
Javascript and iFrame tags are probably the most commonly used and are very versatile. The iFrame tag has the benefit that the content is loaded separately to the rest of the site - so if the banner is slow to load, it won’t delay the rest of the page from loading. However an iFrame tag does not allow for blocking banners or campaigns from displaying more than once per page. Also, because of browser security limitations they can’t be resized dynamically - meaning expandable banners won’t work well here.
Single Page Call is basically the new Javascript tag, available in OpenX versions 2.6 and above. It allows you to place one javascript call in the head of your page, which will call all of your zones or whichever ones you define. Then, you simply mark in your page where you want the zones to be used. Make sure to read the tutorial, and pay special attention to the Named Zones feature. If you don’t name exactly which zones you want to use, it will invocate all zones for the website account being used whether those zones are being displayed or not.
XML-RPC and Local Mode tags are the advanced ones. They request the banner before the page is generated, which gives some interesting possibilities. XML-RPC also allows for greater flexibility with integrating banners in applications other than a standard HTML page, since all banner information is returned in XML. There are tutorials specific to these 2 tags because they are more complicated to implement: documentation index.
So what about speed?
Please keep in mind that there are different ways to define speed. First off, obviously it is the name of a famous Emmy award-winning film (did it win an Emmy? If not an Emmy, it did win an award… in my heart).
But speed in terms of page loading is not simply defined by the size of the page (10kb versus 3mb) or even the time it takes to load (although both are important). It is largely based on how fast it appears to be. This is influenced by the full size and complete page load time, but if you take 2 pages which are both 88kb and take 88 seconds to load you might find yourself visiting both of them and thinking that websiteB loads much faster than websiteA. This is because websiteB is my website and I’ve built it so that all small-but-important content is allowed to load first, followed by larger-but-important media, followed by banners, and then followed by frivolous animated “Have-a-grrrrrreat-day” GIFs (with neat dancing tigers).
So now lets talk about the banner tags and how they will affect your page speed.
To start, if you are only displaying image banners then the Image tag is a great choice, naturally. And if you just want a single, non-rotating image banner then using a cookieless Image tag with an email zone is a great way to go. These are both very simplistic, but they get the job done for such requirements.
If your website is on the same server and domain as OpenX, and the website can execute PHP code, then using Local Mode is quite a speedy option as it simply requires including a PHP file and then calling a function to request the banner.
If you want your banners to load separately from your website, then using iFrame tags is recommended. However, remember that to some people iFrame tags may *look* slower simply because the rest of the page will load separately.
And finally, javascript gives a good combination of versatility and features. Single Page Call allows you to take advantage of this and adds a speedy delivery.
But wait - there’s more. You could place banners at the bottom of your HTML page (after all content) and then use javascript to reposition the banners. What this does is give the rest of the content higher priority and it will have a better chance of being loaded first.
To help with this, please see this worked example for End of Page delivery: eop-example.
Inside the zip file is an HTML page with 2 spots for banners, as well as some fascinating content. At the bottom of the page are 2 invocation tags as well as a call to a javascript function which will reposition the 2 banners to appear above where they are meant to. The javascript file can most likely be kept as-is.
What other things can you do to help speed?
Caching is important. OpenX has built-in caching which limits calls to the database - in a production environment you might want to increase the cache time used by your installation. You might also want to install a caching system for PHP on your server.
Keep in mind what 3rd parties you are using for banners. If you are using external image banners or 3rd party HTML banners, not only must OpenX deliver the banner but the 3rd party must then deliver the image/HTML. Sometimes such external sources can be slow to load and should be kept in mind when analyzing speed.
Also, using additional features will have a slight impact on speed, try not to use unnecessary targeting/delivery features for absolute best performance.
Well, it’s been a blast! (no pun intended… Get it? Speed.. movie with a bomb… a blast? Ok, so the pun was intended, it just wasn’t very good). Make sure to check out the previous Tips and Tricks and also let us know what tips you have for speedy-page-loading.