Help Center Manage Your Account AdSpeed API

Zone

Documentation for API methods to manage one or multiple zones.

API Version

1.2.7 (build 20161201). This page was updated on Thu, 01 Dec 16 15:11:06 -0500. Since the API method and response format can change from one version to another, you should check this page for updates.

API Methods - Zone

AS.Zones.getCounts

Returns the number of active, deleted and total zones for this publisher or ad network
Parameters
  • None
Sample Request
Sample Response
<Zones total="4" active="4" deleted="0"/>

AS.Zones.getList

Returns the list of zones for this publisher or ad network
Parameters
  • perpage Optional, default value is "10"
    The number of items per page. Maximum value is 100.
  • page Optional, default value is "1"
    The page number
Sample Request
Sample Response
<Zones total="4" page="1" numpage="1" perpage="4">
  <Zone id="7549" name="Section Travel" status="active"/>
  <Zone id="7607" name="Homepage" status="active"/>
  <Zone id="7681" name="Section Music" status="active"/>
  <Zone id="20852" name="Newsletter 468x60 Ad" status="active"/>
</Zones>

AS.Zones.create

Create a new zone for this publisher or ad network. Submit via POST. Limit 50 calls/day.
Parameters
  • name Required
    The name of this zone
Sample Request
Sample Response
<Zone id="888" name="SomeZone" status="active"></Zone>

AS.Zone.getInfo

Returns the list of linked ads for this zone
Parameters
  • zone Required
    The zone ID
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
Sample Request
Sample Response
<Zone id="7607" name="Homepage" status="active">
  <Description>Home page of a demo website</Description>
  <Ads total="4">
    <Ad id="35093" name="Sample Text Ad" status="pending"/>
    <Ad id="40631" name="Sample Rich HTML Ad" status="pending" width="300" height="250"/>
    <Ad id="54412" name="Sample Text Link Ad" status="pending"/>
    <Ad id="54937" name="Sample Rich HTML Ad 2" status="active" width="300" height="250"/>
  </Ads>
</Zone>

AS.Zone.edit

Edits a setting of a zone
Parameters
  • zone Required
    The zone ID
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
  • name Optional, default value is empty
    Sets the zone name
  • optimizer Optional, default value is empty
    Sets the ad optimization type for all linked ads of this zone. Available type: "none", "click", "revenue", "conversion", "CTR"
Sample Request
Sample Response
<Zone id="7607" name="Homepage" status="active">
  <Description>Home page of a demo website</Description>
  <Ads total="4">
    <Ad id="35093" name="Sample Text Ad" status="pending"/>
    <Ad id="40631" name="Sample Rich HTML Ad" status="pending" width="300" height="250"/>
    <Ad id="54412" name="Sample Text Link Ad" status="pending"/>
    <Ad id="54937" name="Sample Rich HTML Ad 2" status="active" width="300" height="250"/>
  </Ads>
</Zone>

AS.Zone.getAdTag

Returns the ad tag for this zone
Parameters
  • zone Required
    The zone ID to get ad tag
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
  • width Required
    The ad width in pixels
  • height Required
    The ad height in pixels
  • format Optional, default value is empty
    The format of ad tag (comprehensive, iframe, javascript, or simplified)
  • spot Optional, default value is empty
    The ad spot number (for competitive or companion positioning)
  • num Optional, default value is empty
    The number of ads to display together
  • custom Optional, default value is empty
    Custom parameters (should be encoded properly, eg: & is %26)
