Note
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
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.
File |
Description |
---|---|
|
The ad’s main creative file. Includes the AdKit script that runs the |
|
The |
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 yourconfig.js
file, to automatically update theindex.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.
-
Open your
index.html
file. -
Create a
div
with the IDBookPrice
.<div id="BookPrice"> </div>
-
Save your file.
Before starting to configure the dynamic elements, create a div
, and make sure its ID is defined.
Important
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.
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.
Comments