Version 5.0
AdvertServe User Manual :: v5.0

Code Wizard :: Prefetch API Module

Modules

Banner Tags

Description

Allows you to prefetch a unique collection of banner tags, which can later be displayed in your application. The act of prefetching the banners does not generate any statistics. Thus it is safe to prefetch a large number of ads, which is useful in situations where you don't want to have repeat banners. You can simply prefetch a batch of ads, run through them and when you run out prefetch another batch.

Module URI

Hyperlink /servlet/view/banner/prefetch

Parameters

Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
pidIntegerNo123 Must be the ID# of an existing publisher
zidIntegerYes123 Must be the ID# of an existing zone
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
outputStringNojson This option can be used to specify either json (default) or xml output.
tagStringNoscript This option allows you to specify whether you want to receive script (default), iframe or image tags to load the banners. If you choose the image type only GIF/JPG/PNG banners will be returned. Special effects such as the crawler or lightbox are limited to working with the script type as well.
totalIntegerYes10 The number of banners that you wish to prefetch, which must be greater than or equal to 1
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
contextualbooleanNofalse This option if true enables extraction of keywords and phrases from pages where the generated code will be published. Campaigns may then be targeted to any keywords or phrases in those pages. The most relevant keywords are also analyzed and retained for reporting. Please be aware, however, that it is suggested you avoid from using this option on dynamic pages which have frequently changing content to prevent slow loading of pages and campaigns.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
custom[1-10]StringNo[custom1] Must be a String that will be used for custom field targeting.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
echobooleanNofalse This option if true will enable pass-through variables for use.
echo_name[1-5]StringNosite_id Must be a String containing only letters, numbers or underscores. Be careful to choose a name that does not conflict with any pre-existing variables. It will result in a validation error if such a name is chosen.

The custom macro that is created for use in the creative or redirect will be equal to %%NAME%% where NAME is always written in uppercase.
echo_value[1-5]StringNo{site_id} Must be a String that will be used as a placeholder for the actual variable that will be passed by the publisher.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
effectStringNocrawler Must be a String equal to one of the following values if {effects} is true:
  • adhesion
  • castaway
  • crawler
  • lightbox
  • overlay
  • shoutbox
  • smokescreen
alignStringNocenter Must be a String equal to one of the following values:
  • left
  • center
  • right
Only applicable to the crawler and shoutbox.
anchorStringNoid Must be a valid DOM id attribute value. Only applicable to the smoke screen.
autocloseIntegerNo15 Must be an Integer between 1 and 600. Only applicable to the castaway, lightbox, overlay and smoke screen.
bgcolorStringNo#E0E0EB Must be a valid HTML color name or hexadecimal code (i.e. #FFFFFF). Only applicable to the crawler and overlay.
closeablebooleanNofalse This option if true will render a close button on the top right corner of the crawler or shoutbox.
paddingIntegerNo10 Must be an Integer between 0 and 99. Only applicable to the crawler and overlay.
placementStringNobottom_center Must be String equal to one of the following values and only applicable to the adhesion.
  • top_left
  • top_center
  • top_right
  • left_center
  • right_center
  • bottom_left
  • bottom_center
  • bottom_right
politebooleanNofalse This option if true will cause the adhesion, castaway, crawler, lightbox, overlay, shoutbox or smoke screen to remain hidden for the current browsing session if closed by a user provided that the closeable has also been set to true to enable the close button.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
keywordsCSVNored,green,blue Must be a CSV list of keywords and/or phrases that you wish to target.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
referrerURLNoN/A Allows you to pass the current page URL being displayed in the browser application to the ad server, which may be required if contextual targeting is enabled.

XML Response

Hyperlink /servlet/view/banner/prefetch?zid=123&total=3&tag=script&output=xml


<tags>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/banner/javascript/media?mid=7&cid=6&pid=0&zid=123&random=81412910&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/banner/javascript/media?mid=5&cid=136&pid=0&zid=123&random=44847222&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/banner/javascript/media?mid=9&cid=8&pid=0&zid=123&random=16491015&millis=20160512120840"></script>]]></tag>
</tags>

JSON Response

Hyperlink /servlet/view/banner/prefetch?zid=123&total=3&tag=script&output=json


{ "tags" : [
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/banner/javascript/media?mid=5&cid=137&pid=0&zid=123&random=80384411&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/banner/javascript/media?mid=9&cid=8&pid=0&zid=123&random=43438806&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/banner/javascript/media?mid=5&cid=136&pid=0&zid=123&random=32981826&millis=20160512121115\"><\/script>"
]}

Dynamic Tags

Description

Allows you to prefetch a unique collection of dynamic media tags, which can later be displayed in your application. The act of prefetching the dynamic media does not generate any statistics. Thus it is safe to prefetch a large number of ads, which is useful in situations where you don't want to have repeat dynamic media. You can simply prefetch a batch of ads, run through them and when you run out prefetch another batch.

Module URI

Hyperlink /servlet/view/dynamic/prefetch

