OK, so I'm a little late to the party with this one (about two years too late), but whatever: the Google analytics API for Flash is completely awesome.
It comes in component form for both Flash and Flex, or a straight-up bunch of classes wrapped in a .swc file for those of us who'd rather get stuck into coding (and have a seething hatred of unnecessary components!). The built-in debug panel is a lifesaver too, when enabled it blocks all traffic to the analytics servers so any testing won't affect the stats. Mega useful.
At the moment it's only for online stuff (which is perfectly reasonable) but there's talk of it being adapted for none-browser use too, which will be handy for tracking AIR applications and offline project distributions.
Google certainly covered all the bases anyway. Get it here, and read about it here. I'd post a code sample, but it's so easy to use I think the documentation will suffice in this case.
Thanks again, Google nerds! Where would we be without you?