Note
Note: To learn more about this format, preview a demo, or to see build guides for other authoring tools, see About immersive takeover.
When creating an immersive takeover in a code editor, it is recommended that you start with our official template.
Files within the bundle:
README.txt
Amz_ImmersiveTakeover_1_0_1_ImageSkin.zip
Amz_ImmersiveTakeover_1_0_1_ImageSkin_DCO.zip
Amz_ImmersiveTakeover_1_0_1_Video.zip
Amz_ImmersiveTakeover_1_0_1_VideoSkin.zip
Amz_ImmersiveTakeover_1_0_1_VideoSkin_DCO.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 tables describe the list of files that are included in each downloadable template.
File Name |
Description |
Required |
---|---|---|
|
The banner file that is 1x1 displayed on the page. |
Required |
|
HTML file for header panel. |
Required |
|
HTML file for the left gutter panel. |
Required |
|
HTML file for the right gutter panel. |
Required |
|
Style sheet that resets the default styles of the browser. |
Optional |
|
Style sheet for the banner and its HTML elements. |
Optional (if code is included in the HTML file) |
|
Style sheet for header panel creative. |
Optional (if code is included in the HTML file) |
|
Style sheet for left gutter panel creative. |
Optional (if code is included in the HTML file) |
|
Style sheet for right gutter panel creative. |
Optional (if code is included in the HTML file) |
|
Core script to use the immersive takeover to load and initialize the ad and pass the domain configuration object to custom script. |
Required |
|
Basic style sheet for the immersive takeover format. |
Required |
|
Core script for banner to load and initialize ad and pass domain configuration object to custom script. |
Required |
|
Core script for header panel to load and initialize ad. |
Required |
|
Core script for left gutter panel to load and initialize ad. |
Required |
|
Core script for the right gutter panel to load and initialize ad. |
Required |
|
1x1 backup image for the banner. |
Required |
|
Background image asset to inject in the publisher site |
Optional |
|
Background image asset to inject in the publisher site. |
Optional |
|
Background image asset to inject in the publisher site. |
Optional |
|
Background image asset to inject in the publisher site. |
Optional |
File Name |
Description |
Required |
---|---|---|
|
Background image asset to display in background panel. |
Optional |
|
Core script for background panel to load and initialize ad. |
Required |
|
Style sheet for background panel ad. |
Optional |
|
HTML file for background panel. |
Required |
|
Image on button for expanding the header. |
Required |
|
Image on close button appearing in expanded view. |
Required |
|
Image asset for video poster. |
Optional |
|
Demo video in mp4 format. |
Required |
File Name |
Description |
Required |
---|---|---|
|
Background image asset to display in background panel. |
Optional |
|
Core script for background panel to load and initialize ad. |
Required |
|
Style sheet for background panel ad. |
Optional |
|
Image asset for video poster. |
Optional |
|
Demo video in mp4 format. |
Required |
|
HTML file for background panel. |
Required |
|
Image asset for the drop-down icon that appears in controls panel. |
Optional |
|
Image asset for the mute button icon that appears in controls panel. |
Optional |
|
Image asset for the pause button icon that appears in controls panel. |
Optional |
|
Image asset for the play button icon that appears in controls panel. |
Optional |
|
Image asset for the unmute button icon that appears in controls panel. |
Optional |
|
Core script for the controls panel to load and initialize ad. |
Required |
|
Style sheet for the controls panel ad. |
Optional |
|
HTML file for the controls panel. |
Required |
After you finish creating your ad, proceed to setting up your ad in AAS. For more information, see Set up an immersive takeover.
For the AAS Ad Creation Wizard to recognize your workspace as a immersive takeover, verify that the config.js
file contains the following:
define( { "adFormatId": 10350 } );
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.
The following tables provide additional variables, functions, and methods that are available for this format. You can use these additional items to fully customize your ad.
Variable Name in AAS (Variable Key in config.js) |
Description |
Type |
Default and Accepted Values |
---|---|---|---|
Right Gutter Name ( |
Right gutter panel name as set in AAS. |
String |
Default: rightGutter |
Left Gutter Name ( |
Left gutter panel name as set in AAS. |
string |
Default:leftGutter |
Position ( |
Gutters |
String |
Default: fixed Accepted: fixed or scroll |
Page Background ( |
You will be able to inject a background image only once when the ad is loaded in the publisher's page. You can select the element and the behavior to inject. |
String |
enabled:false, img:images/background_default.jpg, color:#000000, size:cover, position:top center, repeat:no-repeat, attach:fixed, fade:fade-in, fade_time:3000, inject:body, injectType:div, clickable:false |
Auto Reposition Interval ( |
Panel reposition interval. Set to 0 to turn off the interval. Panels reposition in every "n" milliseconds. |
Number |
Default: 100 |
Content Width ( |
Page content width. |
Number |
Default: 970 |
Eye Div ZIndex ( |
Default z-index of the eye div. |
String |
Default: undefined |
Gutters Default Height ( |
Gutters default height. |
Number |
Default: 1000 |
Gutter Top Position ( |
Defines the top position of the gutters. JavaScript will try to get the value from the current page and apply that value to set the top position of the gutters. However, if JavaScript failed to get any value from the page, it will take the value from this custom variable. |
Number |
Default: 0 |
Header Panel Name ( |
Header panel name as set in AAS. |
String |
Default: header |
Background Panel Name ( |
Background panel name as set in AAS. |
String |
Default: background |
Background Placement Selector ( |
Div reference to inject background panel. A valid CSS selector should be present in this variable to successfully push background panel. |
String |
Default: body |
Background Inject Type ( |
Background panel injection type. |
String |
Default: last Accepted values:
|
Header Size Inheritence ( |
Header panel behavior will change based on the option selected. |
String |
Default: 0-781:450,782-1023:250,1024-4000:250 Accepted: |
Header Expanded Height ( |
Header panel expanded height. |
Integer |
Default: 417 |
Min Header Width ( |
Minimum header width if custom script fails to read page content width. |
Integer |
Default: 970 |
Expand Full Screen Below ( |
Expand header panel to fullscreen if viewport value is less than value mentioned in this variable. |
Integer |
Default: 3000 |
Auto Collapse Timeout ( |
Delay, in seconds, to auto collapse header pane when panel auto expands. |
Integer |
Default: 10 |
Background ZIndex (mdBackgroundZIndex) |
Background panel z-index. |
Integer |
Default: -1 |
Header Panel Top Offset ( |
Top offset to display above the header panel. |
Integer |
Default: 0 |
Header Panel Bottom Offset ( |
Bottom offset to display above the header panel. |
Integer |
Default: 0 |
Show Gutters ( |
Show or hide gutters. |
Boolean |
Default: true |
Content Offset ( |
Number of pixels of padding between the width of the content and the start of the gutter panels. NoteNote: Only for VideoSkin template. |
String |
Default: controls |
Header Expand Percentage ( |
Header expansion percentage. If set to 100, header will expand to fullscreen by pushing page content outside. If set to value less than 100, some part of page content may be displayed at the bottom. |
Integer |
Default: 100 |
Pushdown Animate ( |
Animate expand/collapse header panel. If set to false, header will immediate expand/collapse. |
Boolean |
Default: true |
Expand Animation Duration ( |
Time taken by header panel to expand animate. |
Integer |
Default: 1000 |
Collapse Animation Duration ( |
Time taken by header panel to collapse animate. |
Integer |
Default: 1000 |
Expand Collapse Animation Easing ( |
Easing for header panel expand and collapse animation. |
String |
Default: easeInOutQuint Accepted: |
Auto Expand Delay ( |
Delay auto expansion by value in this variable. |
Integer |
Default: 0 |
Expand To Full Screen ( |
Expand header panel to fullscreen. |
Boolean |
Default: false |
Backup Image Path ( |
Relative path to the backup image, if a custom image is required. This allows a fallback experience to display an image that is not a 1x1 even though the tag is a 1x1 tag. Template workspace includes a file that could be used here as an example, if this custom variable were set to |
String |
Default: undefined |
Content Alignment (mdContentAlignment) |
Alignment of the content on the page. This variable is only used if |
String |
Default: C Accepted:
|
Content Offset ( |
Number of pixels of padding between the width of the content and the start of the gutter panels. |
Integer |
Default: 0 |
Content Placement Selector ( |
Div reference to detect content of page. A valid CSS selector should be present in this variable to successfully detect the content location and width. When this variable is set to anything other than undefined, There is a new and experimental method to get the widest element from any page automatically by enabling {"automaticDetection": true} More details about this feature below. |
String |
Default: 0 |
Align Top Scroll ( |
Align gutters to top if header goes out of view. |
Boolean |
Default: false |
Content X Pos Offset ( |
Value, in pixels, to offset the detected location of the content area. Positive value moves the content location to the right; negative value moves the content location to the left. This allows for asymmetrical layouts with padding on the left/right. This variable is only used when |
Integer |
Default: 0 |
Header Inject Type ( |
Header panel injection type. |
String |
Default: after Accepted: |
Header Offset ( |
Vertical offset from header; affects header panel and gutter panels. |
Integer |
Default: 0 |
Header Placement Selector ( |
Div reference to inject header panel. A valid CSS selector should be present in this variable to successfully push header panel. If undefined, will inject header at tag location |
String |
Default: undefined |
Right Gutter Max Width ( |
Right gutter maximum width. Set to 0 to define if right gutters should cover available page width on right side of site content. |
Integer |
Default: 500 |
Right Gutter Minimum Width |
Right gutter minimum width. |
Integer |
Default:100 |
Gutter Max Width ( |
Right gutter maximum width. Set to 0 to define if right gutters should cover available page width on right side of site content. |
Integer |
Default: 500 |
Gutter Minimum Width ( |
Right gutter minimum width. |
Integer |
Default: 100 |
ProgEnable ( |
Determines whether to load the programmatic settings. |
Boolean |
Default: false |
Programmatic Settings Folder Path ( |
Location from which to load the programmatic settings files. |
String |
Default: |
Parent Levels To Resize ( |
This variable is ONLY for the |
Number |
Default: 0 |
Auto Scroll Top On Orientation ( |
In mobile and tablet devices when the orientation is changed automatically, the scroll bar will be moved to the position of the header. If there is no header, it will be moved to the top of the page. |
Boolean |
Default: true |
The following custom interactions are reported by the ad and can be reviewed in AAS reporting (besides standard ad interactions).
Interaction Name |
Description |
---|---|
|
(Auto) When left gutter expands for first time. |
|
(Auto) When right gutter expands for first time. |
|
(Auto) When the header panel is expanded automatically. |
|
(User) When user click on the expand button. |
|
(Auto) When user click on the close button. |
|
(User) When user click on the close button. |
|
Click-through fired once the user clicks the click-through button that appears in the left gutter. |
|
Clickthrough fired once the user clicks the click-through button that appears in the right gutter. |
|
Click-through fired once the user clicks the background panel. |
|
Click-through fired once the user clicks the background image when the clickable option is enabled in the custom variable |
All of the immersive takeover functionality is programmed in the template files. At a minimum, the only changes you will need to make are to the loaded image and its style.
Note
Note: When updating or replacing images or videos, make sure to also update references to their file names and dimensions found in index.html
, style.css
, and script.js
as necessary. To update the layout, design, and functionality of a template, open the HTML, CSS, and JS files in a text editor.
Before initializing the immersive takeover, you only need to identify the asset; depending on this option, the banner or panel will load different functions and the behavior could change.
For example:
var config = { panel: "header" }; var immersiveTakeover = new immersiveTakeover(config);
Property |
Description |
Options |
---|---|---|
|
Defines the type of the element for the immersive takeover. If the value for |
|
Video example:
var config = { panel: "videoskin", videoWidth:1100, videoHeight:416, videoURL: "videos/video1.mp4", videoPoster: "videos/video1.jpg" }; var immersiveTakeover = new immersiveTakeover(config);
Key |
Description |
Options |
---|---|---|
|
Defines the type of the element for the immersive takeover. If the value for |
|
|
If you want to use the |
Integer value. |
|
String that contains the source URL of the video or an array of strings if multiple codecs for the same video are required. |
Single source URL as a string, NoteNote: During video tag dynamic generation, the file extension included in the source URL string will be used to generate the related videos' source tag's |
|
String that contains the source URL of the video poster image. |
Source URL as a string, |
Example:
var config = { panel: "controls", initialPosition:"top-center", expandedPosition:"top-center", collapsedPosition:"top-right", showDelay: 1000 }; var immersiveTakeover = new immersiveTakeover(config);
You can change the position of the controls panel of the three different states, using these options: top-left, top-center, top-right, bottom-left, bottom-center, or bottom-right.
-
When the VideoSkin is loaded
initialPosition
, it appears in the top-center of the page by default. -
When the VideoSkin is expanded
expandedPosition
, it appears in the top-center of the page by default. -
When the VideoSkin is collapsed
collapsedPosition
, it appears in the top-right of the page by default. -
Each panel can be shown with a different delay. You can change it using N milliseconds and modify the property
showDelay
in the config variable.
var config = { panel: "videoskin", videoWidth:1100, videoHeight:416, videoURL: "videos/video1.mp4", videoPoster: "videos/video1.jpg", showDelay: 1000 }; var immersiveTakeover = new immersiveTakeover(config);
The header section of the index.html
loads the essential style sheets, the AdKit API script, and the creative JavaScript file. The header is responsive and adapts to any screen size using our templates. All the elements are placed in relative position, and all of the properties are set in percentage so that elements appear correctly in all device sizes.
If frequency capping is set, the header will auto-expand and auto-collapse after few seconds if the value mentioned within the mdAutoCollapseTimeout
custom variable is greater than zero.
The header panel of the VideoSkin and ImageSkin are transparent and do not contain any creative elements.
If you are not using our templates, you need to include the essential files, and you only need to add the following lines in your code to initialize the immersive takeover format:
var config = { panel: "header" }; var immersiveTakeover = new immersiveTakeover(config);
The custom script will wait for other panels to load and, once all of the panels have been loaded, the custom script will dispatch the afterShowPanelContent
event to all panels. This event notifies those panels to show their creative elements. Within the header script, once this event is received, certain creative elements will fade in. If you identify the asset like header, you will receive some options callbacks from the custom script.
Functions from the header:
-
When you want to expand the header, you must invoke this function:
immersiveTakeover.expand();
-
When you want to collapse the header, you must invoke this other function:
immersiveTakeover.collapse();
Callbacks for the header (optional to use). Header has the behavior to expand and collapse, you can control each state:
-
When the Expand animation is starting:
function afterExpandAnimStart(args) { /* Implement code logic to fire on Expand animation start */ }
-
When the Expand animation is completed:
function afterExpandAnimComplete(args) { /* Implement code logic to fire on Expand animation Complete */ }
-
When the Collapse animation is starting:
function afterCollapseAnimStart(args) { /* Implement code logic to fire on Collapse animation start */ }
-
When the Collapse animation is completed:
function afterCollapseAnimComplete(args) { /* Implement code logic to fire on Collapse animation Complete */ }
To customize the gutters, use an HTML-authoring environment to open index.html
from panels/left_gutter, style.css
from panels/left_gutter or panels/right_gutter, and script.js
from panels/left_gutter or panels/right_gutter. Gutters within the VideoSkin and ImageSkin templates do not contain any creative elements.
If you are not using our templates, you need to include the essential files and you only need to add the following lines at your code to initialize the immersive takeover format:
var config = { panel: "left_gutter" }; var immersiveTakeover = new immersiveTakeover(config);
or
var config = { panel: "right_gutter" }; var immersiveTakeover = new immersiveTakeover(config);
To customize the background panel, use an HTML-authoring environment to open panels/background/index.html
, panels/background/style.css
, and panels/background/script.js
.
The background panel of the VideoSkin template contains a static image and video.
If you are not using our templates, you need to include the essential files and you only need to add the following lines at your code to initialize the immersive takeover format:
var config = { panel: "background" }; var immersiveTakeover = new immersiveTakeover(config);
or if you are using the video background option (VideoSkin)
var config = { panel: "videoskin" }; var immersiveTakeover = new immersiveTakeover(config);
All the panels have the same callbacks for different events that you can use if required.
Callbacks for all panels (optional to use):
-
afterShowPanelContent
: When the panel is shown.function afterShowPanelContent(args) { /* Implement code logic to fire when the panel is shown */ }
-
onPanelLoaded
: When the panel is loaded.function onPanelLoaded(args) { /* Implement code logic to fire when the some panel is loaded */ if (args.panelName.toLowerCase() == 'leftgutter') { /* do something */ } else if (args.panelName.toLowerCase() == 'rightgutter') { /* do something */ } }
-
onPanelUnload
: When the panel is unloaded.function onPanelUnload(args) { /* Implement code logic to fire when the some panel is unloaded */ if (args.panelName.toLowerCase() == 'leftgutter') { /* do something */ } else if (args.panelName.toLowerCase() == 'rightgutter') { /* do something */ } }
-
adWasClicked
: When the click-through is fired, all the panels will call this function and you can decide if you want to do something. For example, after click-through the video can be paused.function adWasClicked(args){ videoRef.pause(); console.log("Ad was clicked"); }
-
onPageScroll
: If you want to use "onPageScroll" feature you only need to add this function to your code. The function will recieve when the user scrolling up/down the percent of the scrollX and scrollYfunction onPageScroll(args) { args.scrollXPercent; args.scrollYPercent; }
To add a video to your project, you must provide a container div
into which the actual video tag and source tags will be injected. The video container div
should not contain any child div
s. No hardcoded video and/or source tags should be placed in the HTML document. The actual video tag and source tags are dynamically generated from within the template script immersiveTakeover_script.js
. This allows the final tags to be loaded into the DOM in a proper state according to the desired functionality and environment.
You can use these functions to initialize the video and video tracking. Callbacks, if utilized, are dispatched on the following video events; ready, play, pause, end, and volume change. See the Video Callback Functions section for further details.
-
To initialize the video:
immersiveTakeover.initVideo(videoContainerRef);
The single parameter accepted by the
immersiveTakeover.initVideo
function is a reference to the element in which the dynamically generated video tag is to be injected. If no parameter is passed, the script will automatically search for an element with an ID of video-container, within the specific HTML DOM, in which to inject the video.<div id="video-container"></div>
You can use the standard events to control the video functions such as play, pause, load, and mute.
videoRef.play(); videoRef.load(); videoRef.muted = true;
-
To resize the video holding the aspect ratio (you will need a
div
container for your video element):immersiveTakeover.resizeVideo(videoContainerRef);
The video-container should have the following or similar style:
#video-container{ background-color: black; position: absolute; width: 100%; height: 92%; }
When creating the following
config
object, you may modify the default setup as required (and according to this document) to optimize the settings for your use case. For instance, you may change thevideoWidth
andvideoHeight
values according to the aspect ratio of your video and to achieve the best resolution possible.var config = { panel: "header", videoWidth:1100, videoHeight:416, videoURL: "videos/video1.mp4", videoPoster: "videos/video1.jpg" };
The Video Callback functions include the following:
-
When the video is injected into the page and ready for function calls and interaction:
function afterVideoReady(args) { /* Implement code logic to fire when the video is ready for function calls and interactions */ }
Note
Note: It is recommended to capture a reference to the dynamically created video within the
afterVideoReady
callback function as this is the first point at which it will be available. Theargs
parameter will contain a reference to the video, which can be read usingargs.video
. Please note the video reference is passed within theargs
parameter of all video-related callbacks. If you do not require a reference to the video element outside of the video related callback functions, or at all, you do not need to capture this reference. -
When the video is played:
function afterVideoPlay(args) { /* Implement code logic to fire when the video Play */ }
-
When the video is ended:
function afterVideoEnd(args) { /* Implement code logic to fire when the video End */ }
-
When the video is paused:
function afterVideoPause(args) { /* Implement code logic to fire when the video Pause */ }
-
When the volume of the video is changed:
function afterVolumeChange(args) { /* Implement code logic to fire when the volume Change */ }
You can synchronize all the panels if you want to use animation that starts at the same time, or you want to start some animation after some determinate action in some panel. You only need to invoke the function syncAllPanels
and send a string parameter.
For example: From the header panel using the callback function afterShowPanelContent
, you can send start to initialize the animation at the same time for all panels.
function afterShowPanelContent(args) { immersiveTakeover.syncAllPanels("start"); }
After calling this function, all the panels you have in the workspace will run the function syncAll
, which you can use to start some animation.
function syncAll(args) { switch (args.state) { case "start": /* Starting the animation */ break; case "end": /* more options */ break; } }
args.state
: Contains the string message, if you need to send several messages, or you can use a switch.
if you want to synchronize only with a specific gutter, you can use this other method.
immersiveTakeover.syncGutterLeft();
or
immersiveTakeover.syncGutterRight();
After invoking it from any panel, the left/right panel will run this function:
function syncGutterLeft() { /* Implement code logic to fire when the synchronize is invoked */ }
or
function syncGutterRight() { /* Implement code logic to fire when the synchronize is invoked */ }
-
closePanel
: You can close the panel from which this function was called, and you can select if the interaction is done by the user (default) or automatically.-
By user
immersiveTakeover.closePanel(); /* Or */ immersiveTakeover.closePanel(false);
-
Automatically
immersiveTakeover.closePanel(true);
-
-
closeAllPanels
: Use this function from any panel to close all panels at the same time.immersiveTakeover.closeAllPanels();
-
fontResize
: Use this function to resize font in the project. The function will receive the reference of the element and the minimum size of the font. The function will modify thefontSize
depending of the resolution of the device.var clickthroughExpandBtn = document.getElementById("clickthrough-expand"); immersiveTakeover.fontResize(clickthroughExpandBtn, 4);
-
getInfo
: Use this function to get all the information about the environment of the device, for example if the ad is in local, or if the device is a mobile, IOS, or if the browser does not supported the autoplay feature. You can change the behavior according to the device.var infoDevice = immersiveTakeover.getInfo(); var isLocal = infoDevice.isLocal; /* if the asset is loaded in local (true/false) */ var isMobile = infoDevice.isMobile; /* if the device is mobile (true/false) */ var isIOS = infoDevice.isIOS; /* if the device is IOS(true/false) */ var isUnsupportedBrowserAutoPlay = infoDevice.isUnsupportedBrowserAutoPlay; /* if the device is not compatible with autoplay feature of the video (true/false) */
Note
Note: Autoplay of the video will not be available in some unsupported devices/environments, such ad iOS9 and below. In this case, the video will automatically default to click-to-play behavior regardless of the autoplay setting. Currently, the only environments listed within the support matrix for this template, that do not support autoplay video, are iOS9 and Samsung browser version 6.
-
loadAdditionalAsset
: Use this function to inject an image from additional asset using the ID in some element in the ad. You will need the element where it will be loaded and the relative path for local testing.var background = document.getElementById("background"); immersiveTakeover.loadAdditionalAsset(background,2,"../../images/gutterLeft_background.png");
-
setPanelZIndex
: Use this function if you need to change the Z-index in some panel manually. It will affect only the panel which is used; you must indicate the number of the Z-index that you want to use.immersiveTakeover.setPanelZIndex(20);
-
seteyeDivZIndex
: Use this function to change the Z-index of the EyeDiv manually. It will affect all the panels that are inside of theeyeDiv
; you must indicate the number of the Z-index that you want to use.immersiveTakeover.seteyeDivZIndex(5);
Note
Note: Using programmatic custom variables is the preferred method, although you can still use the domainConfig.js
file. By default, domainConfig.js
file is disabled.
If you want to use this file, delete the comments line in the index.html
of the banner, and create the domainConfig.js
with your setup.
The domainConfig.js
file contains domain-related customization details that allow you change both ad layout, and with publisher approval even the site layout per domain. While this method has been deprecated in favor of using the programmatic settings, support still exists in the ad format for the domainConfig.js
file.
<script type="text/javascript" src="scripts/domainConfig.js"></script>
You can use the following customizations in the domainConfig.js
script. This script is located in the scripts>domainConfig.js
file. All customizations are also supported in Programmatic Settings Custom Variables.
Customization |
Description |
---|---|
|
Domain name for which this setting will be applied. A subdomain and domain name is enough; full domain URL is not required. |
|
Sets z-index of eyeDiv that holds left gutter, right gutter and header panel. |
|
Page content div reference to align left and right gutter. |
|
Page header div reference to align gutter from top. |
|
Offset from total page content (default is 0). |
|
Offset from header (default is 0). |
|
Align gutter to top if header goes out of view. |
|
Page content div referrer to push background panel. |
|
URL for the site style sheet to push in page content header. |
|
URL for the JavaScript file that will be injected in page header. |
|
Background panel z-index. |
The following shows an example of customizations for the domainConfig.js
file:
var domainConfig = [{ domainName: 'demo.sizmek.com', eyeDivZindex: 10, contentSelector: '#siteContainer', headerSelector: '#siteHeader', contentOffset: 0, headerOffset: 0, alignTopScroll: false, backgroundPlacementSelector: 'body', backgroundInjectType: 'Last', siteStylesheet: 'siteStylesheet/sizmek_demo.css', siteJavascript: 'siteJavascript/sizmek_demo.js', backgroundZindex: -1 }];
Important
Important: If you need a single ad tag to work across a network of sites, either edit the deprecated file domainConfig.js
and set different properties across different publishers, or work with the publisher certification team to ensure the custom variables are set as needed by publisher specifications across all intended sites.
To inject a background image, you can change the body or a specific element in the DOM of the page. You can do one of the following:
-
Use a simple background
-
Perform an advanced setup that uses breakpoints to determine when to load a specific background. For example, you can have a background for mobile devices in portrait mode or for low/high resolution.
The following sections describe the methods for injecting a background on a publisher's page.
This method allows you to inject a background image only once when the ad is loaded. There is no extra code required in the Workspace, and you can set up different options to show the image on the publisher's page.
Note
Note: Make sure that you use this method in conjunction with the mediaQueries method. You want to make sure that when the ad is loaded on the page, the custom variable result is not overwritten.
The following table describes the variables that are available.
Variables |
Description |
Values |
---|---|---|
|
Enables or disables this feature. If set to TRUE, the background is injected on the publisher's site. |
Default: false Accepted: true/false |
|
Allows you to add the path of an image from your Workspace, or use a number, if you want to select an additional asset. |
Default: images/background_default.jpg Accepted: Numbers/complete path from your Workspace |
|
Allows you to select a Hex color, or enter a name of a color, for example, red or green. This will be the background color of the page. For more information, click here. |
Default: #000000 Accepted: Hex numbers, for example, red, blue, transparent |
|
Determines the background size on the page. For more information, click here. |
Default: cover Accepted: For example, cover ,contain, auto, percentage |
|
Determines the position of the background, horizontal or vertical. For more information, click here. |
Default: top center Accepted: top, center, left, right, bottom, x% y%, xpos, ypos |
|
Determines if the background is repeated. If you want use the repeat option, for best results, use a small image. For more information, click here. |
Default: no repeat Accepted: repeat, repeat-x, repeat-y, no-repeat |
|
Determines the behavior for the background when scrolling up/down on the publisher's page. For more information, click here. |
Default: fixed Accepted: fixed, scroll, local, inherit, initial |
|
Determines the tween animation style for the background. When the value is set to none, the background is shown without any animation. |
Default: fade-in Accepted: fade-in, fade-out, fade-in-out, none |
|
Duration of the tween animation when the background is injected on the publisher's site. |
Default: 3000 Accepted: Number in milliseconds |
|
Element in the DOM that is applied to the setup. You can select a class ( |
Default: body Accepted: Any element in the DOM of the page |
|
Methods to inject the background on the publisher's page include the following:
NoteNote: When the image is shown, this option will not have a fade-in/out (tween). |
Default: Div Accpted: style or div |
|
If set to TRUE, the background is clickable on the page with two dynamics, created using two divs (without panels for gutters). |
Default: false Accepted: true/false |
From the workspace, invoke the changePageBackground
function that is included in the workspace ImageSkin.
changePageBackground (image, color, size, position, attach, repeat, fade, fade_time, inject, injectType, clickable);
Note
Note: To avoid conflicts, the existing method is deleted when you use a new method. For example, if you use the variable injectType
with a value of Div , and after you use the injectType
with a value of style ,the Div with the first background will be removed from the page.
The functions are included in the workspace ImageSkin. You can use the mediaQueries
method to define the breakpoints to inject into the css of the publisher's page and improve the user experience when the ad is loaded in different devices with different resolutions. You can add all the that you need, via the following structure:
The following structure shows how to add the mediaQueries
that you might need:
var breakpointsBackgroundsList = [{ mediaQuery: "screen and (min-width: 960px)", setupBackground: { img: "images/background_default.jpg", color: "", size: "cover", position: "top center", attach: "fixed", repeat: "no-repeat", fade: "fade-in", fade_time: 0, inject: "body" }]
Customization |
Description |
---|---|
|
Enables you to add the desired media query. The basic media queries control the width/height, but you can include orientation or advanced behavior to control the minimum device pixel ratio. You do not need to include Examples of media queries include the following:
|
|
Enables you to set up the behavior of your background for each mediaquery. For best results, it is recommended that you modify the following values:
|
setupBackground: { img: "images/background_default.jpg", color: "#000000", size: "cover", position: "top center", attach: "fixed", repeat: "no-repeat", fade: "fade-in", fade_time: 3000, inject: "body", clickable: false }
This feature searches for the widest element found on the content of any page, and then automatically sets up the custom variables mdContentPlacementSelector
and mdContentWidth
. This feature uses the simple skin format in networks with the same tag in rotation.
To enable the automatic detection, change the value of the custom variable mdContentPlacementSelector
. The basic method uses {"automaticDetection": true}
.
The following table describes the parameters that you can configure to customize the search for an element.
Variables |
Description |
Values |
---|---|---|
|
Type of element you want to search on the page |
Default: div Accepted examples include:
|
|
Controls the maximum and minimum width of the pixels for the element you are searching |
Default: 300,1800 Accepted: Numbers - minimum/maximum |
|
Names of elements that you want to skip during the search process |
Default:
Accepted: String |
|
The ID or class names to prioritize in the search process. In instances where a |
Default:
Accepted: String |
The following is a code example of a customized search for an element:
{"automaticDetection":true,"search":"div","horizontalTreshold":"300,1800","avoid":"header,footer,dfp,google,input,search,hide,nav,fb,module,column","priority":"#container,#wrapper,.container,.wrapper,.main,#main"}
-
To align gutters correctly around the page content, set
mdContentPlacementSelector
to a valid CSS selector that will give the page width. -
To align gutters correctly from the top, set
headerSelector
to a valid CSS selector to read header height, if any. -
You can set gutters to display in a fixed location or scroll with the page. Set
mdPosition
to either fixed or scroll. -
Gutters are responsive and adapt to any screen size and they can also be set to a static width. Setting
mdLeftGutterMinWidth/mdLeftGutterMaxWidth
ormdRightGutterMinWidth/mdRightGutterMaxWidth
to the same value creates gutters with a fixed width. -
You can set a minimum and maximum width for responsive gutters by updating
mdLeftGutterMinWidth/mdRightGutterMinWidth
andmdLeftGutterMaxWidth/mdRightGutterMaxWidth
. -
You can set gutters to fill the entire available space by updating
mdLeftGutterMaxWidth/mdRightGutterMaxWidth
to 0. If there is not enough room to d the gutters in the browser, the gutters will disappear.
The Header panel aligns correctly in the page content by accessing the parent div in which the placement tag is placed. If, for some reason this fails, the fallback value from the mdMinHeaderWidth
custom variable is used. mdHeaderHeightBreakPoints
defines the header collapse height for different viewport areas.
The templates include a function that tracks the current scroll position. When the ad first loads, the current scroll position is received. Upon any scroll, resize, or orientation change, the new scroll position is updated.
You can access the current scroll position, scrollXPercent
and scrollYPercent
in the creative script.js
file from the global object and properties. Values are from 0 to 100 (percentage scrolled).
To include code that adjusts positioning when the scrollPositioning
is updated, add the code in the onPageScroll
function in the script.js
file.
Note
Note: In some instances, there might be network issues that cause the scroll detection code to fail. Make sure that you include a backup functionality for the scroll position.
The Manifest file, config.js
, is a metadata file that defines certain default behaviors for an ad that is created in AAS. The config.js
file is located in the root folder of the Workspace. The file includes the predefined default settings needed for your simple skin. Depending on your requirements, you can modify these settings. For more information about the manifest configuration settings, see Manifest Ad Data.
The AAS HTML API provides a set of methods, such as user interactions, automatic interactions, and timers that you can use in your code. For more information about these methods, see Methods.
You should load only the modules you will use in each HTML. You can delete or add the video variable in your banner or panel assets, EBModulesToLoad= [ 'Video','EBCMD','EBAPI']
, depending if you have a video or not.
It is recommended to load the files from each panel using the parent relative path. The following is an example for loading the files from a panel:
<link rel="stylesheet" href="../../styles/immersiveTakeover_style.css"/> <script>EBModulesToLoad = ['Video','EBCMD','EBAPI'];</script> <script type="text/javascript" src="http://ds.serving-sys.com/BurstingScript/adKit/adkit.js"></script> <script type="text/javascript" src="../../scripts/immersiveTakeover_script.js"></script>
Click here to preview a demo of immersive takeover format.
Comments