openx Correctly using Single Page Call

http://www.openxtips.com/2009/03/tip-2-correctly-using-single-page-call/

 

When OpenX version 2.6 was released, the OpenX ad server gained a new feature called Single Page Call. If you’ve got more than one banner on a page, then Single Page Call can be one way to get more performance out of your OpenX installation.

The way OpenX generally works is that for every position on your website that you want to display advertising, you set up what’s called a “zone” in OpenX. For every one of these zones, you then generate the zone’s “zone tag” (sometimes called an “invocation code tag”), and you  put these tags into your page’s HTML source where you want the banners to display.

When your site is viewed, each zone tag in your site’s HTML makes a call off to your OpenX ad server, OpenX figures out what banner to show, and then sends it back, ready for display. So, if you have more than zone on a page, this means that you are going to be making more than one call to your OpenX ad server per page view.

The Single Page Call system, though, means that you can make just the one call off to your OpenX ad server to get all of the banners for the page, no matter how many zones you want to display. Fewer calls means less load on your ad server, and also means faster load times for your website.

You can find more information about generating the Single Page Call tag in the OpenX documentation. (The process in OpenX 2.7-beta is slightly different from that in OpenX 2.6, but unfortunately the OpenX 2.7-beta documentation doesn’t seem to be available from OpenX yet.)

However, what may not be immediately obvious from the OpenX documentation is that because OpenX’s Single Page Call code is generated at the website level, this means that the code will, by default, retrieve a banner for every zone configured in the website.

If you always display all of the zones on every page, then there’s no problem at all; but if you have many zones, and you don’t display every zone on every page, then using the Single Page Call code without modification will have two consequences.

Firstly, as you can probably imagine, the performance of your OpenX installation and your website will suffer. Asking OpenX to decide which banner to display for a given zone, and then having to transfer the banner display code for said banner, when you’re not even going to display it, is somewhat wasteful.

Secondly, if you have configured OpenX to log requests as well as impressions, you will notice that your requests are much higher than your impressions, because you are requesting banners that you then don’t even attempt to display. This often leads to concerns that perhaps there is something wrong with your OpenX installation, or that there is some reason why your impression values are “wrong” — when in fact, there’s nothing wrong at all, other than the fact you’re requesting banners that are never going to be used.

To improve performance, and to ensure that your request logging is correct, The Guru recommends that you use the “Advanced Usage” feature that is on the OpenX Single Page Call documentation. That is, if you are not going to display all of the zones defined for a website, and you are going to use the Single Page Call code, then you should define the OA_zones variable in JavaScript in the HTML header before your first Single Page Call code block, to limit the zones OpenX will request and return banners for.

For example, if your website has 5 zones defined (say they have zone ID values 1 through 5), and you are only going to display zone ID 1 and zone ID 4 on a page, then, you’d put the following code into your HTML header:

<script type='text/javascript'><!--// <![CDATA[
    var OA_zones = {
      'zone1' : 1,
      'zone4' : 4
    };
// ]]> --></script>

This code should be just above the “header script” part of the Single Page Call code, and of course, as per the OpenX documentation, you’ll need to change all of the “OA_show()” calls to match the names defined above — that is, when placing the “ad script” for zone ID 1 into your page, change the “OA_show(1)” to “OA_show(‘zone1′)”, and similarly for the “ad script” code for zone ID 4.

It may take a little bit of effort to implement, but the improved performance and more accurate statistics are well worth the effort.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值