Skip to end of metadata
Go to start of metadata

Creative Macro Check Service

If you are running third party creatives, you can use this service to allow AppNexus to check third party tags and append parameters in the query string, replace the domain, or insert AppNexus click tracking macros in the appropriate place for you. We currently support the following ad servers: MediaMind, Atlas, Fetchback, and DoubleClick.

If we are able to insert the AppNexus macros, then the new tag or URL will be returned in the response. If we are unable to ensure that the right macro was inserted (the value in the existing_other_macros or unmatched fields is not 0 within the response), then the value within the new_content or new_media_url field will not be displayed in Console.

On This Page

REST API

Replace content within a URL based on predefined patterns:
PUT https://api.appnexus.com/creative-macro-check
(replace_pattern_in_content_url JSON)

Replace content within a URL based on predefined patterns and test patterns:
PUT https://api.appnexus.com/creative-macro-check?include_tests=1
(replace_pattern_in_content_url JSON)

JSON Fields

Field

Type

Description

Default

Required On

content

string

Field is used when modifying content. The content that is being modified to include AppNexus macros.

PUT, when transforming content

new_content

string

Field is populated when modifying content. The updated content where all non-secure macros have been evaluated. This field will contain the same value as content unless all AppNexus macros are successfully inserted.

new_content_secure

string

Field is populated when modifying content. The updated content where all macros, both secure and non-secure, have been evaluated. This field will contain the same value as content unless all AppNexus macros are successfully inserted.

media_url

string

Field is used when modifying a media URL. The media URL that is being modified to include AppNexus macros.

PUT, when transforming a media URL

new_media_url

string

Field is populated when modifying a media URL. The updated media URL where all non-secure macros have been evaluated. This field will contain the same value as media_url unless all AppNexus macros are successfully inserted.

new_media_url_secure

string

Field is populated when modifying a media URL. The updated media URL where all macros, secure and non-secure, have been evaluated. This field will contain the same value as media_url unless all AppNexus macros are successfully inserted.

recognized_servers

array of strings

The names of the adservers that contain a URL pattern matching the value within the content or media_url field. See Macro Replacements below for more information.

found_urls

int

The number of 'src=' or 'href=' URLs found in the creative content.

matched_urls

int

The number of found_urls that are from a recognized ad server.

macro_replacements

array

An array with information about replacements that were done, listed out by macro type (e.g. cachebuster). See Macro Replacements below for more information.

warning

string

This field displays a warning message if the value within the new_content_secure or new_media_url_secure is not secure.

Macro Replacements

Field

Type

Description

type

string

Specifies whether the object has information about the cachebuster or the click_url.

replaced

int

The number of URLs that had a macro for that type successfully inserted.

existing_other_macro

int

The number of URLs where we were able to determine where to insert the macro, but there was already something there, so we left it alone. If this value is not 0, then the value within the new_content or new_media_url field will not be displayed in Console.

existing_appnexus_macro

int

The number of URLs where we were able to determine where to insert the macros.

unmatched

int

Number of URLs for which we could not determine how to insert the macros. If this value is not 0, then the value within the new_content or new_media_url field will not be displayed in Console.

Recognized Servers

Field

Type

Description

adserver_name

string

The name of the adserver.

Examples

Replace macros within a third-party tag (content)
Replace macros within a third-party URL (media URL)