ClickTagger
*Changelog and download link are at the bottom of this page*ClickTagger is an ActionScript 3 class that I've written for my upcoming book and it was primarily built to solve for the case sensitivity issue that Flash developers may run into when using the clickTag variable in their banners. Without a current standard in place for ad serving companies, some use clickTag while others use clickTAG and still others use ClickTag or even clicktag. In ActionScript 2 this wasn't/isn't an issue, but as soon as a Flash developer or agency starts creating banners with AS3 they may very quickly encounter the problem by having their ads kicked back for not working correctly.
While writing ClickTagger, I decided to add a bit of functionality to it to allow the developer to not only assign the clickTags to the proper interactive elements, but to assign a fallback url as well. The fallback url works for local testing from the Flash IDE (where clickTags aren't passed in) and is also used in the unfortunate event that there's a problem loading the clickTags at run time. If the clickTags fail to load, at least the user will still be taken to the url you provide.
One more small piece to ClickTagger is the targetWindow property which can be used to set the window in which the destination url will launch. The targetWindow property is defaulted to "_blank".
To instantiate ClickTagger, there is a single required parameter of type LoaderInfo.
-
var clickTagger:ClickTagger = new ClickTagger(stage.loaderInfo);
To assign a clickTag to an interactive element, call the assignClickTag method and pass it three parameters: The clickable element (required), the fallback url (required) and the clickTag number (optional).
-
clickTagger.assignClickTag(button1,fallback1,1);
Here's an example that assumes you have three buttons named button1, button2, and button3.
-
import com.jasonfincanon.utils.ClickTagger;
-
-
var fallback1:String = "http://www.jasonfincanon.com";
-
var fallback2:String = "http://www.flashinyourface.com";
-
var fallback3:String = "http://www.adobe.com";
-
-
var clickTagger:ClickTagger = new ClickTagger(stage.loaderInfo);
-
clickTagger.assignClickTag(button1,fallback1,1);
-
clickTagger.assignClickTag(button2,fallback2,2);
-
clickTagger.assignClickTag(button3,fallback3,3);
I hope this helps you in your Flash advertising development and please don't hesitate to let me know if you come across any bugs.
*Changelog*
- 02-14-2010
- Added a security check for "http://" or "https://" in the clicktag if the swf is being viewed in a browser. If the security test fails, the fallback url is used. - 04-13-2010
- Changed _clickObjects type toArrayinstead ofVectordue toVectornot being available in Flash Player versions less than 10.
*Download a ClickTagger Example here*





February 4th, 2010 - 18:19
Very nice class, now if only 3rd party tracking will allow player 9.
February 4th, 2010 - 20:41
Thanks Bodie! It’s too bad that they lag behind like they do, but I think there are a few here and there that can be convinced if asked. Hopefully the number of them will start to increase soon.
February 8th, 2010 - 03:52
Thanks for this! It s about time we start using the privileges of AS3 in the banner campaign field.
June 16th, 2010 - 16:54
Just a little thanks, really useful
June 16th, 2010 - 19:59
Dimitree and WCrook,
You’re very welcome and thank YOU for visiting and using ClickTagger!
August 15th, 2010 - 17:02
Thanks for the useful ClickTag example for Actionscript 3! I look forward to reviewing the book.
By any chance, do you have an Actionscript 2 example that would work with Google and DoubleClick? I did not see one in your earlier book. I think the contrast would be especially nice to highlight the new features.
August 16th, 2010 - 09:27
Hi Kurt.
You’re welcome for the AS3 ClickTag example and thank you for checking it out.
You are correct that I didn’t include anything like ClickTagger in the first book and since the second book is AS3, I haven’t built it in AS2 yet.
September 30th, 2010 - 15:38
Great script. Anyone know if this works in Euro, Latin, and Asian markets?
September 30th, 2010 - 15:43
Hey Ryan. Thanks.
Great question! I’d also be interested in hearing the answer if anyone finds it.
March 10th, 2011 - 13:05
when i put the script on the timeline (frame 1) it worked like a charm, but when I tried using the document class it didn’t go to the url. did I do something wrong?
March 10th, 2011 - 13:34
Hi Lucas. Thanks for checking out ClickTagger!
I put together a quick example of using it in a document class and added a link to it above. Look for the new link just below “Download ClickTagger Here”
Hope that helps!
March 21st, 2011 - 09:45
Awesome!!! Well thought out clickTag code. I like it…although I work for a rather large advertising agency whom like to see testing results before pushing any creatives into traffic.
The QA/QC department use this checker: http://www.adopstools.com/?section=links&page=tools
A this time it appears as if it doesn’t check for clickTags in AS3 units.
Is there another checker that you might know of, or would recommend, which will be able to handle the clicktag checking interactivity?
Currently this agency doesn’t do anything outside of the realm of AS2. I do not what to disclose the agency name…but the development of programming standards with AS2 or AS3 is far behind what I would consider NORMAL for this size of agency. Coding juse seems to be a hodge-podge, based entirely on the different individuals whom currently work there and each of THEIR best practices based upon THEIR experience level.
Trials and tribulations with working with a large agency i guess. I think that one of the reasons that this agency HAD NOT made the AS2/AS3 switch is that there seems to be a large GRAY cloud over the area of programming for clickTags and not wanting to take the chance on having a full set of banners come back, because something was wrong with that programming.
I am implementing your class file into a set of banners….I am keeping my fingers crossed that there isn’t any issues. As far as i know…these creatives mainly targeting US territories (mainly English speaking demographic).