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.



Note: To learn more about Dynamic Creative Optimization (DCO), or to view guides about other authoring tools, see Introduction to dynamic creative.


The following sections describe how to define dynamic elements manually for HTML ads that are hand-coded in a code editor.

The Dynamic Creative feature uses the Amazon Ad Server (AAS) creative AdKit for developers. AdKit includes ad-related functionalities that provide quick and easy development of your HTML ads.


Important: Make sure to properly load the AdKit API before building your dynamic creative. For more information, see Load and Initialize the API.

AdKit implements Dynamic Creative with the following dynamic data types:

  • HTML Components: HTML code fragments that are inserted automatically into HTML tags in the ad’s index.html file.

  • Variables: String variables that are accessible for use by the ad’s JavaScript code. The AdKit API retrieves values for these variables.

Adding Dynamic Creative to HTML ads requires configuring and placing the following files in the root folder of the Workspace.




The ad’s main creative file. Includes the AdKit script that runs the config.js.


The config.js file includes the Dynamic Creative ad configuration, and serves as the main configuration file for the creative AdKit.

Configuring Dynamic Elements

Use one or both of the following methods to configure dynamic data types:

  • Method A: Define variables inside your config.js file, and use the AdKit API to access these variables inside your JavaScript code.

  • Method B: Map HTML tag IDs from your index.html file to items in your config.js file, to automatically update the index.html with dynamic adkit-components.

You can use both methods in the same ad.


The following example uses both methods to demonstrate how to convert a div that has the ID BookPrice into a dynamic element.

  1. Open your index.html file.

  2. Create a div with the ID BookPrice.

    <div id="BookPrice">
  3. Save your file.

Before starting to configure the dynamic elements, create a div, and make sure its ID is defined.


Important: Please note that if you are using a dynamic video element, it will be tracked automatically. You should not manually include or initialize the Video Module, as this can result in duplicate tracking of video progress and events.

Creating Ad Versions in Amazon Ad Server

Once you upload your ad to AAS , the Versions tab is available from the Ad Setup page. The Versions page includes the HTML and variable items that you defined in the config.js file. For more information about versioning, see Work with versions of a dynamic creative ad.

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