yannux Posted February 4, 2016 Report Share Posted February 4, 2016 (edited) Hi,Here is some javascript to easy have click count with swiffy ads inside an iframe.In Revive adserver : create HTML Generic Banner, replace [URL_OF_YOUR_HTML_SWIFFY_FILE] with the url of your swiffy html file.We give clickurl with magicmacro <iframe src="[URL_OF_YOUR_HTML_SWIFFY_FILE]?clickurl={clickurl}" width="100%" height="90px" frambedorder="0"></iframe> Edit your swiffy html file, go down and replace last <script> block <script> var stage = new swiffy.Stage(document.getElementById('swiffycontainer'), swiffyobject, {}); stage.start(); </script>With<script> // !!!!!!! Ads destination link !!!!!! var lienClient = ''; var clickurl = /clickurl=([^&]+)/.exec(document.location.href)[1]; var swiffycontainer = document.getElementById('swiffycontainer'); if (clickurl) { var parent = swiffycontainer.parentNode; var wrapper = document.createElement('a'); wrapper.setAttribute("href", clickurl + lienClient); wrapper.setAttribute("target", "_blank"); // set the wrapper as child (instead of the element) parent.replaceChild(wrapper, swiffycontainer); // set element as child of wrapper wrapper.appendChild(swiffycontainer); } var stage = new swiffy.Stage(swiffycontainer, swiffyobject, {}); stage.start(); </script> Thanks to http://forum.revive-adserver.com/topic/3194-generic-html5-banner-clicks-tracking/ and http://stackoverflow.com/questions/6938248/insert-a-div-element-as-parent Edited February 4, 2016 by yannux Code cleaning Quote Link to comment Share on other sites More sharing options...
Ian Posted February 5, 2016 Report Share Posted February 5, 2016 Thanks for sharing :) Quote Link to comment Share on other sites More sharing options...
pankaj Posted March 16, 2016 Report Share Posted March 16, 2016 (edited) clicks count not working with iframe like <iframe src="[URL_OF_YOUR_HTML_SWIFFY_FILE]?clickurl={clickurl}" width="100%" height="90px" frambedorder="0"></iframe> Edited March 16, 2016 by pankaj Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.