The Adzerk Developer Hub

Welcome to the Adzerk developer hub. You'll find comprehensive guides and documentation to help you start working with Adzerk as quickly as possible, as well as support if you get stuck. Let's jump right in!

Decision API Quickstart

Overview

Below is an introduction to using the Decision API. The goal is to quickly create and display a server-side example ad.

For the test, we'll use the Adzerk UI to upload an ad. Long-term, the Management API is great for programmatic campaign/ad creation.

Steps

Inventory Prep

Inventory refers to details about the ad placement (i.e., where the ad is appearing). Below are details of what you'll be using for this test:

What
Default
ID

Network

Your company

E-mail support for ID. Soon to be added to the dashboard

Use the "All Sites" default Channel

N/A (don't need)

Use the "Web" default Site

In UI, go to Inventory --> Sites --> the ID is to the right of the site called 'Web'

We will use "Square Button" default

id=16

Ad Placement Prep

As this is an API quickstart, we will not be dealing with JavaScript tags - you'll need to connect to our APIs via JSON requests

  1. Determine where you'll display the ad. While the creative image itself is 125x125, with metadata you can include a headline, ad copy, call-to-action, etc, all of which you can use to populate the ad.

  2. Determine how you'll connect Adzerk's Decision API Response with your CMS, app, or whatever system you use to insert content into your app/website. The API Response will be in JSON format. More info here

Create an Advertiser

  1. Click on Advertisers in top left --> All Advertisers
  2. Click New Advertiser
  3. Name it 'Test Account'
  4. Save

Create The Ad

This process involves completing a few steps in our Campaign hierarchy, including creating a Campaign, Flight, and Ad.

Step 1: Create Campaign

  1. Campaigns tab --> Campaigns
  2. Click New Campaign button
  1. Select the 'Test Account' as the advertiser
  2. Put in 'Test Campaign' as Campaign Name
  3. You can leave Salesperson blank
  4. Save

Step 2: Create Flight

  1. Click on the Campaign's name in the Campaigns tab
  2. Click the Add a Flight to this Campaign button in top left
  1. Add in Flight Details. For now, we'll stick to only the required fields. Refer here for an overview of all Flight options.
Field
What you should put

Name

Test Flight

Priority

House (All Sites). This is a default priority; refer here for more info on Priorities

Start Date

Use current time

Rate

CPC

Price

1.00

Goal Type

Percentage

Goal Amount

100

  1. Go to the Creatives section and click New Creative. See here for more details on the Creative/Ad options.
  1. Fill in the required fields with the below info
Field
What you should put

Format

Image/Flash

Friendly Name

Test Ad

Ad Size

125x125 - Square Button

Click URL

https://adzerk.com (or whatever you'd like)

Optional. Use if you have additional text/info you'd like to parse and place into the ad. Basically, anything you put here will be returned in the API Response, which you can then insert dynamically into your native ad. Format as JSON object, like:

{
"headline": "Test Headline",
"cta": "Download Here"
}

  1. Click Save

  2. Once the Creative has been added to the Flight page, scroll down and click Save

You've successfully created an Ad in the Adzerk UI! The next step is to ping the Decision API with information about the ad slot, parse the Response, and insert the information into your CMS.

Requesting an Ad for a Placement

  1. Find the Campaign ID for the test campaign. To do this, go to Campaigns and look for the Test Campaign. The id next to it is the Campaign ID.
  1. You'll want to ping https://e-<networkId>.adzerk.net/api/v2 with the below fields, with networkId being your Network ID. Refer here for more info on the Decision API Request process
{
  "placements": [
    {
      "divName": "Test Placement",
      "networkId": "**Your Network ID**",
      "siteId": "**Your Site ID**",
      "adTypes": [16],
      "campaignId":"**Your Campaign ID**"
    }
  ]
}
curl -H 'Content-Type:application/json' -X POST -d '{"placements":[{"divName":"Test Placement","networkId":XXXX,"siteId":XXXX,"campaignId":XXX,"adTypes":[16]}]}' http://e-<networkId>.adzerk.net/api/v2

Parsing the Response

  1. Refer here for the Decision API Response details. It'll look something like:
{
  "user": {
    "key": "ad39231daeb043f2a9610414f08394b5"
  },
  "decisions": {
    "div1": {
      "adId": 111,
      "creativeId": 222,
      "flightId": 333,
      "campaignId": 444,
      "clickUrl": "http://e-1234.adzerk.net/r?...",
      "contents": [
        {
          "type": "html",
          "template": "image",
          "data": {
            "imageUrl": "http://static.adzerk.net/xxx.jpg",
            "title": "Test Ad",
            "width": 125,
            "height": 125,
            "customData": {
                 "headline": "Test Headline",
                 "cta": "Download Here"
  }
          },
          "body": "<a href='...'><img src='http://static.adzerk.net/Advertisers/xxx.jpg' title='Test Ad' width="125" height="125"></a>"
        }
      ],
      "impressionUrl": "http://e-1234.adzerk.net/i.gif?..."
    }
  }
}

This may look like a lot! But for the test, the only fields that will matter are clickURL, imageURL, impressionURL, and any custom JS in the customdata section (the metadata section).

  1. Insert the relevant, parsed information into your CMS or app. Make sure that
    a. The impression URL is fired at time of impression
    b. The click event hits the Click URL
    c. The image pulls from the Image URL

  2. Display and then click on the ad for tracking purposes

Reporting

  1. Go to Reports in the UI
  2. Run a report and see your impression and click!

Decision API Quickstart


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.