Response Parameters

A Response will contain zero or more Decision Objects, one per Placement that was sent in on the request. If no ad was selected for a given Placement, the corresponding Decision entry will be undefined. The response will also contain the user key used to identify the unique user that places the request.

Decision Object

Each Decision Object represents the ad that was selected to be served for a given Placement.

PropertyDescription
adId
(integer)
The Ad's ID
advertiserId
(integer)
The Advertiser's ID
creativeId
(integer)
The Creative's ID
flightId
(integer)
The Flight's ID
campaignId
(integer)
The Campaign's ID
priorityId
(integer)
The Priority's ID (associated with the flight)
clickUrl
(string)
The url endpoint that, using a GET, triggers the recording of the click and redirects to the target. Append the query string noredirect to count the click without the redirect.
contents
(object)
One or more Contents
impressionUrl
(string)
The url endpoint that, using a GET, triggers the recording of the impression
events
(object)
The IDs and tracking URLs of custom events
pricing
(object)
Pricing data for the decision (if requested). See below

🚧

You must call the impressionUrl URL in order to count an impression in Kevel's reporting.

👍

If your client that calls events doesn't support GET, you can also POST the event endpoints without a request body.

Contents Object

Each Decision contains one or more Contents. Combined, the Contents represent the creative that should be displayed. For example, a creative may contain a CSS stylesheet and a block of HTML. This would be represented as two Contents, one with the type css and one with the type html.

Custom metadata set at the creative level will be passed in the Contents as the key customData.

If a content uses a predefined template, the template property will be set to the name of the template to use. For example, an image content will have the type html and the template image.

For a list of predefined templates, see Predefined Content Templates below.

For raw contents (called "HTML/JavaScript Creatives" in the Kevel Management UI) the content will not have a template property set. Instead, it will have a customTemplate property which will contain the body of the custom template.

PropertyDescription
type
(string)
The type of the content (see Content Types, below)
template
(string)
The name of the template used to render the content (see Content Templates, below)
data
(object)
An object that has fields used to build the content. Note that "title" refers to creative alt-text, not the Friendly Name
body
(string)
The rendered body of the content. This is the scriptbody from Create Creative, or the JS/HTML section in the UI
{
  "type": "html",
  "template": "image",
  "data": {
    "fileName": "cat-eating-spaghetti.jpg",
    "title": "ZOMG LOOK AT THIS FRICKING CAT"
  },
  "body": "<a href='...'><img src='https://static.adzerk.net/Advertisers/cat-eating-spaghetti.jpg' title='ZOMG LOOK AT THIS FRICKING CAT'></a>"
}
{
  "type": "raw",
  "customTemplate": "this is an example custom template body with macros like %url% that can be replaced"
}

Data Object

PropertyDescription
imageURL
(string)
The URL of the hosted Kevel image
title
(string)
The Friendly Name of the ad
width
(integer)
The width associated with the Ad Type
height
(integer)
The height associated with the Ad Type
customData
(object)
The JSON object inserted into the metadata of the ad

Content Types

NameDescription
htmlA block of HTML
cssA block of CSS
jsA block of JavaScript
js-externalAn external JavaScript file (rendered as a <script> tag in HTML)
rawRaw text data (JSON, etc.)

Predefined Content Templates

NameDescription
imageA static image (rendered as an <img> tag wrapped in a hyperlink in HTML)
image-nowidthA static image with no height or width attributes

Event Multipliers

You can optionally set an event multiplier on impressions, clicks, conversions, and custom events via the eventMultiplier parameter. This will set the count of that event in reporting to the value of the multiplier. For instance, if you set a multiplier of 10 on an impression URL:

curl -g "https://e-1234.adzerk.net/i.gife=eyJ2Ijoi...xneGk&eventMultiplier=10"

That impression will be counted ten times in reporting, and any revenue associated with the impression will also be registered ten times.

An event multiplier must be between the ranges of [-100000000, -1] or [1, 100000000].

Event multipliers on events will override any event multiplier set on the placement.

Event multipliers do not multiply the revenue set via the override parameter.

Triggering Click Events Without Redirects

By default, calling the ClickUrl will perform a 302 redirect to the Click Url specified in the creative and trigger a click event in reporting. To trigger a click event without the redirect, you can add the query string noredirect to the ClickUrl:

curl -g "https://e-1234.adzerk.net/r?e=eyJ2Ijo...ewxlb6Do_o&noredirect"

The response will contain a 200 status code with an empty response body. This enables the ClickUrl to be used in the same way as custom event URLs.

Pricing Data

NameData Type
price
(float)
The Flight's price (or ad's if its settings override Flight)
clearPrice
(float)
The actual "price" of the impression used for reporting. This may differ from the saved price on the flight if the impression is from a second-priced auction, etc.
revenue
(float)
The revenue that this ad will generate, should the revenue-generating event occur. For example, a $10 CPM ad will have a 'revenue' of 0.01, and a $1.50 CPC ad will have a 'revenue' of 1.50. Ads with a flat rate (rateType = 1) will be 0.
rateType
(enum)
The value of "rateType" on the flight or ad (an enumerated type)
eCPM
(float)
The revenue earned by this impression multiplied by 1,000. Calculated by our eCPM calculation service