clickio icon

Dni-peru

clickio | PRO | 05/09/24 10:17:46 AM UTC | 0 ⭐ | 582 👁️ | Never ⏰ | []
text |

4.35 KB

|

None

|

0 👍

/

0 👎

1. Please paste this code after <main class="content-single"> tag as first child:
 <div id="DIV_0"></div>
<div id="DIV_1" class="overlay-panel">
    <div class="inner">
        <div class="msg-container">
            <img class="msglogo" src="https://medianet.adlabsnetworks.com/public/demo/dni-peru.com/dni-logo.png"
                width="440" height="66">
            <p class="msg">
                Para ver los resultados<br>Ver un anuncio corto.
            </p>
            <button id="BUTTON_11" class="button cmdL0">CONTINUAR</button>
        </div>
    </div>
</div>
<style>
    #DIV_0 {
        position: absolute;
        height: 100%;
        width: 100%;
        opacity: .9;
        background-color: #fff;
        z-index: 2147483648;
        display: none
    }
      #DIV_1 .inner {
        position: relative
    }
     .inner {
        top: 150px !important
    }
     #DIV_1 .msg-container {
        display: flex;
        justify-content: space-around;
        flex-direction: column
    }
     #DIV_1 .msg {
        text-align: center;
        font-weight: 700;
        line-height: 1.2em;
        color: #069;
        margin-top: 40px
    }
     #BUTTON_11 {
        margin: 0 auto;
        margin-top: 2rem;
        padding: 1rem !important
    }
     .overlay-panel {
        position: fixed;
        display: none;
        background: #fff;
        border: 2px solid #2563eb;
        padding: 6em;
        border-color: hsl(200 31% 28%);
        box-shadow: 0 0 1px 1px #0897de, 0 0 1px 3px rgb(0 0 0 / 15%);
        border-radius: 5px
    }
     #DIV_1 {
        z-index: 2147483649;
        box-sizing: border-box;
        display: none
    }
     #DIV_1,
    #DIV_1 .inner {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%)
    }
</style>
 2. Please paste this code after <head> opening tag:
 <script type= text/javascript>
var aRewardedTry=0;
   window.googletag = window.googletag || {cmd: []};
    var googletag = window.googletag || {cmd: []};
    var aRewardedCall = function(){
    var searchbutton = Array.from(document.querySelectorAll('button[type="submit"]'))
  .find(el => el.textContent === 'Consultar');
    var watchbutton = document.getElementById('BUTTON_11');
    if(typeof(searchbutton !="undefined")){
     searchbutton.classList.add("cl_rewarded");
    function insertAfter(el, referenceNode) {
    referenceNode.parentNode.insertBefore(el, referenceNode.nextSibling);
}
var searchform = document.querySelector('form[method="post"]');
          googletag.cmd.push(function(){
                var aRewarded = 0;
                var rewardedSlot = googletag.defineOutOfPageSlot('/45470634,23118893940/clickio_area_715597_970x250',googletag.enums.OutOfPageFormat.REWARDED).addService(googletag.pubads());
                googletag.enableServices();
                googletag.pubads().addEventListener('rewardedSlotReady', function(evt) {
                    document.querySelector('.cl_rewarded').addEventListener('click', function(event) {
                    insertAfter(searchbutton,  searchform);
                    document.getElementById('DIV_0').style.display='block';
                     document.getElementById('DIV_1').style.display='block';
                           watchbutton.onclick = function(){
                            googletag.cmd.push(function() {
                            evt.makeRewardedVisible();
                                });
                            }
                   }, {once: true});
                 });
                googletag.pubads().addEventListener('rewardedSlotClosed', function(evt) {
                     searchform.append(searchbutton);
                    searchbutton.classList.remove("cl_rewarded");
                    searchbutton.click();
                    document.getElementById('DIV_0').style.display='none';
                    document.getElementById('DIV_1').style.display='none';
                });
                //googletag.pubads().refresh([rewardedSlot]);
                googletag.display(rewardedSlot);
            });
    }
    else {
            if(aRewardedTry<=4){ setTimeout(function(){  aRewardedCall(); },500); aRewardedTry++; }
        }
    }
    aRewardedCall();
</script>

Comments