Help Center > Manage Your Account > Serving Code

How can I serve multiple zones with a single server request?

If a page has multiple ad placements, this feature can speed up the ad delivery significantly. Instead of requesting an ad from the ad server for each placement, this approach uses a single call to the ad server to get all ads in one shot. Then each ad placement calls a JavaScript function to actually display the ad. Each ad is tracked separately for both impressions, clicks and other ad metrics. This method has 2 parts: preparing ads and displaying each ad.

Wizard

For your convenience, you can access the wizard interface from the menu Tools / Wizards to enter your own zones and the ad manager will generate your specific serving codes.

1. Preparing Ads

This code gets ads from multiple zones in a single call to the ad server. It should be placed in your HTML web page before any ad placement. It could be the HEAD element or just before the first ad placement in the page.
<!-- AdSpeed.com Serving Code 7.9.4 for 3 zones [Any Dimension] -->
<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zids=1234-2345-3456&wd=-1&ht=-1&target=_top"></script>
<!-- AdSpeed.com End -->
The parameter zids has multiple zone IDs separated by hyphens "-". For example: zids=123-456-789

2. Displaying each Ad

Each ad placement calls AdSpeed_display() to instantly display the prepared ad to the visitor's browser without any call to the external ad server.
<h1>FIRST AD PLACEMENT<h1>
<!-- AdSpeed.com Serving Code 7.9.4 for Zone #1234 [Any Dimension] -->
<script type="text/javascript">
AdSpeed_display(1234);
</script>
<!-- AdSpeed.com End -->

<h1>SOME PAGE CONTENT<h1>
Content Content Content

<h1>SECOND AD PLACEMENT<h1>
<!-- AdSpeed.com Serving Code 7.9.4 for Zone #2345 [Any Dimension] -->
<script type="text/javascript">
AdSpeed_display(2345);
</script>
<!-- AdSpeed.com End -->

<h1>SOME ADDITIONAL PAGE CONTENT<h1>
Content Content Content

<h1>THIRD AD PLACEMENT<h1>
<!-- AdSpeed.com Serving Code 7.9.4 for Zone #3456 [Any Dimension] -->
<script type="text/javascript">
AdSpeed_display(3456);
</script>
<!-- AdSpeed.com End -->

Multiple Ads per Zone

You can also use a single request to fetch multiple ads from a zone. The format uses a hyphen "-" as the zone separator and a letter "x" for the number of ads. Example: zids=1234-6789x2. This ad tag gets one ad for zone #1234 and gets 2 ads for zone #6789.
<!-- AdSpeed.com Serving Code 7.9.4 for 3 zones [Any Dimension] -->
<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zids=1234-6789x2&wd=-1&ht=-1&target=_top"></script>
<!-- AdSpeed.com End -->
To display all fetched ads of a zone:
<script type="text/javascript">
AdSpeed_multiple(6789);
</script>
To display individual ads from the zone:
<script type="text/javascript">
AdSpeed_display(6789,0); // first ad
</script>

SOME CONTENT IN BETWEEN ADS

<script type="text/javascript">
AdSpeed_display(6789,1); // second ad
</script>

See also

If you would like to delay ad display until all page contents have finished loading, you can use the defer solution.

Other Articles in Serving Code

Understand advanced ad serving settings for standard, pop-up/pop-under, and interstitial serving code
Search Help Center
There was a problem with your submission. Please correct the following items:

    Cannot find an answer for your question? Ask our Customer Care team

    Related Articles

    Have questions? Contact Us

    Testimonials for our Ad Servers

    • I have to say I am very impressed with the new version of your site. Great work!

      Chinedu E
      HopStop

    • I've signed up for the trial run but am confident that I'll continue. Great service!

      Wade W
      Cycling Tips Blog