Parameters

Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
pidIntegerNo123 Must be the ID# of an existing publisher
zidIntegerYes123 Must be the ID# of an existing zone
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
outputStringNojson This option can be used to specify either json (default) or xml output.
totalIntegerYes10 The number of dynamic media that you wish to prefetch, which must be greater than or equal to 1
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
contextualbooleanNofalse This option if true enables extraction of keywords and phrases from pages where the generated code will be published. Campaigns may then be targeted to any keywords or phrases in those pages. The most relevant keywords are also analyzed and retained for reporting. Please be aware, however, that it is suggested you avoid from using this option on dynamic pages which have frequently changing content to prevent slow loading of pages and campaigns.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
custom[1-10]StringNo[custom1] Must be a String that will be used for custom field targeting.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
echobooleanNofalse This option if true will enable pass-through variables for use.
echo_name[1-5]StringNosite_id Must be a String containing only letters, numbers or underscores. Be careful to choose a name that does not conflict with any pre-existing variables. It will result in a validation error if such a name is chosen.

The custom macro that is created for use in the creative or redirect will be equal to %%NAME%% where NAME is always written in uppercase.
echo_value[1-5]StringNo{site_id} Must be a String that will be used as a placeholder for the actual variable that will be passed by the publisher.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
keywordsCSVNored,green,blue Must be a CSV list of keywords and/or phrases that you wish to target.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
referrerURLNoN/A Allows you to pass the current page URL being displayed in the browser application to the ad server, which may be required if contextual targeting is enabled.

XML Response

Hyperlink /servlet/view/text/prefetch?zid=123&total=3&output=xml


<tags>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/dynamic/javascript/media?mid=7&cid=6&pid=0&zid=123&random=81412910&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/dynamic/javascript/media?mid=5&cid=136&pid=0&zid=123&random=44847222&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/dynamic/javascript/media?mid=9&cid=8&pid=0&zid=123&random=16491015&millis=20160512120840"></script>]]></tag>
</tags>

JSON Response

Hyperlink /servlet/view/text/prefetch?zid=123&total=3&output=json


{ "tags" : [
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/dynamic/javascript/media?mid=5&cid=137&pid=0&zid=123&random=80384411&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/dynamic/javascript/media?mid=9&cid=8&pid=0&zid=123&random=43438806&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/dynamic/javascript/media?mid=5&cid=136&pid=0&zid=123&random=32981826&millis=20160512121115\"><\/script>"
]}

Text Tags

Description

Allows you to prefetch a unique collection of text ad tags, which can later be displayed in your application. The act of prefetching the text ad does not generate any statistics. Thus it is safe to prefetch a large number of ads, which is useful in situations where you don't want to have repeat text ads. You can simply prefetch a batch of ads, run through them and when you run out prefetch another batch.

Module URI

Hyperlink /servlet/view/text/prefetch

Parameters

Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
pidIntegerNo123 Must be the ID# of an existing publisher
zidIntegerYes123 Must be the ID# of an existing zone
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
outputStringNojson This option can be used to specify either json (default) or xml output.
totalIntegerYes10 The number of text ads that you wish to prefetch, which must be greater than or equal to 1
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
contextualbooleanNofalse This option if true enables extraction of keywords and phrases from pages where the generated code will be published. Campaigns may then be targeted to any keywords or phrases in those pages. The most relevant keywords are also analyzed and retained for reporting. Please be aware, however, that it is suggested you avoid from using this option on dynamic pages which have frequently changing content to prevent slow loading of pages and campaigns.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
custom[1-10]StringNo[custom1] Must be a String that will be used for custom field targeting.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
echobooleanNofalse This option if true will enable pass-through variables for use.
echo_name[1-5]StringNosite_id Must be a String containing only letters, numbers or underscores. Be careful to choose a name that does not conflict with any pre-existing variables. It will result in a validation error if such a name is chosen.

The custom macro that is created for use in the creative or redirect will be equal to %%NAME%% where NAME is always written in uppercase.
echo_value[1-5]StringNo{site_id} Must be a String that will be used as a placeholder for the actual variable that will be passed by the publisher.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
keywordsCSVNored,green,blue Must be a CSV list of keywords and/or phrases that you wish to target.
Parameter NameParameter TypeRequired?Example ValueValidation Rules (If Applicable)
referrerURLNoN/A Allows you to pass the current page URL being displayed in the browser application to the ad server, which may be required if contextual targeting is enabled.

XML Response

Hyperlink /servlet/view/text/prefetch?zid=123&total=3&output=xml


<tags>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/text/javascript/media?mid=7&cid=6&pid=0&zid=123&random=81412910&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/text/javascript/media?mid=5&cid=136&pid=0&zid=123&random=44847222&millis=20160512120840"></script>]]></tag>
  <tag><![CDATA[<script type="text/javascript" src="http://ads.example.com/servlet/view/text/javascript/media?mid=9&cid=8&pid=0&zid=123&random=16491015&millis=20160512120840"></script>]]></tag>
</tags>

JSON Response

Hyperlink /servlet/view/text/prefetch?zid=123&total=3&output=json


{ "tags" : [
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/text/javascript/media?mid=5&cid=137&pid=0&zid=123&random=80384411&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/text/javascript/media?mid=9&cid=8&pid=0&zid=123&random=43438806&millis=20160512121115\"><\/script>",
  "<script type=\"text/javascript\" src=\"http://ads.example.com/servlet/view/text/javascript/media?mid=5&cid=136&pid=0&zid=123&random=32981826&millis=20160512121115\"><\/script>"
]}