How does Google Swiffy implement clickTag for HTML5 banner ads?

729 Views Asked by At

First, I tried finding an option to prevent Swiffy from compressing/minifying all the data when doing an export to HTML5 from Adobe Flash Pro. But no dice.

Even if I was able to read the unminified Javascript that Swiffy exported, I don't think there would be a simple function call for the "clickTag".
It's likely defining the variable clickTag in the huge haystack of {index: #, type: #}, and then doing processing each operations to eventually call the window.open() method (or something similar).

This is how it currently outputs (minified) enter image description here

Does anyone have any clue how Swiffy implements clickTag?
Or what would be the Javascript equivalent that does the same job?

3

There are 3 best solutions below

0
Snick On

Swiffy uses the core API of the environment where the ad is served. If it's a DoubleClick Rich Media ad, it does use Enabler.exit("url").

If you want to have a better control on your output file, I'd suggest having a look at Google Web Designer. The closest experience to flash development in the HTML5 - JS era.

0
Confidant On

Google instructions are here, for plain HTML5 (non-swiffy) click tags.

3
Steve-spark On

At the bottom of the file is a snippet of code like this:

 <script>

  var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
      swiffyobject, {});

  stage.start();

Add this right before stage.start(); to mimic previous flash behavior. Ensure you use the proper capitalization.

  stage.setFlashVars("clickTAG=http://stackoverflow.com");

**Note: Ensure to use url encoding if there are parameters...doesn't seem to like it otherwise