How The Decision Engine Works


Add thousands of ads & promotions

Adzerk accepts any type of media (image, audio, video, etc)

Ad request

Ping Adzerk server-side when you need to display content

Robust targeting options

The engine filters by targeting rules like geo, user-data, search terms, key/value pairs, etc

Pacing & revenue algorithms

Use pacing tools to ensure campaigns don't go over budget; use auction pricing to maximize revenue and/or relevance

Winner returned in JSON

Adzerk returns the best promotion to display in as low as 50ms

Executable Code Samples

Run a quick spike of our API with our pre-created ads. Just copy our examples below - no API key needed!

Post here: https://e-23.adzerk.net/api/v2

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Adzerk Decision API - JavaScript Request</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script type="text/javascript">
      nativeAdRequest = function() {
        var data = JSON.stringify({
          "placements": [{
            "divName": "div1",
            "networkId": 23,
            "siteId": 667480,
            "adTypes": [5],
            "properties": {"foo": "bar"}
          }],
          "keywords": ["adzerk", "demo"]
        });
        $.ajax({
          url: "https://e-23.adzerk.net/api/v2",
          method: "POST",    
          dataType: 'json',
          data: data,
          success: function(data, status, xhr) {
            console.log("SUCCESS!!!", data);
            
            // record the impression; REQUIRED
            console.log("Impression URL: ", data.decisions.div1.impressionUrl, "\n");
            $.ajax({url: data.decisions.div1.impressionUrl, method: "GET"});

            // log & display the response
            console.log("Adzerk response:", data.decisions.div1);
            console.log("Click URL: ", data.decisions.div1.clickUrl);         
            $("#response").text(JSON.stringify(data.decisions.div1));
            $("#div1").replaceWith(data.decisions.div1.contents[0].body)
          },
          error: function(data, status, xhr) {
            console.log("ERROR!!!", data, status)
          }
        });
      };
    </script>
  </head>
  <body>
    <h1>Adzerk Decision API - JavaScript Request</h1>
    <p>Press the button to make a Decision ad request, record the impression, and display both the internal JSON and HTML payload of the response.  Also, check the console for logs!</p>

    <button type="button" onclick="nativeAdRequest()">Request an Ad</button>
    <br/>
    <hr/>

    <h5>Response:</h5>
    <code id="response">(Nothing yet; please click the button!)</code>

    <h5>HTML:</h5>
    <div id="div1"><code>(Nothing yet; please click the button!)</code></div>

  </body>
</html>
Copy
curl -H 'Content-Type:application/json' \
  -X POST \
  -d '{"placements":[{
  "divName":"div1",
  "networkId":23,
  "siteId":667480,
  "adTypes":[5]}],
  "user":{"key":"abc"}}' \
  \
  https://e-23.adzerk.net/api/v2
Copy
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://e-23.adzerk.net/api/v2")
header = {'Content-Type': 'application/json'}

data = {
  placements: [
    {
      divName:   'div1',
      networkId: 23,
      siteId:    667480,
      adTypes:   [5]
    }
  ],
  user: {"key":"abc"}
}

# Create the HTTP objects
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = data.to_json

# Send the request
response = http.request(request)
puts response.body
Copy
package com.adzerk.examples;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

import javax.net.ssl.HttpsURLConnection;

class AdzerkNativeAdExample {

  public static void main(String[] args) throws Exception {
    System.out.println("\nTesting - Sending HTTP POST request...");

    URL url = new URL("https://e-23.adzerk.net/api/v2");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();

    // Add request headers
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-Type", "application/json");
    
    // Normally you'd use JSON here, but we've compressed it into a String for ease of instruction
    String params = "{\"placements\":[{\"divName\":\"div1\",\"networkId\":23,\"siteId\":667480,\"adTypes\":[5]}],\"user\":{\"key\":\"abc\"}}";

    // Send post request
    conn.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
    wr.writeBytes(params);
    wr.flush();
    wr.close();

    int responseCode = conn.getResponseCode();
    System.out.println("\nSending 'POST' request to URL : " + url);
    System.out.println("Post parameters : " + params);
    System.out.println("Response Code : " + responseCode);

    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();

    while ((inputLine = in.readLine()) != null) {
     response.append(inputLine);
    }
    
    in.close();

    System.out.println(response.toString());
    System.out.println("\nDone!");
 }
}
Copy
Or, Test With JSFiddle

Click on 'Request Ad' in the Result tab to see the Response data.


Ticketmaster built an internal promotions platform 9x faster than if done from scratch

With Adzerk we built the exact ad server we wanted. No other solution could provide this flexibility.
David Han, VP of Product, Ticketmaster

Built for developers. Trusted by enterprises.

Keep building an awesome core business while staying confident Adzerk can support your .

99.999% API Uptime

We’ve been doing this for a decade - we know how to keep the system running

Fast Response Times

Adzerk is all about speed at scale. We can get as low as 50ms response times, even while handling 3B daily requests

Dev Support On Deck

You’ll be teamed with support engineers, software engineers, and account managers

GDPR Compliance

Our tools are 100% GDPR compliant by default - no need to worry about non-compliance

Enterprise Security

We've got SOC 1 (SSAE 16) certifications, VPCs, and more



"Adzerk is a great partner, and we recommend them to anyone building a custom ad server."
-Daniel Murray, Bed Bath & Beyond, Chief Digital Officer

Learn how Adzerk can help you build your own ad server in weeks, not years

Sign-up and start building