PRODUCT

Amazon Ad Server will be sunset in Q4 2024, please visit this page (AAS offboarding information) for offboarding support resources and sunset FAQs. Details shared on that page represent the most up to date information in the Help Center, if you find disparate information in other resources please default to the information in the AAS offboarding information page accordingly.

Please note that on October 1, 2024, the ability to create new campaigns, placements and tag managers was disabled.

Follow

Note

Note: To learn more about this format, preview a demo, or to see build guides for other authoring tools, see About single expandable.

Create an ad using an Amazon Ad Server template

When creating a single expandable in a code editor, it is recommended that you start with our official template bundle.

Files within the bundle:

README.txt

Amz_SingleExpandable_1_0_1_300x250_DCO.zip

Amz_SingleExpandable_1_0_1_300x250_Video.zip

Amz_SingleExpandable_1_0_1_300x250.zip

Download the template and then select the desired folder from the list of available dimensions and options.

You can also customize the dimensions according to your requirements. Everything can be personalized, including media controls of the video.

Included files

The following table describes the list of files that are included in the downloadable template.

File Name

Description

Required

index.html

HTML file for the banner.

Required

config.js

Configuration/manifest file for the ad. Used for actions such as default ad settings and Dynamic Creative.

Required

styles/style.css

Style sheet for the banner and its HTML elements.

Required

scripts/script.js

JavaScript (logic and tracking) for the banner.

Required

images/logo.png

AAS logo. Replace this logo with your own logo, or delete this image if it is not needed.

Optional

images/default.jpg

Fallback image shown in unsupported browsers.

Required

images/poster.jpg

Poster image displayed in the video location in the banner before the video starts and after the video ends.

Optional

videos/video.mp4

Temporary video that you should replace with your own video (only in video template )

Optional

Setting up your ad in Amazon Ad Server

After you finish creating your ad, proceed to setting up your ad in AAS. For more information, see Set up a single expandable.

Additional resources

Prepare for bulk upload

If you are planning to upload multiple ads, make sure that the Ad Creation Wizard in AAS recognizes your workspace as a single expandable. Verify that the config.js file contains the following JavaScript:

define({
    "adFormatId": 39
});

For more information, see Set up multiple ads using Ad Creation Wizard.

Shared libraries

If you are developing ads with third-party libraries, we recommend that you call these libraries from a CDN (Content Delivery Network) when possible. This will help improve loading time and caching.

Dynamic Creative Optimization

If you need to add Dynamic Creative Optimization (DCO) elements to your creative, see Add dynamic elements to your HTML ads using a code editor .

Advanced configuration

Customization in HTML

All of the single expandable functionalities are coded within the template files. At a minimum, the only change you will need to make is to the image .jpg asset, the video .mp4 asset, and their respective styles and markup.

To update the layout and design of a template, open the index.html and style.css files in a text editor.

Resize banner

To customize the dimensions of a main banner, update the style.css file to match your new size, and generate a default image for the ad. Upon ad setup in AAS, the dimensions of the default image will be used to set the size for the banner.

Resize expansion

To resize the expansion, edit the .css and the EB.initExpansionParams() method's arguments. This method invocation is in the index.html.

Update the values of the arguments so that they fit the size of your expanded panel. For example:

if(0)EB.initExpansionParams(xPosition, yPosition, width, height);

When populated:

if(0)EB.initExpansionParams(140, 0, 300, 600);

And the line in the template's index.html file:

<script>if(0)EB.initExpansionParams(140, 0, 300, 600);</script>

Another way to initialize or resize the expansion is through the config.js that can be found on the root folder along with the index.html. For example:

define({
    "adFormatId": "39",
    "name": "Amz_SingleExpandable_1_0_1_300x250_Video",
    "defaultBanner": "Main_Banner",
    "banners": [{
        "name": "Main_Banner",
        "width": 300,
        "height": 250,
        "expansionParams": {
            "x": 200,
            "y": 0,
            "width": 500,
            "height": 250
        },
        "defaultImage": "images/default.jpg"
    }],    "clickThrough": {
        "url": "https://advertising.amazon.com/en-us/solutions/products/sizmek-ad-suite",
        "target": "newWindow",
        "showMenuBar": true,
        "showAddressBar": true    }
});

Variables

The following tables provide additional variables that are available for this format. You can use these additional items to fully customize your ad.

Variable Name

Description

Type

Editable

  • banner

  • panel

  • expand_btn

  • clickthrough_btn

  • user_action_btn

  • close_btn

  • video

Global variables used to select DOM elements.

Add, edit, or remove these variables as you modify elements in the index.html.

String

DOC_tick.gif

Functions

These functions will be chain-triggered when the window is loaded and the AdKit API is ready (initiated by the checkIfAdKitReady function invoking initializeCreative). They are all located in the panels/default/scripts/script.js file.

Function Name

Description

Additional Code Allowed

initializeCreative

Initializes the creative.

You can add your own script if you want to run a script when the creative is initialized.

DOC_tick.gif

initializeVideoTracking

Initializes video tracking by creating a new instance of the EBG video module. It also contains auto-play video functionality in video templates.

DOC_tick.gif

addEventListeners

Adds all of the event listeners. In the template, the click event for the click-through and user action counter was added. In addition, the webkitendfullscreen event listener for iOS devices was added to handle some positioning issues when exiting the full screen video player.

DOC_tick.gif

handleExpandButtonClick

Click on the event handler function for the expand button. It also contains auto-play video functionality for video templates.

DOC_tick.gif

handleCloseButtonClick

Invoked to close the panel, and enable the page scrolling before the ad is collapsed. This function also pauses the video.

DOC_tick.gif

handleUserActionButtonClick

Click event handler for user action button. Calls and tracks the user action. This function also pauses the video.

DOC_tick.gif

handleClickthroughButtonClick

Click handler for the click-through button. Calls this function for the default click-through. This function also pauses the video.

DOC_tick.gif

Demo

Click here to preview a demo of single expandable format.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments