Google Analytics SWF
About
This project provides a Flash plug-in for measuring analytics within Brightcove video players. It can be used out-of-the-box for simple analytics or as a framework to customize data.
Setup
If you don't want to modify the code, follow these steps:
Grab the latest
GoogleAnalytics.swffile from the Downloads sectionUpload the file to a server that's URL addressable; make note of that URL
Add
?accountNumber=UA-123456789-0to the URL (UA-123456789-0 will be replaced with your Google Analytics Account Number)By default, all of these events will be tracked under the Google Analytics Category of "Brightcove Player". If you'd like to change that, you can specify
playerTypeas another parameter, e.g.?accountNumber=UA-123456789-0&playerType=Open%20Source%20TestingAlso, you can specify the playerType as {playername} to have it dynamically use the name you specified for the player in the Brightcove Studio. e.g.
?accountNumber=UA-123456789-0&playerType={playername}- Note that the
playerTypemust be URL-encoded
- Note that the
Alternatively, these parameters can be added to the publishing code as below (
playerTypeis optional):<param name="accountNumber" value="UA-123456789-0" /><param name="playerType" value="Open%20Source%20Testing" />
Log in to your Brightcove account
Edit your Brightcove player and add the URL under the "plugins" tab
Save your player changes
If you want to make modifications to the SWF / codebase, follow these steps:
Import the project into either FlexBuilder or FlashBuilder
Add the
.swcfiles in thelibfolder under the project's properties settingTo get a SWF of an optimized size, make sure to do a release build
Usage
To understand how Google Analytics treats Categories, Actions and Labels, please refer to the Google Analytics Event Tracking Guide.
Google Analytics doesn't track data in real time, but after approximately one to two hours you should see events appearing in your account. Make sure you're viewing the current day - by default Google Analytics will show a different timeframe that doesn't include the current day. In the left-hand navigation, you'll see a "Content" section, and underneath is "Event Tracking". Click that to see the overview, categories, actions and labels from your player(s).
When the media complete event fires, the plug-in is also sending along the amount of time that a user watched that video. If a user skips around in a video, you can expect to see a time that's less than the video's duration. If a user watches a section more than once it is possible that the time watched for that video will be longer than the video's duration. This shows up in the "Event Value" column for the event, and appears as the length of time in seconds.
The video's "name" is sent through as a customized string. You'll see it
appear as [Video ID] | [Video Name]. Including the video ID will allow
you to programmatically use this data at a later time, as well as provide
you an easy method to look up the video up in your Brightcove account.
Current Supported Events
To view a list of supported events, and to see what can potentially be tracked, you can view Action.as in src > com > brightcoveos > Action.as.
Download
Latest Source
Visit GitHub for the latest source code.
Support
File Issues: GitHub Issue Tracker
Request Support: Support Forums