Developing an Analytics SWF

Applies to Roles
Developer
Version
Brightcove 4
Modules
Player API
Edition
Express, Pro, Enterprise

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 Brightcove 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.

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

You may have access to all the data you need in the Brightcove 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 Brightcove 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 Brightcove 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 Brightcove 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 Brightcove player is integrated with a third party web analytics service:

As a viewer interacts with the Brightcove 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 Brightcove players which you can investigate by contacting them here.

Using an Analytics SWF

Once you have developed your Web Analytics SWF, to use it, you need to host the SWF and configure your Brightcove 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 Brightcove 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 Brightcove Pro and Enterprise publishers.

Tags
utility SWF