Skip to main content
Participating Frequently
January 19, 2017
Question

multiple panel html5 Ad Banners with unique exit urls (+ clickTags)

  • January 19, 2017
  • 3 replies
  • 3101 views

Hi, I want to create Ad Banners on the html canvas that contain multiple panels. Each of these panels needs a unique exit url, with clickTAGS for each too. The Ads are served through Google's Double Click for Publishers. I can't seem to find a definitive tutorial for this process, any ideas?

PS I was able to do this previously using SWFs...

This topic has been closed for replies.

3 replies

Inspiring
January 24, 2017

this.button_1.on("click", function () {

  window.open('http://www.example1.com', '_blank')

});

this.button_2.on("click", function () {

  window.open('http://www.example2.com', '_blank')

});

this.button_3.on("click", function () {

  window.open('http://www.example3.com', '_blank')

});

Participating Frequently
March 20, 2017

Hi and , many thanks for your responses, very much appreciated, a great help. Have now got his nailed down, so for anybody else having similar issues, this is how I solved the problem. I had a 3 panel Ad, each panel going to a separate exit url:—

Animate canvas:

this.btn_1.on("click", function () {

  window.open(window.clickTag, '_http://www.example1.com')

});

this.btn_2.on("click", function () {

  window.open(window.clickTag2, '_http://www.example2.com')

});

this.btn_3.on("click", function () {

  window.open(window.clickTag3, '_http://www.example3.com')

});

N.B. I had to place the url instead of '_blank' to prevent multiple tabs opening in the browser when the Ad was clicked on...

HTML file:

<script>var clickTag = "http://www.example1.com/ " </script>

<script>var clickTag2 = "http://www.example2.com/ " </script>

<script>var clickTag3 = "http://www.example3.com/ " </script>

This passed the HTML Validator, and loaded to DFP with no problem. Ad is working as required, and all clicks are being tracked, so happy days...

Hope this helps...

rezun8
Inspiring
January 23, 2017

HI Toffeeman

Yes build it the same way as an AS 3.0 file only you'll be using the html5 canvas instead. You actually dont even need the AS code for the clickTag anymore as it is all done in the html.

rezun8
Inspiring
January 19, 2017

for each panel you can assign multiple exit URL's just as you could before with SWF's. It will be done in the same manner within DCM as you set up your campaign.

Participating Frequently
January 19, 2017

Hi rezun8, many thanks for the response, much appreciated. So, I can make up the Banners as before, just that I start with the html canvas? Not sure of the code snippet I would need to replace the ActionScript I currently use though? (see below)...

evolve_btn.addEventListener(

  MouseEvent.CLICK,

  function():void {

    if (root.loaderInfo.parameters.clickTAG.substr(0,5) == "http:" || root.loaderInfo.parameters.clickTAG.substr(0,6) == "https:") {

      navigateToURL(

        new URLRequest(root.loaderInfo.parameters.clickTAG), "_blank"

      );

    }

  }

);