Skip to end of metadata
Go to start of metadata

Creative Template Service

The AppNexus platform categorizes creatives by format, media type, and media subtype. Format defines the resource type of creatives (flash, image, etc.); media type defines the general display style of creatives (banner, expandable, video, etc.); and media subtype defines the specific display style of creatives (standard banner, MediaMind expandable, or Standard VAST).

Standard Templates

For each format, media type, and media subtype combination, AppNexus provides a standard creative template that ensures proper rendering on web pages when creatives are served. You cannot edit these templates, but the Creative Template Service allows you to view them and examine their rendering code.

Custom Templates

If you want to customize the way certain types of creatives render, you can build your own templates. With custom templates, you have complete control of the JavaScript, HTML, or XML rendering code, and you can define macros to prompt your traffickers to enter information and make decisions about the behavior of creatives when they are uploaded.

You can have up to 100 custom templates. Please note, however, that AppNexus does not provide support for creatives that do not render correctly as a result of errors in custom template code.

REST API

To view all templates (standard and custom):

To view standard templates only:

To view a specific template:

To add a new custom template:

To modify a custom template:

To modify a custom template, you need to use your member user rather than your bidder user. To learn more about different user types, see Bidders, Members and Users 

When you modify a custom template, your changes immediately affect any creatives that are already using the template. If your changes cause these creatives to stop rendering properly, their audit status will be changed to "rejected," and they will stop serving on most third-party inventory.

To delete a custom template:

You cannot delete a custom template that is used by one or more creatives, but you can archive the template to prevent future creatives from using it. See the Archiving a custom template example below for more details.

JSON Fields

Field

Type (Length)

Description

Default

Required On

id

int

The ID of the creative template.

 

PUT/DELETE, in query string

name

string (30)

The name of the creative template.

 

POST

description

string

The description of the creative template.

 

 

member_id

int

Read-only. The ID of the member that owns the template. For standard AppNexus templates, this is null.

 

 

media_subtype

object

The display style of creatives that can use this template. Each media subtype belongs to a superordinate media type, for example, the "Standard Banner" media subtype belongs to the "Banner" media type. See Media Subtype below for more details.

 

POST

format

object

The format of creatives that can use this template, for example, "image" or "flash". See Format below for more details.

 

POST

is_default

Boolean

If true, the template is automatically assigned to creatives that match the template's media type, media subtype, and format. When the creatives are uploaded, this default assignment can be overridden, if necessary. Note that there can be only one default creative template per media type, media subtype, and format combination.

false

 

is_archived

Boolean

If true, the template is archived. Archiving a template prevents future creatives from using the template but does not affect creatives already using the template.

false

 

content_js

string

The template's rendering code in JavaScript. The code can include both AppNexus standard macros and your own custom macros. AppNexus macros must begin with the $ symbol, and custom macros must begin with the # symbol. Each custom macro must be defined in the macros array.

 

POST, if content_html and content_xml are not provided

content_html

string

The template's rendering code in HTML. The code can include both AppNexus standard macros and your own custom macros. AppNexus macros must begin with the $ symbol, and custom macros must begin with the # symbol. Each custom macro must be defined in the macros array.

 

POST, if content_js and content_xml are not provided

content_xml

string

Deprecated.

 

 

callback_content_html

string

When media_subtype is "Popup" or "Popunder", content_js defines the rendering code for the pop window, and this field defines the rendering code for the content in the pop window.  

 

 

macros

array of objects

The custom macros used in the content_js, content_html, or content_xml fields. You can include up to 20 custom macros in a template. See Custom Macros below for more details. 

 

 

last_modified

timestamp

Read-only. The date and time when the creative template was last modified.

 

 

Media Subtype

Field

Type

Description

Default

Required On

id

int

The ID of media subtype.

 

POST

name

string

Read-only. The name of the media subtype.

 

 

mediatype_id

int

Read-only. The ID of the media type to which the subtype belongs.

 

 

media_type_name

string

Read-only. The name of the media type to which the subtype belongs.

 

 

Format

You can use the Creative Format Service to view all supported creative formats.

Field

Type

Description

Default

Required On

id

int

The ID of creative format.

 

POST

name

string

Read-only. The name of the creative format.

 

 

Custom Macros

You must define each custom macro used in the content_js, content_html, or content_xml field.

Field

Type (Length)

Description

Default

Required On

code

string (30)

The macro name exactly as it is used in the content_js, content_html, or content_xml field. For example, if #{BORDER_SIZE} is the macro in the content_js field, you would pass "BORDER_SIZE" here. 

 

POST

name

string (50)

The user-friendly name for this macro that traffickers will see when they add creatives that use this template via the UI. 

 

POST

type

enum

The type of value that traffickers will provide for this macro when they add creatives that use this template via the Creative Service or UI. Possible values: "true/false", "string", "url", "integer", "decimal", "string_list", "select_from_list". For example, on the UI, if you set this to "true/false", traffickers will see the macro name followed by a check box.

 

POST

is_required

boolean

If true, traffickers will be required to provide a value for the macro when adding creatives that use this template.

 

POST

default_value

string

If is_required is false, this is the default value that will be used when traffickers do not provide a value for the macro when adding creatives that use this template.

 

POST, if is_required is false

other_data

string

The accepted values for the macro, if type is "string_list" or "select_from_list".

 

 

Examples

Viewing all creative templates
Viewing a specific creative template
Adding a custom template
Modifying a custom template
Archiving a custom template
Re-activating an archived custom template
Deleting a custom template
  • No labels