/ Published in: JavaScript
JavaScript Google Enabler. This code should be placed in all html creatives for Google DoubleClick Studio.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/*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;