Single Page Call is an invocation tag which can help reduce the load on your server and deliver ads faster. The single page call ad tag uses a JavaScript invocation method to makes one HTTP request no matter how many creatives are being displayed on a page, rather than each request being made sequentially and slowing down your page load times. This tutorial is a quick guide on how you can start using Single Page Call (SPC) and get your pages loading as fast as possible.
Quick guide
The invocation code for single page call is set at the Website level of the OpenX user interface.
- From the Website Properties screen, click on the Invocation Code tab. You will be taken to the Tag settings screen:
- Choose your Tag settings (for a full list of these, click here)
- Click ‘Generate’
- A new window opens detailing your Header script and your Ad script. The Header script should be inserted at the top of every page on the selected website. Copy and paste the Ad script into the ad tag HTML at the point(s) where you want the ad to display.

Note: If you wish to repeat the same zone more than once in a page, ensure the array indexes in your ‘named zones array’ are unique or no creatives will be displayed.
Displaying a grid of ads with single page call
Next, lets look at how to create a grid of ads in the same zone on your web page using single page call. This is the most efficient way of doing this, as only one HTTP request will be made to your ad server, thus speeding up the page load time.
There are two steps in this process:
- Name each zone by creating a named zone array using any naming convention you wish. For example 'zone_[zone_id]'.
- Use this unique name each time you use the ad-zone call.
1. Creating a named zone array
Create an array above the main script tag to place in your website’s header.
Start with:
<script type='text/javascript'><!--// <![CDATA[
var OA_zones = {
'zone_4235_1' : 4235,
'zone_4235_2' : 4235,
'zone_4235_3' : 4235,
'zone_3906' : 3906,
'zone_1251' : 1251,
'zone_9632' : 9632
}
// ]]> --></script>
<script type='text/javascript' src='http://example.com/delivery/spcjs.php'></script>
Note: In the above example ‘zone_3906’ is the name. (Any name can be used using basic characters, but you need to chose one. It does not need to match a name used within OpenX.) Also make sure the name is within the quote marks. In this example ‘3906’ is the [zone_id]. Replace this with the zone id relevant to the web page you are working on.
Note: The last zone entry does not have a comma ',' character at the end of the line.
Note: If you wish to use the same zone ID several times on a single page, you must define several zone names for the desired zone ID, for example: 'zone_4235_1', 'zone_4235_2', 'zone_4235_3'.
2. Using the zone name in the ad-zone call
In the body of your website template, pass OA_show() the unique name you defined for each zone in the zone array:
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_1');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_2');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_3');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_3906');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_1251');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_9632');
// ]]> --></script>
Note: When using named zones, only the specified zone names can be passed to the OA_show() function
3. Practical example of proper Single Page Call usage.
As a result your website code should be filled with the above code in the following way.
Example of using Single Page Call in a HTML template:
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Example usage of Single Page Call tags/title>
<script type='text/javascript'><!--// <![CDATA[
var OA_zones = {
'zone_4235_1' : 4235,
'zone_4235_2' : 4235,
'zone_4235_3' : 4235,
'zone_3906' : 3906,
'zone_1251' : 1251,
'zone_9632' : 9632
}
// ]]> --></script>
<script type='text/javascript' src='http://example.com/delivery/spcjs.php'></script>
</head>
<body>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_1');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_2');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_4235_3');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_3906');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_1251');
// ]]> --></script>
<script type='text/javascript'><!--// <![CDATA[
OA_show('zone_9632');
// ]]> --></script>
</body>
</html>
Further reading:
General guide: Single page call.
Example of how to place SPC tags so they are the last to load on a page: the Need for Speed See this forum thread for information on passing targeting data into the single page tag.




