Note
Note: To learn more about this format, preview a demo, or to see build guides for other authoring tools, see About expandable banner.
When creating a expandable banner in a code editor, it is recommended that you start with our official template bundle.
Files within the Bundle:
README.txt Amz_ExpandableBanner_1_0_1_300x250.zip
Amz_ExpandableBanner_1_0_1_300x250_DCO.zip
Amz_ExpandableBanner_1_0_1_300x250_Multipanel.zip
Amz_ExpandableBanner_1_0_1_300x250_Video.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.
The following table describes the list of files that are included in the downloadable template.
File Name |
Description |
Required |
---|---|---|
|
HTML file for the banner. |
Required |
|
Configuration/manifest file for the ad. Used for actions such as default ad settings, and Dynamic Creative. |
Optional |
|
Style sheet for the banner and its HTML elements. |
Optional (if code is included in the HTML file) |
|
JavaScript (logic and tracking) for the banner. |
Required |
|
Fallback image shown in unsupported browsers. |
Required |
|
Logo for your ad. |
Required |
|
This folder contains all files related to panel and its creative assets. |
Optional |
|
HTML file for the panel. |
Required |
|
Style sheet for the banner and its HTML elements. |
Optional (if code is included in the HTML file) |
|
JavaScript (logic and tracking) for the banner. |
Required |
|
This folder contains the image assets for the scroll panel. |
Optional |
|
This folder contains all files related to panel and its creative assets. |
Optional |
|
HTML file for the panel. |
Required |
|
Style sheet for the banner and its HTML elements. |
Optional (if code is included in the HTML file) |
|
JavaScript (logic and tracking) for the banner. |
Required |
|
This folder contains the image assets for the scroll panel. |
Optional |
|
This folder contains all files related to panel and its creative assets. |
Optional |
|
HTML file for the panel. |
Required |
|
Style sheet for the banner and its HTML elements. |
Optional (if code is included in the HTML file) |
|
JavaScript (logic and tracking) for the banner. |
Required |
|
This folder contains the image assets for the scroll panel. |
Optional |
|
Temporary video that you should replace with your own video. |
Required for video format |
The following table describes the additional files that are included in a video template.
File Name |
Description |
Required |
---|---|---|
|
Temporary video that you should replace with your own video. |
Required |
|
Poster image displayed in the video location in the banner before the video starts and after the video ends. |
Optional |
After you finish creating your ad, proceed to setting up your ad in AAS. For more information, see Set up an expandable banner.
For the AAS Ad Wizard to recognize your workspace as an expandable banner verify that the config.js
file contains the following:
define({ "adFormatId": 43 });
For more information, see Set up multiple ads using Ad Creation Wizard.
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.
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.
All of the HTML Expandable Banner functionalities are coded within the script.js
files and styles in style.css
files. At a minimum, the only change you will need to make is to the image .jpg
and video .mp4
assets and their respective styles and markup.
You can modify the script files based on your design and what functionalities you will need for your ad. To update the layout and design of a panel or banner, open the index.html
and style.css
files separately in text editors.
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.
To customize the size of any panel, update the style.css
in the styles folder of that panel to the required dimensions, and update the EB.initExpansionParams()
method's arguments in the index.html
of the given panel to match your dimensions.
For example:
EB.initExpansionParams(xPosition, yPosition, width, height);
When populated, it looks like this:
EB.initExpansionParams(0, 0, 300, 600);
Line 12 of our template's panel index.html
file:
<script>try{EB.initExpansionParams(0, 0, 300, 600);}catch(e){}</script>
The following tables provide additional variables and functions that are available for this format. You can use these additional items to fully customize your ad.
These functions are located in the script.js
file.
Function Name |
Description |
Additional Code Allowed |
---|---|---|
|
Collapse event handler for the collapse button. |
|
|
Initializes video tracking by creating a new instance of the EBG Video Module. It also contains auto-play video functionality in video templates. |
|
|
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 |
|
|
Click event handler function for the expand button. It also contains auto-play video functionality for video templates. |
|
|
Click handler for the user action button. |
|
|
Click handler for the click-through button. |
|
|
Fires Click_Main_Collapsed clickthrough. |
Click here to preview a demo of expandable banner format.
Comments