Native Ads API - Version 2

Downloadable document


Table of Contents


Introduction


Digital Turbine’s ad request service provides a platform for the promotion of mobile applications via its network of publisher partners. Advertisers set up campaigns through Digital Turbine’s Portal and can bid for inventory across the network. Advertisements subsequently appear on Digital Turbine’s mobile ad networks/publishers.

The Digital Turbine Native Ad API set enables partners to integrate ads into their mobile site or mobile application.


Digital Turbine AdServer Guidelines

Digital Turbine’s AdServer provides options and parameters to retrieve ads for display within a website or storefront. 

  • Access to the AdServer is restricted, a login will be provided upon request to the partner’s account representative. 
  • The service is designed to be a server to server based solution which is called using the HTTP GET method and provides an XML response. 
  • Ads cannot be cached for an extended period of time. Ads are intended to be served for real time presentation, as inventory will be updated at minimum on an hourly basis.
  • The Ad Server sends a response in approx. 400 ms since Ad Server uses multiple campaign optimization filters before it generates the campaign list
  • Ad requests MUST include both the device user agent (used to determine application/campaign compatibility) and IP address (used to determine user’s location) for targeting purposes.  Ads will not be returned if these are not provided. 
  • Although the “androidId” and “handsetId” variables are not required, it is highly recommended that publishers send these parameters to Digital Turbine to maximize the number of campaigns that are available to them.  


Request Format

The format for ad requests to the server are as below:

http://<server>/v2/getAds?<param1>=<value1>&<param2>=<value2>&...<paramN>=<valueN>

Response in JSON?

The API response defaults to XML, but can return JSON if you make the request with the following header "Accept: application/json; charset=UTF-8"


Environment

Production: http://ads.appia.com/

Credentials will be provided by Digital Turbine upon request.

Updates in V2


The V2 API has been optimized for serving both Android and iOS campaigns:

  • All XML nodes and url parameters have had the ‘ppd’ preface removed

  • The packageName node has been renamed to appId

  • The settledPricePerDownload node has been renamed to bidRate

  • The url parameters are named the same in both the XML and AdTag APIs


Ad Presentation Flow


After they’ve displayed an ad, publishers are required to provide tracking information back to Digital Turbine to feed the publisher's campaign optimization algorithm.  The steps below outline the integration flow:

1)    Publisher sends a getAds request to the Digital Turbine server and receives back XML or JSON response to parse

2)    Publisher displays ad (or ad's) to end user can calls back to Digital Turbine using the ad's impressionTrackingURL provided in the XML response

3)    When the ad is clicked, the publisher redirects the end user to the ad's clickProxyURL provided in XML response

4)    Digital Turbine directs the end user to the appropriate app store (iTunes or Google Play) to download the application


Requesting Ads


Ad result sets can be filtered based on the parameters outlined below.  All values sent must be URL encoded to accommodate any special characters.

Request Parameters

Field

Required

Description

id

Yes

Authentication attribute provided by Digital Turbine

password

Yes

Authentication attribute provided by Digital Turbine

siteIdYesValue provided by Digital Turbine to identify the publisher

userAgentHeader

Yes

The user agent of the device for which the ad is requested.  Required to ensure device-application compatibility

sessionId

Yes

sessionId of the end user device the request is generating Ads for.  This parameter is required so ads provided in the XML response will be rotated, end users will not see duplicates on subsequent requests. However, you don’t need to maintain any session and this can be any randomly generated number, for example, timestamp.

placementIdNoPlacement of site id in VIA

ipAddress

No

Required for end user geo-targeting

ipAddressListNoRequired for end user geo-targeting
countryCodeNoCountry code to filter ads by. Example: US
countrySourceNoInteger. Example: 1
imageHeightNo Allows partners to request various icon sizes.  Digital Turbine will return the best match from the sizes we have available.  The default value is 72 and the max 200.
iconHeightNoUsed along with adTypeId, this allows partners to request various icon sizes in addition to a Banner or Interstitial.  The default value is 72 and the max 200.
acceptLanguageHeaderNoTwo letter ISO language code.  Allows partners to request a specific language.  Digital Turbine will return ads in the request language if available.

totalCampaignsRequested

No

Allows publishers to request multiple ads simultaneously 

adTypeId

No

The size of creative returned in the ad response.  1 is the default.

1 –   72x72 Icon

4 300x50 Banner

5 320x50 Banner

6 300x250 Interstitial

7   320x480 Interstitial

8 –   480x320 Interstitial

9 –   768x1024 Interstitial

10   1024x768 Interstitial

