PRODUCT
Follow

Overview

Modules are JavaScript (JS) files with functionality that can be loaded into your creative. Sizmek provides several modules; you can select any combination of modules according to the required functionality in your ad.

The EBLoader.js script reads a variable called EBModulesToLoad and loads all of the modules listed in the variable.

The full list of modules supported here is:

For example, if your ad uses video, and needs to run in mobile in-apps, you would include the following in the <head> of your html:

<script> EBModulesToLoad = ['Video', 'EBCMD'];</script>
<script src="http://ds.serving-sys.com/BurstingScript/adKit/adkit.js"></script>

Loading and Initializing HTML5 Modules

EBLoader initializes all of the other modules and loads after all of the other modules have finished loading. When EBLoader prompts that it is initialized, all of the other modules are ready too.

Procedure
  • Add the following code as early as possible to the body element in the ad's HTML file. isInitialized checks whether the EB object is fully initialized and available for API calls.
<script type="text/javascript">
        function checkInit() {
                if (!EB.isInitialized()) {
                   EB.addEventListener(EBG.EventName.EB_INITIALIZED, onInit); 
                   // This code checks whether the EB object is initialized, if the object is initialized, it launches the function "onInit", otherwise "EB_INITIALIZED" event. 
                }
                else {
                       onInit();
                }   
                function onInit() {
                      // Place your code to start the ad flow here
               }
      }
      window.addEventListener('load', checkInit);
</script>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments