The Pre-Targeting API can be used for transmitting data from a third party vendor to an AdSpirit AdServer in order to allow the use of certain targeting features for campaigns which are available in AdSpirit.
Use scenarios
-
DMP: Get data about the user from DMP in order to allow targeting
-
BrandProtection: Get data about website in order to allow brand protection targeting
-
Context-Targeting: Get data from context provider about website in order to allow targeting
-
...
Workflow
-
AdSpirit gathers data about request (URL, position of creatives, browser, language, ...)
-
AdSpirits sends data to partner provider
-
Provider answers with response data (e.g. DMP-data, targeting-data, ...)
-
Response data is passed to the campaigns in order to do targeting
Limitations
-
Provider needs to send answer within 120ms
-
Because of timeout rates, this feature is not available for incoming RTB requests
Request data format
AdSpirit will send a HTTP POST request to the partner URL, passing the following JSON-Object as request body:
{
"id": "String. Random request ID",
"placement": {
"w": "Int. Width of placement, can be 0 with layers/Popups/...",
"h": "Int. Height of placement, can be 0 with layers/Popups/...",
"pos": "Int. Position of placement within site: 0=less than 25% visible, 1=min 25% visible, 2=min 50% visible, 3=min 75% visible, 4=100% visible, -1=not determined",
"secure": "Int. 0=HTTP, 1=HTTPS",
"flash": "Int. Supported flash version number",
"type": "Int. Placement type: 0=Banner, 2=Popup/Layer/..., 4=Preroll, 5=Midroll, 6=Postroll, 7=Mobile Banner, 8=Mobile InApp Banner, 9=Newsletter Placement, 10=overlay ad"
},
"site": {
"id": "Int. Website-ID",
"url": "String. Website-URL",
"pid": "Int. Placement-ID"
},
"browser": {
"ua": "String. User-Agent String",
"lang": "String. HTTP-Accept-Language",
"dnt": "Int. DNT-Header present 0/1",
"screen": "String. Window-Size in XxY Pixels"
},
"user": {
"ip": "String. IP",
"id": "String. AdSprit User-ID for this User",
"extid": "String. Partner User-ID for this User"
}
}
Be aware of that not all fields are always present with every request.
Response data format
The partner will use the request data in order to calculate its response. The response should have HTTP-Header:
Content-Type: application/json
X-Dataexchange-Version: 1.1
The version number can change from time to time with new updates. Please make sure you are always using the current version and the right response content.
The response should have a JSON object that is either empty (e.g. no data available retry with the next impression, please use http code 204 in this case) or a full JSON object with the following data:
{
"id": "String. ID of the request to respond",
"caching": "Int. 0=no caching (default, if not present), 1=cache data per user, 2=cache data per website, 3=cache data per placement, 4=cache data globally, 5=cache per URL, 6=cache per domain",
"expires": "Int. Default=60. Number of seconds the data should be cached (if caching is set)",
"data": "String. Representation of the data in url-encoded form. e.g. &x=3&y=blabla&z=a%20b"
}
Note: The maximum timeout for the response is 120ms (including network time from adserver to client and back).