Tracking Flash Movie Plays with Google Analytics

If you’re looking for a quick way to track when Flash movies (or anything else in <object> <embed> tags) are played – this works for me:

Quick overview: create a new div with an onClick action and put the Flash movie inside it.

Then in the movie’s <object> tag – add <param name="wmode" value="transparent" /> and in the <embed> tag add this attribute wmode="transparent"

The wmode declarations allow the click in the Flash movie to pass through to the enclosing div and trigger the onClick.

Like this:
<div onClick="_gaq.push(['_trackEvent', 'Videos', 'MovieName', 'PageName']);">
<param name="movie" value="" />
<param name="wmode" value="transparent" />
<embed wmode="transparent" ..." />