Return to Snippet

Revision: 68601
at January 24, 2015 01:25 by RodolfoMiranda


Updated Code
/*Paste this part of the code inside the <head> tag of your html:
<script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>
*/

// Google Enabler initializer. 

function bgExitHandler(e) {
    Enabler.exit('Background Exit');
    console.log('Exit');
}

function pageLoadedHandler() {
    if (Enabler.isVisible()) {
        adVisibilityHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.VISIBLE,
            adVisibilityHandler);
    }
}

function adVisibilityHandler() {
    // Here you invoke function to start your banner.
    
}

function enablerInitHandler() {
    if (Enabler.isPageLoaded()) {
        pageLoadedHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, pageLoadedHandler);
    }
}

function init() {
    if (Enabler.isInitialized()) {
        enablerInitHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler);
    }
}


window.onload = init;

Revision: 68600
at January 24, 2015 01:17 by RodolfoMiranda


Initial Code
// Google Enabler initializer. 

function bgExitHandler(e) {
    Enabler.exit('Background Exit');
    console.log('Exit');
}

function pageLoadedHandler() {
    if (Enabler.isVisible()) {
        adVisibilityHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.VISIBLE,
            adVisibilityHandler);
    }
}

function adVisibilityHandler() {
    // Here you invoke function to start your banner.
    
}

function enablerInitHandler() {
    if (Enabler.isPageLoaded()) {
        pageLoadedHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, pageLoadedHandler);
    }
}

function init() {
    if (Enabler.isInitialized()) {
        enablerInitHandler();
    } else {
        Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler);
    }
}


window.onload = init;

Initial URL

                                

Initial Description
JavaScript Google Enabler. This code should be placed in all html creatives for Google DoubleClick Studio.

Initial Title
Google Enabler JS

Initial Tags
google

Initial Language
JavaScript