Flash Setup + Tracking

clickTAG: Single SWF Tracking


1. ActionScript 2.0 setup
  1. The clickTAG Tracking Code
  2. Where to add the code
  3. Multiple exit links
  4. Common mistakes
2. ActionScript 3.0 setup
3. More Information
4. Help


1. ActionScript 2.0 setup


a. The clickTAG Tracking Code

In single-SWF Flash creative, advertisers should use the clickTAG method of tracking exit links. For multiple-SWF creative or more advanced options, refer to the CBS Tracking Component instructions. CBS Interactive will provide the advertiser with reports on both clicks and impression data. To implement the clickTAG method, attach the following code to a button you wish to track.

on (release) {
   if (_root.clickTAG.substr(0,5)=="http:"){
      getURL (_root.clickTAG, "_blank");
   }
}

Note: Advertiser must use target="_blank" for the window option.
Note: The exit link for the button should be provided to CBS Interactive separately and not hard coded into the SWF. You may provide a direct link to your website or a third-party tracking url. The URL can be no more than 128 characters long.

b. Where to add the code

The clickTAG code should be added to a button's on (release) actions. Be careful not to add this code directly to your timeline. First select the button you wish to track, open the "Actions" panel (press F9) and add the code. See below for an example:

c. Multiple exit links

If there is more than one link to be tracked, we recommend numbering each clickTAG variable. First button's action would use clickTAG1, the second would use clickTAG2, and so on through clickTAG10. CBS Interactive will only track up to 10 links individually.

Button 1:
on (release) {
   if (_root.clickTAG1.substr(0,5)=="http:"){
      getURL (_root.clickTAG1, "_blank");
   }
}
Button 2:
on (release) {
   if (_root.clickTAG2.substr(0,5)=="http:"){
      getURL (_root.clickTAG2, "_blank");
   }
}

d. Common mistakes

Do not use on (press) instead of on (release) as the press event triggers pop-up blockers. This code is incorrect:

on (press) {
   if (_root.clickTAG.substr(0,5)=="http:"){
      getURL (_root.clickTAG, "_blank");
   }
}

The clickTAG variable is case-sensitive. Do not use alternate variations such as clicktag, ClickTag, ClickTAG, CLICKTAG, etc.

on (release) {
   if (_root.CLICKTAG.substr(0,5)=="http:"){
      getURL (_root.ClickTAG, "_blank");
   }
}

2. ActionScript 3.0 setup


NOTE: In AS3, actions can no longer be attached to buttons, but must be placedĀ in a frame of the timeline.


This AS3 clickTag code should be placed in the first frame of the Flash file:

Actions Window

var _clkTag:String;
var _zzClicktagString:String;
var _zzParamString:String;
var zzparamvalue:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (_zzClicktagString in zzparamvalue) {
_zzParamString = String(zzparamvalue[_zzClicktagString]);

if(_zzClicktagString=="clickTAG"){
_clkTag = _zzParamString;
}
}
function clkThrough(event:MouseEvent):void {
navigateToURL(new URLRequest(_clkTag));
}
clkbtn.addEventListener(MouseEvent.CLICK, clkThrough);


3. More Information

For more information on clickTAG implementation please visit Macromedia's support center at http://www.adobe.com/resources/richmedia/tracking/designers_guide/index.html#clicktag

4. Help

Questions regarding your ad campaign: Please contact your sales representative.

Questions regarding CBS Interactive specifications or advertising policy: Please contact AdSpecQuestions@cbs.com.

Technical questions regarding Flash Tracking: Please contact FlashTrackingHelp@cbs.com.