Ad networks and ad tags
Get an HTML5 zip built for an ad network, or the ad tag code to paste into it.
An ad network shows your banners on other sites, for example Google
Ad Manager. The API knows a list of ad networks, and each one has an
id. You send the id in ad_network.
List the ad networks
Call get-adtag-networks with an identifier. The list has every ad network, also the ones that are turned off.
{
"code": 200,
"data": [
{
"id": 1,
"name": "Google Ad Manager",
"clickTagMacro": "%%CLICK_URL_UNESC%%"
}
]
}
This example shows one network. Read the real ids from the list.
Choose an action
| You want | Action |
|---|---|
| A zip of one banner, built for an ad network | get-banner-url-for-adtag-network |
| The zips of every banner in a banner set, built for an ad network | get-bannerset-urls-for-adtag-network |
| The ad tag code to paste into the ad network | get-banner-adtag-for-network |
| The hosted ad tag of a banner, as an export | start-banner-export with type
ad-tag-html5 or ad-tag-mraid |
Zips for an ad network
Each zip is HTML5 only. There is no MRAID zip. The answer has one
entry of type ad_tag_html5 with a link and a status. The
status is pending while the zip builds, and
done when it is ready. Call again until it is done, with
a wait between calls, as the
Exports guide shows.
Each call queues a build of the zip and signs in the owner of the banner. get-banner-urls and get-bannerset-urls with ad_network give the same answer as these actions.
Ad tag code
get-banner-adtag-for-network returns the code that you paste into the ad network. Each call also starts an ad tag export of the banner for that ad network.
-
adtag_type:html5_adtag_embedfor an HTML5 ad tag, orhtml5_adtag_embed_mraidfor an MRAID ad tag. MRAID is the ad standard for mobile apps. -
responsive: withtrue, the HTML5 ad tag has a width and a height of 100%. -
useiFrame: withtrue, the HTML5 ad tag is an iframe. If the ad network does not take iframe ad tags, the API answers 554.
The click tag is the link that opens when someone clicks the ad. If the ad network has a click tag macro, the ad tag uses it as the click tag. Otherwise, the ad tag uses the click-through URL of the banner.
{
"code": 200,
"data": [
{
"hash": "bduny9j1",
"embedcode": "<script type='text/javascript'>var bannersnack_embed = {...};</script><script type='text/javascript' src='...'></script>"
}
]
}
The hosted ad tag as an export
start-banner-export with type
ad-tag-html5 or ad-tag-mraid publishes the hosted ad tag of a
banner for one ad network. Send the id of the network in
ad_network. Your white label needs the permission
Ad tag embed download. Without it, the API answers 514.
get-banner-urls has no entry for these types. The Exports guide describes the other export types.
Errors
| Code | Meaning |
|---|---|
| 520 | ad_network or adtag_type is missing. For the missing network, the message names Ad Network Id, Ad Network ID or network_id, not ad_network. Send the id in ad_network. |
| 553 | No ad network has the id in ad_network. |
| 554 | This ad network does not take iframe ad tags. |
| 514 | For an ad tag export: your white label does not have the permission Ad tag embed download. |