So I made a banner in edge to be trafficked through doubleclick and I need to add a click through (they call it an "exit") to track the banner and have it go to a destination URL. I found information on this but am not exactly sure what to do. Here is what they say.
- Create a button element in your creative using a <div> tag. Create the element in the HTML file and style it in the CSS file. Then assign the ID
bg-exitto your element.Sample <div> tag object in the HTML file:
Sample styling and ID selector in the CSS file:<div id="bg-exit"></div>#bg-exit {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
cursor: pointer;
opacity: 0;
}
This part I get and put it in my index file.
the second part says I need to put code in my java script file and I tried putting it in the "edge.js" file and I get a java script error when trying to open it in edge. Here is the code.
Add exit functionality to the JavaScript by calling this method: Enabler.exit('exit name goes here');
function bgExitHandler(e) {
Enabler.exit('Background Exit');
}
document.getElementById('bg-exit').addEventListener('click', bgExitHandler, false);