11 - 390x200 interstitial

12 - 240x350 Interstitial

13 - 750x560 Interstitial

14 - 560x750 Interstitial

15  728x90 Banner

16 - 1200x627 Interstitial

28 - 600x600 Interstitial

42 - 1280x720 Interstitial 

categoryId

No

The predefined category/subcategory available to filter the results on.  Category IDs can be comma separated to filter for multiple categories.  See the table at the end of the document for a list of IDs and their category names.

androidId

No

Raw Android ID for optimization and conversion tracking.

aIdSHA1

No

Android ID SHA-1 hashed for optimization and conversion tracking when available.

aIdMD5NoAndroid ID MD5 hashed for optimization and conversion tracking when available.

idfa

No

Raw iOS IDFA for optimization and conversion tracking when available.

macAddress

No

Raw MAC Address not case sensitive, including : separator for optimization and conversion tracking when available.

aaidNoAndroid Advertising ID for optimization and conversion tracking.
campaignIdNoThe Digital Turbine campaign ID.  Passing this param will return details for the passed campaign ID only.  If the campaign is not available the result will be empty.

carrierName

No

Carrier Name: Verizon, ATT, Tmobile, etc.

lat

No

Latitude

long

No

Longitude

gender

No

male/female

minAge

No

Age or minimum age if an age range is known

maxAgeNoMaximum age if an age range is known
childAgeNoComma separated list of a child age ranges (0-3,4-7)

minIncome

No

Income or minimum income of an income range is known

maxIncomeNoMaximum income of an income range is known
vendorNoVendor
subPartnerNoSub partner
deviceSpecNoReturns campaigns with apps that has apks uploaded
screenshotSizeNoExample: 100x100

Other request parameters:

ParameterDescription
languageUsed in impression tracking url
adUnitIdUsed in impression tracking url
creativeIdUsed in click proxy url + impression tracking url
templateIdUsed in click proxy url + impression tracking url
bidRequestIdUsed in click proxy url + impression tracking url
bidResponseIdUsed in click proxy url + impression tracking url
exchangeUsed in click proxy url + impression tracking url
bidClearPriceUsed in click proxy url + impression tracking url
retargetedUsed in click proxy url + impression tracking url
homeScreen Used in click proxy url + impression tracking url
aaidSHA1Used in click proxy url + impression tracking url
aaidMD5Used in click proxy url + impression tracking url
handsetIdUsed in click proxy url + impression tracking url
udidUsed in click proxy url + impression tracking url
odinUsed in click proxy url + impression tracking url
limitAdTrackingUsed in click proxy url + impression tracking url. Values: true/false.
flowsUsed in click proxy url
clicklessSupportedUsed in click proxy url
rdnsCarrierSafeUsed in click proxy url
dvURLUsed in click proxy url
stiFlowUsed in click proxy url
deviceIdUsed in click proxy url
algorithmIdUsed in click proxy url
providerUsed in click proxy url
mccmncUsed in click proxy url
deviceManufacturerUsed in click proxy url
deviceModelUsed in click proxy url
densityValues: ldpi/mdpi/tvdpi/hdpi/xhdpi/xxhdpi/xxxhdpi
deviceStateConfigured in Via Site Optimization/Priority. Values: outOfBox/inLife
randomizationDetermine if the ads for a specific request should be randomized. Values: true/false
clickProxyif deeplink is sent then clickProxyUrl will have delivers URL


Sample Request

Generic:

http://ads.appia.com/v2/getAds?id=[ID]&password=[PASSWORD]&sessionId=[SESSIONID]&siteId=[SITEID]&userAgentHeader=[USERAGENTHEADER]&ipAddress=[IPADDRESS]&placementId=[PLACEMENTID]&androidId=[ANDROIDID]&aIdSHA1=[AIDSHA1]&aIdMD5=[AIDMD5]&macAddress=[MACADDRESS]&idfa=[IDFA]&aaid=[ANDROIDADVERTISINGID]&subSite=[SubSiteId]


Actual:

http://ads.appia.com/v2/getAds?id=123&password=digitalturbinePassword&sessionId=somerandomvalue001&siteId=1234&userAgentHeader=Mozilla/5.0 (Linux; U; Android 4.1; en-us; Full Android on Crespo Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1&siteId=1234&ipAddress=173.226.92.34&placementId=320x50&androidId=01930&aIdSHA1=&AiDMD5=&macAddress=0123456789ab&idfa=1234&aaid=1234&subSite=1234567890

Response Parameters


Response provides all the data available in XML/XHTML format, which can be used to construct or readily display the Ad. 

