Tip for using SWFAddress and GoogleAnalytics together
March 4, 2007
Just a quick tip to save you a few minutes if you plan to use SWFAddress (as far as I know currently the best browser-back-button solution for flash) and GoogleAnalytics (for tracking) in a flash project:
- Don’t use getURL() elsewhere in your as-code! SWFAddress uses ExternalInterface internally and there are serious bugs if you try to use getURL() (for calling the GoogleAnalytics urchinTracker(), for example) and ExternalInterface in Internet Explorer. Simply use ExternalInterface instead of getURL() and everything works fine.
I don’t know if this is a general problem with getURL() and ExternalInterface or if it just happens in that particular combination.
- SWFAddress calls the urchinTracker() internally. This can be a good thing if your site needs simple tracking (changes of the url) but with more detailed tracking chances are you don’t want SWFAddress to call the urchinTracker() but call it manually in your application where appropriate. It wasn’t obvious at first that SWFAddress does that…so you can comment out the lines with “track.call(this)” in swfaddress.js (in the uncompressed js-version 1.1 this is in line 202 and 303).
That’s it :)
Filed under: Flex/AS3