Transferring Variables in Query string

Transferring variables to the query string is often desired when a user inputs some data interactively in a Flash banner, e.g. his/her e-mail or telephone number, etc. This can be achieved by appending a ";cppar=1&" parameter to a clickTAG. The method of transferring these variables in the querystring is the best described by the example below:

ActionScript 2.0 code:

var EmailFlashVariable = "aa@aa.com";
on (release) {
    getURL(_root.clickTAG+";cppar=1&EmailURLVariable="+ EmailFlashVariable, _root.landingPageTarget);
}

ActionScript 3.0 code:

var EmailFlashVariable = "aa@aa.com";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
    AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
        + ";cppar=1&EmailURLVariable=" + EmailFlashVariable);
}

If the clickTAG is, for example, set to http://www.site.com the user gets redirected to http://www.site.com?EmailURLVariable= aa@aa.com when the Flash banner is clicked.

This method can be used for multiple querystring values:

ActionScript 2.0 code:

var a = 1;
var b = 2;
var c = "Hello";
on (release) {
    getURL(_root.clickTAG+";cppar=1&a="+a+"&b="+b+"&c="+c, _root.landingPageTarget);
}

ActionScript 3.0 code:

var a = 1;
var b = 2;
var c = "Hello";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
    AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
        + ";cppar=1&a=" + a + "&b=" + b + "&c=" + c;);
}

The corresponding target URL then becomes http://www.site.com?a=1&b=2&c=hello.

However the parameter ";cppar=1&" works only when landing page contains symbol "?". In other cases there should be used ";urlappend=" parameter:

ActionScript 2.0 code:

var DestinationVariable = "London";
on (release) {
    getURL(_root.clickTAG+";urlappend=" + DestinationVariable, _root.landingPageTarget);
}

ActionScript 3.0 code:

var DestinationVariable = "London";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
    AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
        + ";urlappend=" + DestinationVariable);
}

NOTE: Variables in query string can be tested on http://test.adform.com/testpage/banners-test/. All query string variables will be passed to the final landing page only when banner is uploaded to campaign in Adform and published.

Avoiding Pop-Up Blockers

Due to constantly increasing online security measures in internet browsers, the pop-up blocking is becoming a common problem in the online advertising. Adform has compiled a list of tips how to create banners that do not trigger the pop-up blockers.

1. Always make sure you attach the Action Script code that opens a new browser window to an instance of a button, not a movie clip.

2. Make sure that the opening of a new browser window is the first action that happens after a user clicks the banner/button (any delay between a click and a call to the function that opens a new window increases the possibility of triggering the pop-up blocker). E.g. the code in green is much less likely to trigger the pop-up blockers than the code in red:

  • When using ActionScript 2:

Correct:

on(release) {
         getURL (_root.clickTAG, _root.landingPageTarget);
         SOME_FUNCTION();
         }

Incorrect:

on (release) {
         SOME_FUNCTION();
         getURL (_root.clickTAG, _root.landingPageTarget);
         }
  • When using ActionScript 3:

Correct:

button.addEventListener(MouseEvent.CLICK, ADFclicked);
         function ADFclicked(event:MouseEvent) {
         AdfURLNavigator.navigateToUrl(AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getParameter("landingPageTarget"));
         SOME_FUNCTION();
         }

Incorrect:

button.addEventListener(MouseEvent.CLICK, ADFclicked);
        function ADFclicked(event:MouseEvent) {
        SOME_FUNCTION();
        AdfURLNavigator.navigateToUrl(AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getParameter("landingPageTarget"));
        }

3. Make sure the clickTAG method is implemented exactly as it is described below.

  • When using ActionScript 2:
on(release) {
      getURL(_root.clickTAG, _root.landingPageTarget);
}

Note: The event, which triggers the opening of a new window, must be “release”, not “press” because opening a new window on “press” event will definitely trigger the pop-up blockers.

  • When using the ActionScript 3:

Create a button symbol on Flash API stage, and give it a name (e.g. button – pic. below).

Download Adform Core Component and paste this code to the same Flash API timeline frame where you created the button (replace the name "button" with how you actually called the button):

button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
AdfURLNavigator.navigateToUrl(
AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getParameter("landingPageTarget"));
}