Field
Description
Value
adListIdUnique uuid for each request. Part of clickProxyUrl and impressionUrl.String
apksList of apk configuration from the Via App/Manage Apk page.List of Objects

appId

The app's unique identifier in the app store, Google Play or iTunes

String

averageRatingImageURL

An image representing the star rating of the application.

String

bidIdUnique id for each campaign. Part of metadata object, clickProxyUrl and impressionUrl. Example: BID214330009156094520454149095213969486968String

bidRate

Amount paid to a publisher for an install

Float

billingTypeIdBilling type of campaign. Can be: CPI (1), CPP (2), CPC (3), CPM (4)Integer
callToActionStatic localized parameter that returns "Install now" text. Supports following languages codes: en, zh, sv, da, no, fi, de, es, fr, nl, it, tr, ro, pt, pt-brString

campaignDisplayOrder

Recommended display order for the ad based on Digital Turbine’s campaign performance algorithm

Integer

campaignId

The campaign's ID within the Digital Turbine system.  

Integer

campaignTypeId

A tracking parameter used by Digital Turbine.  Typically unused by publishers.

Integer

categoryName

The category of the application from Google Play or iTunes

String

clickProxyURL

A link that will record a click in Digital Turbine's system and redirect the end user to the appropriate app store, Google Play or iTunes. 

String

creativeId

The ID of the creative returned. Typically unused by publishers.

Integer

enableAutoLaunchIf false, user will be presented with the app details modal containing the call to action: "tap here to open".Boolean
homeScreenShows if campaign may appear on the home screen. Configured in Via site optimization page.Boolean

impressionTrackingURL

pixel tracker that must be placed when an ad is shown to the end-user

String

impressionIdUnique id for each campaign. Part of metadata object and impressionUrl. Example: IMP181121631983274148732716928498071899713String
installDelayDelay in seconds between download complete and install for an app deliveryInteger

isRandomPick

All ads are returned in order of their performance, with a few randomly returned out of order. This indicates if the specific ad was returned in performance order or was a random placement.

String

metadataContains such metadata as bidId and impressionId.Object

maxOSVersion

The maximum OS version supported.  Must be used to filter out unsupported devices.

String

minOSVersion

The minimum OS version supported.  Must be used to filter out unsupported devices.

String

numberOfDownloadsHow much downloads have happened for a specific app.String

numberOfRatings

The number of ratings.

String

productDescription

The ad copy for the ad. Typically a short description of the product.

String

productId

Digital Turbine system ID for the application linked to a campaign.  Typically unused by publishers.

Integer

postInstallActionsDiscovery notifications post install actions.Object

productName

The headline for the ad. Typically the title of the product

String

productThumbnail

URL for the image icon

String

responseTime

Digital Turbine AdServer response time for the current ad request. Typically unused by publishers.

String

reclickAttributionDetermines whether or not to re-click the attribution click upon auto-launch if an app is already installed.Boolean

rating

The application rating

Float

s2sServer to server parameter.Boolean
segmentsSpecific for applist site. Configured under Site Optimization/Applist in Via. Each segment has list of campaigns.List of Objects

totalCampaignsRequested

Indicates the number of campaigns requested. The results may be less than the number requested if the targeting criteria filters out available ads.

Integer

useInstallerBroadcastBroadcast message to the installed app.Boolean

version

Current version of the ad server.  Typically unused by publishers.

String

