- 24 Sep 2009
With the ESA HD Media Player you can track how often your media and preroll files are loaded, ended, and clicked in your Google Analytics account (tracked as events). The Google Analytics Library is already built-in to the MediaPlayer component (v.2 or later), and you don’t have to add any scripts to your webpage.
Configure Google Analytics Tracking:
> Set up your Google Analytics account: http://www.google.com/analytics/
> Enter your Google Analytics account number in the Skin Wizard or in the MediaPlayer’s Component Inspector.
> Choose your Tracking option in the Skin Wizard or in the MediaPlayer’s Component Inspector. Choose “file” if you want to track the name of the file (used when loading single media files). If you are using the XML playlist you can choose to track the “id” or “name” attributes that you have defined for each media file and preroll.
> If you have Flash CS4/CS5 you can enable the debug mode to check for errors.
The player uses the “trackEvent” method of the Analytics component to automatically track when media and preroll files are loaded, ended, and clicked. These ”Events” will be tracked in your Google Analytics account with the following parameters.
> Category: Media or Roll (automatically detected)
> Action: Loaded, Ended, or Clicked (automatically detected)
> Label: File, ID, or Name (you choose which is tracked)
> Value: 1 (always assigned a value of 1)
Below is a typical set of object and embed tags used to embed one of our players into a webpage. To enable the Google Analytics tracking, you must use the “id” and “name” attributes (red text), and you must set the “allowscriptaccess” to “always”. If you are not familiar with our recommended embed script, please see the “Simple Embed” and “FlashVars Media Loading” tutorials for more details.
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0″ width=”640″ height=”390″ id=”ESAHDMP” >
<param name=”movie” value=”default.swf” />
<param name=”allowfullscreen” value=”true”/>
<param name=”allowscriptaccess” value=”always”/>
<param name=”FlashVars” value=”media=media.xml” />
<param name=”wmode” value=”transparent” />
<embed src=”default.swf” width=”640″ height=”390″ FlashVars=”media=media.xml” allowfullscreen=”true” allowscriptaccess=”always” wmode=”transparent” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” name=”ESAHDMP”/>