Skip to end of metadata
Go to start of metadata

AppNexus Seller Tag API Reference

This page describes the usage of the functions and variables of the AppNexus Seller Tag (AST) JavaScript library. For an example of a page with these functions implemented, see Set up Placements with AST.

You cannot load ads from HTML hosted in localhost.

On This Page

Public Variables

  • apntag : Primary AppNexus Seller Tag object class.
  • apntag.anq : Command queue for AppNexus Seller Tag functions. Allows commands to be queued during page load time and executed when the ast.js script loads asynchronously.

Debug Mode

The AST library suppresses its console.log statements by default unless debug mode is enabled. In debug mode, developer console output is available.

To enable debug mode for the page you are viewing, add ?ast_debug=true to the end of the URL of the page. For example:

www.site.com/page.html?ast_debug=true

You can also enable debug mode on a tag by adding: apntag.debug = true;

Using Local Storage for Debug Configuration

When you are debugging AST and using the administrative dongle, this gives you access to additional debug details. These details show potentially sensitive information about the setup. When you put the dongle value in the url, it will be sent in the referrer to third-parties. This is how to update and store the dongle value in the browser and local storage. This eliminates the need of having to put that value in the url.

This is the recommended method of using this feature:

  1. Access Debug Mode. You can accomplish this with the no-admin dongle value.
  2. There is an entry box called AST Dongle Value. Enter in your admin dongle value. It is saved to local storage.
  3. Remove the dongle value from the url.
  4. Refresh the page.

Debug Auction

To run a debug auction, add ?ast_debug=true&ast_dongle=ABC&ast_debug_member=1234 to the end of the URL of the page you are viewing (where ABC is your dongle used for debugs and 1234 is your debug member ID). For example: http://www.site.com/page.html?ast_debug=true&ast_dongle=ABC&ast_debug_member=1234

Alternatively, debug mode can be enabled on the tag using:

AST Toolkit

Publishers desire a way to quickly identify the source of particular ads on their page so they can make decisions about allowing them to serve in the future.  The AST Toolkit allows them to easily identify and block a creative that they see on their page.

To turn on AST Toolkit, add ?ast_toolkit=true&ast_dongle=ABC to the end of the URL of the page you are viewing (where ABC is your dongle used for debugs). For example: http://www.site.com/page.html?ast_toolkit=true&ast_dongle=ABC

Alternatively, AST Toolkit can be turned on via the tag using:

The AST Toolkit will provide the following data for each ad slot to the user:

    • Creative ID
    • Buyer Member ID
    • Creative size served
    • Available sizes on the auction
    • Winning bid (CPM)
    • Demand source
    • Ad type (Banner, Video, Native)
    • Media Type ID
    • Link to Console Ad Quality screen for profile
    • Link to Creative Preview

 

AST Toolkit requires that member is set in setPageOpts() or defineTag().

Functions