Sample Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ads xmlns="http://www.appia.com/AS/get/ads/2013-01">
<adListId>dee6f238-e5cd-4c5b-93a1-808769166cb6</adListId>
<ad>
<apks>
<apk>
<fileName>com.ibotta.android~c358be779552584db2b8b711cb275788.apk</fileName>
<fileSize>56430138</fileSize>
<md5>c358be779552584db2b8b711cb275788</md5>
<networkType>both</networkType>
<packageName>com.ibotta.android</packageName>
<permissions>
<permission>android.permission.ACCESS_COARSE_LOCATION</permission>
<permission>android.permission.ACCESS_FINE_LOCATION</permission>
<permission>android.permission.ACCESS_NETWORK_STATE</permission>
<permission>android.permission.ACCESS_WIFI_STATE</permission>
<permission>android.permission.AUTHENTICATE_ACCOUNTS</permission>
<permission>android.permission.BLUETOOTH</permission>
</permissions>
<sha2>78e706f9fad37011bd8fc7a8c93abe5c085e143a9b57cbed7597da6ed55877b0</sha2>
<title>Ibotta</title>
<url>https://s3.amazonaws.com/appia-dev-apks/com.ibotta.android~c358be779552584db2b8b711cb275788.apk</url>
<version>4.11.2</version>
<versionCode>2096</versionCode>
</apk>
</apks>
<appId>com.zavyn.app.01</appId>
<averageRatingImageURL>https://assets.gopda.com/hua/cdn/adpub/default/rated-5-5.png</averageRatingImageURL>
<bidRate>2.100</bidRate>
<billingTypeId>1</billingTypeId>
<callToAction>Install Now</callToAction>
<campaignDisplayOrder>1</campaignDisplayOrder>
<campaignId>12424</campaignId>
<campaignTypeId>2</campaignTypeId>
<categoryName>Books &amp; Reference</categoryName>
<clickProxyURL>https://balalaika-central-2022-alpha.dev.appia.com/v2/delivers/clickAd.jsp?siteId=41488&amp;deviceId=4520&amp;spotId=&amp;sessionId=getAdsDebug&amp;campaignId=12424&amp;creativeId=&amp;packageName=com.zavyn.app.01&amp;fulfillmentTypeId=1&amp;placementId=&amp;campaignDisplayOrder=1&amp;enc=true&amp;ts=17da484dedf&amp;algorithmId=166&amp;partner=1411&amp;homeScreen=false&amp;houseApp=false&amp;installDelay=0&amp;enableAutoLaunch=true&amp;countryCode=US&amp;bidId=BID215201059225089188757028065641167901481&amp;adListId=dee6f238-e5cd-4c5b-93a1-808769166cb6</clickProxyURL>
<creativeId>0</creativeId>
<externalMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<homeScreen>false</homeScreen>
<impressionTrackingURL>https://balalaika-central-2022-alpha.dev.appia.com/v2/impressionAd.jsp?siteId=41488&amp;campaignId=12424&amp;creativeId=&amp;campaignDisplayOrder=1&amp;ts=17da484dedf&amp;sessionId=getAdsDebug&amp;packageName=com.zavyn.app.01&amp;enc=true&amp;eventGroupId=EVTGID1639142708845248814692352&amp;algorithmId=166&amp;partner=1411&amp;countryCode=US&amp;bidId=BID215201059225089188757028065641167901481&amp;impressionId=IMP166976276725647341184525072781505505140&amp;adListId=dee6f238-e5cd-4c5b-93a1-808769166cb6</impressionTrackingURL>
<isRandomPick>false</isRandomPick>
<numberOfRatings>1,000-10,000</numberOfRatings>
<productId>17063</productId>
<productName>Zavyn App 01</productName>
<rating>5.0</rating>
<numberOfDownloads>1,000-10,000</numberOfDownloads>
<tstiEligible>false</tstiEligible>
<stiEnabled>false</stiEnabled>
<postInstallActions/>
<useInstallerBroadcast>false</useInstallerBroadcast>
<installDelay>0</installDelay>
<reclickAttribution>false</reclickAttribution>
<enableAutoLaunch>true</enableAutoLaunch>
<s2s>false</s2s>
<metadata>
<bidId>BID215201059225089188757028065641167901481</bidId>
<impressionId>IMP166976276725647341184525072781505505140</impressionId>
</metadata>
</ad>
<responseTime>2.163 seconds</responseTime>
<totalCampaignsRequested>7</totalCampaignsRequested>
<version>v2</version>
</ads>

Error Response

If access has not been enabled, an error message will be returned:

<ads>
<errorMessage>{errorMessage}</errorMessage>
<serverId>{server}</serverId>
<version>{version}</version>
</ads>


Campaign Categories


Category IDCategorySub-Category
9GamesAll Games
10GamesAction
79GamesAdventure
80GamesArcade
81GamesBoard
82GamesCard
12GamesCasino
13GamesCasual
83GamesEducational
84GamesMusic
11GamesPuzzle
14GamesRacing
85GamesRole Playing
86GamesSimulation
87GamesSports
88GamesStrategy
89GamesTrivia
90GamesWord
33AppsAll Apps
2AppsBooks & Reference
3AppsBusiness
4AppsComics
5AppsCommunication
6AppsEducation
7AppsEntertainment
8AppsFinance
16AppsHealth & Fitness
17AppsLifestyle
19AppsMedia & Video
20AppsMedical
21AppsMusic & Audio
22AppsNews & Magazines
23AppsPersonalization
24AppsPhotography
25AppsProductivity
26AppsShopping
27AppsSocial Networking
15AppsSports
28AppsSports
29AppsTools
30AppsTransportation
31AppsTravel
18AppsTravel & Local
32AppsWeather

Flow Diagram