Help Center Manage Your Account Banner, Richmedia, and Text Ads
How do I track click for Flash/SWF ads?
Flash ads (SWF files) should not use a static link for the click button, it should use clickTAG parameter, which is the industry-standard for click tracking. clickTAG is used across all ad servers to track clicks of Flash/SWF ads. Our ad server will ask for the actual click URL when you create the SWF ad in your account.Conversion
The original ActionScript 2 code for the button instance may look something like this:on (release) { getURL("https://www.example.com/","_top"); }
After the conversion for click tracking, it should look like this:
on (release) { if (_root.clickTAG.substr(0,4) == "http") { getURL(_root.clickTAG,_root.TargetAS); } }
For ActionScript 3, MyClickButton is the name of the button instance and the code should look like this:
MyClickButton.addEventListener( MouseEvent.CLICK, function():void { if (root.loaderInfo.parameters.clickTAG.substr(0,4) == "http") { navigateToURL( new URLRequest(root.loaderInfo.parameters.clickTAG), root.loaderInfo.parameters.TargetAS ); } } );If you would like to know more technical details, please review the official instructions from Adobe Flash. For greater compatibility, our system uses "
_root.clickTAG
" instead of "clickTAG
". Because Flash ads can be served within IFRAMEs, it's best to use target _top
or _blank
for getURL() function. For security, your code must check for a valid URL instead of allowing a possible malicious JavaScript code.
Sample Code
You can view this tutorial to create a SWF ad with clickTAG tracking from scratch. Or you can download these sample Macromedia .FLA files to compare:- Original files with a fixed URL and without click tracking:
sample.fla (SWF: sample.swf)
- After conversion, the files use clickTAG parameter for dynamic click tracking:
sample-clickTAG.fla (SWF: sample-clickTAG.swf)
- Also, please use this template to manually convert to clickTAG if our system failed to convert your SWF file automatically.
Troubleshoot and Test a SWF file for clickTAG
It is recommended to test all Flash ads for click tracking via clickTAG before allowing it to display online. Learn MoreOther Articles in Banner, Richmedia, and Text Ads
Information about different ad formats, dimension, sizes, and specifications.
- Ad Dimension
- Ad Specifications
- Ad Types
- Ad Weight
- Alternative Image/Media URL
- Click to a new or same window
- Click Tracking URL
- Destination URL or Click URL
- How can I convert a Flash ad into HTML5 for iPhone/iPad?
- How can I create a Google AdSense ad?
- How do I change the window title of my pop-up/pop-under ads?
- How do I mix image and text in an ad?
- How do I track clicks for HTML or Rich-Media ads?
- How do I track Flash/SWF ad with multiple clickTAGs?
- Image URL
- Rich-Media Ads
- Text alternative for banner ad images
- Third-Party Pixel URL
- Tutorial - Create a simple SWF with clickTAG tracking
Cannot find an answer for your question? Ask our Customer Care team
Related
- How do I track Flash/SWF ad with multiple clickTAGs?
"If your Flash ad has multiple buttons, each with its own landing URL, you will need to use multiple clickTAGs ..."
- Tutorial - Create a simple SWF with clickTAG tracking
"Clicks on a Flash ad (SWF file) can't be tracked if the click button is assigned a static link. AdSpeed ..."
- How do I troubleshoot clickTAG issues for a Flash ad?
"Once a Flash ad is setup in our ad server, you can click on it as a test. The click ..."
- HTML5 Ad from a ZIP file
"If your client sends a ZIP file that contains all the creative assets (image, JavaScript, HTML, etc.), you can create ..."
in Ad Gallery - HTML5 Adobe Animate Ad
"HTML5 ads are replacing Flash/SWF ads. Tools used to create HTML5 animate ad include: Adobe Edge Animate, Adobe Animate CC ..."
in Ad Gallery