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!

Creative Templates

Overview

Creative templates enable you to easily implement custom ad contents across many creatives.

For example, you may want to serve creatives that use a predefined JSON template. Instead of copying and pasting the template into each creative, you can use the creative template feature to supply the JSON once you add parameters unique to the creative, like a name, advertiser, image, etc.

Creative templates can use JavaScript, HTML, JSON, or any other type of code. Creative templates can be served through both the JavaScript ad tags and the Decision API.

Setting up Creative Templates

You can use the Creative Templates API to create, update, list, or archive creative templates in your account.

Before you start building your template with the API, it is helpful to determine:

  • The name of the creative template (which should be unique for each template)
  • Any fields that are required to be included with the creative
  • Any fields that are optional
  • The Field Types of those fields (see below)
  • Any fields that are hidden from the creative upload UI but should be served with the ad
  • What the output should be when the creative is served (the Contents)

Field Types

  • File: A file uploaded directly via the Adzerk UI or API
  • External File: An external URL
  • String
  • Array: For example, a list of tracking pixels to be served with the ad

Uploading a Creative Using a Creative Template

  1. Create or update an existing creative.
  2. Under the Format dropdown, select "Custom Template".
  3. Choose your Template under the Template dropdown. It will use the name you sent to support earlier.
  4. Enter any applicable fields for the creative and all required fields.
  5. Add any additional creative data (such as an image, Friendly Name, distribution settings, etc.)
  6. Save the creative.

Creative template string fields should not be larger than 1K. If you need to use fields that are larger, please contact support.

If all the fields in a creative template are hidden, you will see the message "There are no fields to complete." in the UI when you create or edit an ad using that template.

Using Creative Templates in Creative Metadata

Creative metadata uses JSON formatting only. If you aren't familiar with JSON, contact your development team.

You can expand the values of your creative template fields in the metadata section of your creative. The Variable of the field (such as ctFavoriteColor) can be used as a macro:

Variable Name
Macro

ctFavoriteColor

{{ctFavoriteColor}}

If you don't know the Variable of the field you want to use, you can view the creative template using the Creative Templates API. The Variable is part of the Fields object.

The macro can be used as a value (such as a string or an array value). It cannot be used as a key.

Creative Metadata
Macro Expandable?
Rendered As
{
  "favoriteColor": "{{ctFavoriteColor}}"
}

Y

{
  "favoriteColor": "blue"
}
{
  "favoriteThings": [
    "flowers",
    "puppies",
    "{{ctFavoriteColor}}"
  ]
}

Y

{
  "favoriteThings": [
    "flowers",
    "puppies",
    "blue"
  ]
}

{
"favorites": {
"color": "{{ctFavoriteColor}}"
}
}

Y

{
"favorites": {
"color": "blue"
}
}

{
  "{{ctFavoriteColor}}": "this makes me happy"
}

N

{
  "{{ctFavoriteColor}}": "this makes me happy"
}

If the value of the field contains JSON, it will be escaped inside a string.

Archiving Creative Templates

Create templates cannot be deleted. However, they can be archived. When a creative template is archived:

  • It cannot be used to create new creatives
  • It will not appear in the list of creative templates when creating or updating a creative
  • Creatives that use the archived template WILL continue to serve and CAN be updated

To archive a creative template, use the Creative Templates API archive endpoint. If you need assistance, contact Adzerk support.

If you choose to update a creative that uses an archived template, the text [Archived] will be next to the template name in the Creative Templates dropdown. Archived templates will not appear in the dropdown otherwise.

Creative Templates


Suggested Edits are limited on API Reference Pages

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