Sample Request
Sample Response
<Zone id="7607" name="Homepage" status="active">
  <ServingCode type="regular" format="lite">
    <!-- AdSpeed.com  Tag 8.0.2 for [Zone] Homepage 468x60 -->
    <script type="text/javascript"><![CDATA[
	var asdate=new Date();var q='&amp;tz='+asdate.getTimezoneOffset()/60 +'&amp;ck='+(navigator.cookieEnabled?'Y':'N') +'&amp;jv='+(navigator.javaEnabled()?'Y':'N') +'&amp;scr='+screen.width+'x'+screen.height+'x'+screen.colorDepth +'&amp;z='+Math.random() +'&amp;ref='+escape(document.referrer.substr(0,255)) +'&amp;uri='+escape(document.URL.substr(0,255));document.write('<ifr'+'ame width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&amp;zid=7607&amp;oid=111&amp;wd=468&amp;ht=60&amp;target=_blank{AdSampleMacros}'+q+'" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"></ifr'+'ame>');
	]]></script>
    <noscript>
      <iframe width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&amp;zid=7607&amp;oid=111&amp;wd=468&amp;ht=60&amp;target=_blank{AdSampleMacros}" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0">
        <a href="http://g.adspeed.net/ad.php?do=clk&amp;zid=7607&amp;oid=111&amp;wd=468&amp;ht=60&amp;pair=as" target="_blank">
          <img style="border:0px;max-width:100%;height:auto;" src="http://g.adspeed.net/ad.php?do=img&amp;zid=7607&amp;oid=111&amp;wd=468&amp;ht=60&amp;pair=as" alt="i" width="468" height="60"/>
        </a>
      </iframe>
    </noscript>
    <!-- AdSpeed.com End -->
  </ServingCode>
</Zone>

AS.Zone.serve

Deprecated. Returns an ad from this zone in XML format. Please note that this method is designed for advanced/customized ad serving (eg: native advertising or mobile advertising). For a faster approach, you can get an ad from a zone via a direct call URL that returns XML/JSON. Please contact us for details.
Parameters
  • zone Required
    The zone identification
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
  • width Required
    The ad width in pixels
  • height Required
    The ad height in pixels
  • spot Optional, default value is empty
    The ad spot (for non-duplicate, competitive and companion positioning ads)
  • num Optional, default value is empty
    The number of ads to be served per single ad tag
Sample Request
Sample Response
-

AS.Zone.getStats

Returns the stats for this zone. Limit 50 calls/day.
Parameters
  • zone Required
    The zone ID
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
  • metric Required
    The time period can be "hourly", "daily", "weekly", "monthly"
Sample Request
Sample Response
<StatRows generated="[Time Stamp]" title="[Entity Name]">
  <StatRow>
    <Monthly>January 2014</Monthly>
    <Unique_Impression>3,156</Unique_Impression>
    <Gross_Impression>6,565</Gross_Impression>
    <Unique_over_Gross_Impression>48.07%</Unique_over_Gross_Impression>
  </StatRow>
  <StatRow>More Rows...</StatRow>
  <StatRow>
    <Monthly>Total</Monthly>
    <Unique_Impression>57,417</Unique_Impression>
    <Gross_Impression>114,979</Gross_Impression>
    <Unique_over_Gross_Impression>49.94%</Unique_over_Gross_Impression>
  </StatRow>
  <StatRow>
    <Monthly>Average</Monthly>
    <Unique_Impression>4,785</Unique_Impression>
    <Gross_Impression>9,582</Gross_Impression>
    <Unique_over_Gross_Impression>49.94%</Unique_over_Gross_Impression>
  </StatRow>
</StatRows>

AS.Zone.getVisitorStats

Returns the visitor report for this zone. Limit 50 calls/day.
Parameters
  • zone Required
    The zone ID
  • token Required
    The authentication MD5 hash generated from concatenating [Zone ID][Zone Name]
  • metric Required
    The type of metric can be "countries", "continents", "areas", "timezones", "regions", "languages", "browsermajor", "browserminor", "os", "ua", "screen", "java", "cookie"
  • range Required
    The range can be "alltime"
Sample Request
Sample Response
<StatRows generated="[Time Stamp]" title="[Entity Name]" range="Alltime" metric="countries">
  <StatRow>
    <Rank>1</Rank>
    <Country>United States</Country>
    <Flag/>
    <Percentage>95%</Percentage>
  </StatRow>
  <StatRow>
    <Rank>2</Rank>
    <Country>Canada</Country>
    <Flag/>
    <Percentage>5%</Percentage>
  </StatRow>
</StatRows>

Other Articles in AdSpeed API

Documentation to use AdSpeed API to integrate AdSpeed AdServer into your own platform.

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

Related