DoubleClick Studio ClickTag after using Swiffy

后端 未结 4 711
情歌与酒
情歌与酒 2020-12-10 07:53

I\'ve converted a AS2 flash file into HTML5 using Swiffy. I\'m also using DoubleClick Studio for the Ad. I was wondering how i get a clicktag on the ad so it shows up in Dou

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 08:11

    The solution is very simple. Take a look on my example. Destination url can be updated in DB Studio.

    HTML:

    
    
    
        
        HTML5 Banner
        
        
        
        
        
        
        
    
    
        

    script.js:

    var stage;
    if (!Enabler.isInitialized()) {
        Enabler.addEventListener(
            studio.events.StudioEvent.INIT,
            enablerInitialized
        );
    } else {
        enablerInitialized();
    }
    function enablerInitialized() {
        if (!Enabler.isVisible()) {
            Enabler.addEventListener(
                studio.events.StudioEvent.VISIBLE,
                adVisible
            );
        } else {
            adVisible();
        }
    
    }
    function adVisible() {
        document.getElementById('bg-exit').addEventListener('click', exitHandler, false);
        stage = new swiffy.Stage(document.getElementById('swiffycontainer'), swiffyobject, {});
        stage.start();
    }
    function exitHandler(e) {
        Enabler.exit('Exit');
        window.open(window.clickTag);
    }
    

    object.js:

    var swiffyobject = {YOUR_SWIFFTY_OBJECT_HERE};
    

    styles.css:

    * {
        border:0;
        padding:0;
        margin:0;
    }
    
    body, html {
        width:100%;
        height:100%;
        overflow:hidden;
        background:#fff;
    
        width:100%;
        height:100%;
    
        position:relative;
    }
    
    #bg-exit {
        position:absolute;
        z-index:999999;
        left:0;
        top:0;
        width:100%;
        height:100%;
        overflow:hidden;
        cursor: pointer;
    }
    
    #swiffycontainer {
        position:absolute;
        z-index:100;
        width:100%;
        height:100%;
        overflow:hidden;
    }
    

提交回复
热议问题