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 |
siteId | Yes | Value 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. |
placementId | No | Placement of site id in VIA |
ipAddress | No | Required for end user geo-targeting |
ipAddressList | No | Required for end user geo-targeting |
countryCode | No | Country code to filter ads by. Example: US |
countrySource | No | Integer. Example: 1 |
imageHeight | No | 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. |
iconHeight | No | Used 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. |
acceptLanguageHeader | No | Two 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. |
aIdMD5 | No | Android 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. |
aaid | No | Android Advertising ID for optimization and conversion tracking. |
campaignId | No | The 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 |
maxAge | No | Maximum age if an age range is known |
childAge | No | Comma separated list of a child age ranges (0-3,4-7) |
minIncome | No | Income or minimum income of an income range is known |
maxIncome | No | Maximum income of an income range is known |
vendor | No | Vendor |
subPartner | No | Sub partner |
deviceSpec | No | Returns campaigns with apps that has apks uploaded |
screenshotSize | No | Example: 100x100 |
Other request parameters:
Parameter | Description |
---|---|
language | Used in impression tracking url |
adUnitId | Used in impression tracking url |
creativeId | Used in click proxy url + impression tracking url |
templateId | Used in click proxy url + impression tracking url |
bidRequestId | Used in click proxy url + impression tracking url |
bidResponseId | Used in click proxy url + impression tracking url |
exchange | Used in click proxy url + impression tracking url |
bidClearPrice | Used in click proxy url + impression tracking url |
retargeted | Used in click proxy url + impression tracking url |
homeScreen | Used in click proxy url + impression tracking url |
aaidSHA1 | Used in click proxy url + impression tracking url |
aaidMD5 | Used in click proxy url + impression tracking url |
handsetId | Used in click proxy url + impression tracking url |
udid | Used in click proxy url + impression tracking url |
odin | Used in click proxy url + impression tracking url |
limitAdTracking | Used in click proxy url + impression tracking url. Values: true/false. |
flows | Used in click proxy url |
clicklessSupported | Used in click proxy url |
rdnsCarrierSafe | Used in click proxy url |
dvURL | Used in click proxy url |
stiFlow | Used in click proxy url |
deviceId | Used in click proxy url |
algorithmId | Used in click proxy url |
provider | Used in click proxy url |
mccmnc | Used in click proxy url |
deviceManufacturer | Used in click proxy url |
deviceModel | Used in click proxy url |
density | Values: ldpi/mdpi/tvdpi/hdpi/xhdpi/xxhdpi/xxxhdpi |
deviceState | Configured in Via Site Optimization/Priority. Values: outOfBox/inLife |
randomization | Determine if the ads for a specific request should be randomized. Values: true/false |
clickProxy | if 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 |
adListId | Unique uuid for each request. Part of clickProxyUrl and impressionUrl. | String |
apks | List 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 |
bidId | Unique id for each campaign. Part of metadata object, clickProxyUrl and impressionUrl. Example: BID214330009156094520454149095213969486968 | String |
bidRate | Amount paid to a publisher for an install | Float |
billingTypeId | Billing type of campaign. Can be: CPI (1), CPP (2), CPC (3), CPM (4) | Integer |
callToAction | Static 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-br | String |
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 |
enableAutoLaunch | If false, user will be presented with the app details modal containing the call to action: "tap here to open". | Boolean |
homeScreen | Shows 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 |
impressionId | Unique id for each campaign. Part of metadata object and impressionUrl. Example: IMP181121631983274148732716928498071899713 | String |
installDelay | Delay in seconds between download complete and install for an app delivery | Integer |
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 |
metadata | Contains 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 |
numberOfDownloads | How 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 |
postInstallActions | Discovery 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 |
reclickAttribution | Determines whether or not to re-click the attribution click upon auto-launch if an app is already installed. | Boolean |
rating | The application rating | Float |
s2s | Server to server parameter. | Boolean |
segments | Specific 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 |
useInstallerBroadcast | Broadcast 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 & Reference</categoryName>
<clickProxyURL>https://balalaika-central-2022-alpha.dev.appia.com/v2/delivers/clickAd.jsp?siteId=41488&deviceId=4520&spotId=&sessionId=getAdsDebug&campaignId=12424&creativeId=&packageName=com.zavyn.app.01&fulfillmentTypeId=1&placementId=&campaignDisplayOrder=1&enc=true&ts=17da484dedf&algorithmId=166&partner=1411&homeScreen=false&houseApp=false&installDelay=0&enableAutoLaunch=true&countryCode=US&bidId=BID215201059225089188757028065641167901481&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&campaignId=12424&creativeId=&campaignDisplayOrder=1&ts=17da484dedf&sessionId=getAdsDebug&packageName=com.zavyn.app.01&enc=true&eventGroupId=EVTGID1639142708845248814692352&algorithmId=166&partner=1411&countryCode=US&bidId=BID215201059225089188757028065641167901481&impressionId=IMP166976276725647341184525072781505505140&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 ID | Category | Sub-Category |
---|---|---|
9 | Games | All Games |
10 | Games | Action |
79 | Games | Adventure |
80 | Games | Arcade |
81 | Games | Board |
82 | Games | Card |
12 | Games | Casino |
13 | Games | Casual |
83 | Games | Educational |
84 | Games | Music |
11 | Games | Puzzle |
14 | Games | Racing |
85 | Games | Role Playing |
86 | Games | Simulation |
87 | Games | Sports |
88 | Games | Strategy |
89 | Games | Trivia |
90 | Games | Word |
33 | Apps | All Apps |
2 | Apps | Books & Reference |
3 | Apps | Business |
4 | Apps | Comics |
5 | Apps | Communication |
6 | Apps | Education |
7 | Apps | Entertainment |
8 | Apps | Finance |
16 | Apps | Health & Fitness |
17 | Apps | Lifestyle |
19 | Apps | Media & Video |
20 | Apps | Medical |
21 | Apps | Music & Audio |
22 | Apps | News & Magazines |
23 | Apps | Personalization |
24 | Apps | Photography |
25 | Apps | Productivity |
26 | Apps | Shopping |
27 | Apps | Social Networking |
15 | Apps | Sports |
28 | Apps | Sports |
29 | Apps | Tools |
30 | Apps | Transportation |
31 | Apps | Travel |
18 | Apps | Travel & Local |
32 | Apps | Weather |
Flow Diagram