To use variables to pass a click tracking string into Flash movies, use the clickTAG method as described in Adobe's Designer's Guide article, Tracking Macromedia Flash Movies. Only one set of files is needed to specify the click tracking strings. If the files adhere to the method shown in the Adobe article, the same set of files can be used for multiple campaigns, different sites, and different ad serving networks.
SWF movie requirements for Flash developers
For the most part, the movie is made just like any other Flash movie. Any swf file specifications provided by the site still apply. Any animation or ActionScript that you would normally use can be used with this method. The main difference is in the settings for click-through (getURL) actions.
DFP SWF file requirements
- Flash: Version 6 or higher.
- File names: All lower case characters without ampersands (&), asterisks (*), slashes (/), spaces, or question marks (?).
- Maximum file size: The maximum possible creative size is controlled at the network level. Contact your support representative for more information about changing your maximum file size. Keep in mind that individual sites may restrict the file size that they'll accept.
- getURL actions: In general:
- The URL should be
_level0.clickTAG. The ad server will only recognize the standard casing of "clickTAG" for the variable name (not "ClickTag" or "clicktag", for example).
- Set the URL for an expression.
- Set the target window to either
_blank(to open a
new window) or - Set
VariablestoDon't send
_top(to open in the same window).
If you set the target window to_top, you must change the allowsciptaccess variable in the creative code to 'always', otherwise your creative won't be clickable.
For more information, see Flash banner does not track clicks.
- The URL should be
See Add creatives to line items for more information.
Example: Adding a clickTAG to ActionScript 2.0Create a button on your Flash movie and use getURL() to specify the clickTAG:
getURL (_level0.clickTAG, "_blank");
}
See Adobe's Designer's Guide article, Tracking Macromedia Flash Movies, for more information.
If you use the example below, change 'Link_1' to the instance name of your clickTAG button.
Link_1.addEventListener(MouseEvent.MOUSE_UP, function(event: MouseEvent): void {
var sURL: String;
if ((sURL = root.loaderInfo.parameters.clickTAG)) {
navigateToURL(new URLRequest(sURL), "_blank");
}
}
)