4. Banners should be compiled with the Flash 8 or a higher version. According to the Adobe bug (http://bugs.adobe.com/jira/browse/FP-1065) there might be pop-up problems when interacting with lower version banners in the Internet Explorer 7.

5. Test the Flash banner in the live web environment for the pop-up blocking. You can use Adform Creative Test Module which can be found here.

clickTAG variables

Methods for implementing the clickTAG variables in Flash banners depend on the ActionScript version used in the banners. The methods do the same job and are only different in the coding. Adform supports both the ActionScript 2 and ActionScript 3 coded banners. If there is more than one target URL, please see the naming convention below:

var clickTAG;  // variable no. 1
var clickTAG2; // variable no. 2
var clickTAG3; // variable no. 3
var clickTAG4; // variable no. 4
var clickTAG5; // variable no. 5

Implementation of clickTAG variable

Implementation of the clickTAG variable depends on the version of the ActionScript you are using. Also, due to constantly increasing online security measures in internet browsers, pop-up blocking is becoming a common problem in the online advertising.

ActionScript 2.0 code:

on (release) {
    getURL(_root.clickTAG, _root.landingPageTarget);
}

ActionScript 3.0 code:

  1. Download and install the Adform Creative Toolkit extension (detailed info can be found here);
  2. When the Adform Creative Toolkit is installed, all the Adform components are placed in your Adobe Flash installation directory. You are able to see them by selecting WindowComponents in the top Flash API menu;


     
  3. Then drag and drop the AdformCore on the stage;
  4. Create a button symbol on Flash API stage, and give it an instance name (e.g. button);
  5. ClickTAG then can be implemented as follows:
button.addEventListener(MouseEvent.CLICK, ADFclicked);

function ADFclicked(event:MouseEvent) {
    AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getParameter("landingPageTarget"));
}

Note: always make sure you attach the ActionScript code that opens a new browser window to an instance of a button, not a movie clip. Also, the event, which triggers the opening of a new window, must be "release", not "press" because opening a new window on "press" event will definitely trigger the pop-up blockers.

Note: AdformCore can also be used in the Flex 2/Flex 3/Flash Builder 4 by adding its swc in to the project library and using the following ActionScript 3 code:

var adformCore:AdformCore = new AdformCore(this.stage);

For testing the clickTAG implementation, please use the Test Section.
 

Implementation of clickTAG in banners for Spotify

ActionScript2:

on (release) {
    getURL(_root.clickTAG, "_blank");
}

 

ActionScript3:

import flash.events.MouseEvent;
import flash.net.URLRequest;

myButton.addEventListener(MouseEvent.CLICK, function(event: MouseEvent) : void {
   flash.net.navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG), "_blank"); 
   }
);

Note: In the code above, myButton should be replaced with the name of your click-through button instance

Flash Banners Restrictions

Due to possible security issues Adform does not accept:

  • obfuscated Flash banners;
  • banners with some restricted AS functions;
  • banners which are Flash cookie dependant.

Please use the Test Section to check if banners meet the requirements. Alternatively, you can contact Adform Traffic department for testing and suggestions on compatibility.

Also, Adform warns that when using the dynamic publishing method in the Internet Explorer or Firefox on Mac stage.stageWidth and stage.stageHeight might initially return 0 (note that for the Internet Explorer the stage size will be available on first load, however when reloading or revisiting a page it will initially be 0). The solution is defining a resize handler in your ActionScript code:

stage.addEventListener(Event.RESIZE, resizeHandler);
stage.dispatchEvent(new Event(Event.RESIZE)); // force stage resize event for normal cases 

function resizeHandler(event:Event):void {
  if (stage.stageHeight > 0 && stage.stageWidth > 0) {
    stage.removeEventListener(Event.RESIZE, resizeHandler); // only execute once
    // your initialization code here
  }
}

CPU Recommendations

Complexive flash banners may be the reason of a high CPU usage. Some publishers are paying attention not only to the file size but also to the CPU usage. We recommend checking some common High CPU usage factors:

  1. Frame Rate is over 18 frames per second; reducing the number to 18 in most cases does not degrade the visual performance;
  2. Multiple animated sequences across many layers animating at the same time;
  3. Animated sequences set to be translucent and animating on top of an imported graphic (ex: jpeg, png, etc.);
  4. Action Script-generated events set to randomly generate (ex: fog and rain);
  5. Imported graphics scaled up over a long period of time;
  6. Masking and animated masking techniques can also require a large amount of CPU resources.

General

In order for ad-serving systems to track clicks when displaying Flash banners, the Flash banners must be programmed to use clickTAG variables instead of pre-defined URLs. The clickTAG variables are passed to the Flash file by an HTML page that shows the Flash banner. Thereby, the ad-serving systems can track the number of clicks and change the URL real-time, without having to modify the Flash banner.

  • Flash banners must be compiled with the Flash 8 or higher versions.
  • Fallback *.gif banners must always be supplied for all formats.
  • Flash Clicks/Links use clickTAG’s.
  • Clicks/Links must avoid being blocked by pop-up blocks.
  • CPU usage must be limited.

Please also follow the Media (Publisher) restrictions for Loops, FPS, etc.

Info: In Safari 6.1 and above versions, a backup (image or HTML) is shown if a flash banner has a backup set. Alternatively, if there is no backup, the flash version is being displayed. Note that this modification does not apply for floating banners as they do not have the backup.