Developing an Analytics SWF

Product
Video Cloud
Applies to Roles
Developer
Version
Brightcove 5
Modules
Player API
Edition
All

This document describes how to develop an analytics SWF. An analytics SWF is a non-visual Flash component that you can use to fire and collect events relating to video and player performance. You can use the Publishing module to configure a Video Cloud player to use an analytics SWF. You can also customize a player template so that all players using the template use the analytics SWF. You can develop specialized analytics SWFs to work with any number of web and video analytics solutions.

Video Cloud records extensive data from your players, which you can access in the Video Cloud Studio Reports page. However, you may want to record events that aren't included in the standard Video Cloud reports. For example, you can track interaction with custom player navigation elements, or stats that aren't exposed by the Video Cloud Studio, like playlist loads or video plays per player URL. To read more about the built-in reporting available in the Video Cloud Studio, read about the Analytics module and this overview of report types.

You may have access to all the data you need in the Video Cloud Studio reports but may want to have an aggregated view of your web site and video player statistics. For this reason, you may want to track some, or all, of the same events that are surfaced in the Video Cloud Studio reports but send these events to the web analytics tool you have chosen to track your web site statistics.

To help you meet these goals, Brightcove has developed the Web Analytics SWF feature. This feature allows you to build a custom Flash application that is loaded by the player upon initialization, and that can interact with the player using the Video Cloud APIs. You can use this feature to build a custom Flash application that loads with the player and traps user interaction and player events to send to any web analytics tool.

To develop a Video Cloud Web Analytics SWF, you need to have a working knowledge of ActionScript 3 and Flash 9, as well as some hands-on experience with your Web Analytics tool.

Here's an overview of how a Video Cloud player is integrated with a third party web analytics service:

As a viewer interacts with the Video Cloud player, events are fired. The Web Analytics SWF listens for a specific set of player events types and fires them to the third party web analytics provider, in a format that lets you gather the information you're after from the web analytics reports you get.

To help get you started with the Web Analytics SWF, we have provided documentation that guides you through a simple integration with one common web analytics solution, Google Analytics, using Google's Flash Tracking feature. If you are using another web analytics tool, it may still be useful to read the Google Analytics example. You'll learn how the Web Analytics SWF is designed to trap player events, and then you can adapt that approach to an integration with your specific vendor.

If your business is centered around online video, Visible Measures provides a comprehensive analytics solution specific to video. Visible Measures has built a complete solution for Video Cloud players which you can investigate by contacting them here.

If you use Omniture, check out the open source Omniture analytics SWF on opensource.brightcove.com. You can use this Analytics SWF in your Video Cloud players to report events from within the players to Omniture. Reports can then be rolled up using Omniture's SiteCatalyst.

Using an Analytics SWF

Once you have developed your Web Analytics SWF, to use it, you need to host the SWF and configure your Video Cloud players so that they load the Web Analytics SWF.

You can host the Web Analytics SWF at any URL that is accessible on the web to your players. Make sure you make the appropriate entry in your crossdomain.xml file, so that the players can interact with the SWF. Also, make sure that you select Enable ActionScript/JavaScript APIs for your players in the Edit Settings dialog of the Publishing module.

You can use the Publishing module to configure your Video Cloud players so that they load the Web Analytics SWF:

  1. Select the player you want to configure and click Settings.
  2. Open the Plug-ins tab.
  3. Enter the URL at which your Web Analytics SWF is hosted and click Save Changes.

You can also add your Web Analytics SWF to a custom player template, so that all players created from that template will load the Web Analytics SWF. To do this, include a <Modules> element in your BEML player template, with the file attribute pointing to the URL of your Web Analytics SWF, like this:

<Modules>
  <Module file="http://example.com/tools/myWebAnalytics.swf" />
</Modules>

Note that custom player templates are available only to Video Cloud Pro and Enterprise publishers.

Tags
utility SWF