Link Search Menu Expand Document

BARB Delegate

Important BARB reporting is now enabled for all products. Please don’t disable it unless you have been asked to do so.

Additionally, you may need to edit your Content Security Policy to allow requests to bbcdotcom.2cnt.net if you have not been reporting to BARB previously, please check that so that there is no chance of these requests being blocked.

The BARB delegate is used to report iPlayer video analytics data to BARB.

On-Demand media that is less than 30 seconds long will not be reported to BARB. For this reason, you must tell Echo the length of your piece of media (see Media Length).

Internally the delegate uses the Spring Streams library developed by Kantar Media. For further information see the Kantar BARB wiki.

Table of contents

  1. Enabling BARB reporting
  2. BARB Site code
  3. The BARB device ID cookie
  4. Live consumption
    1. Webcasts
  5. Backgrounding
  6. Offline Mode
  7. Testing
  8. Media Length
    1. Live Media
    2. On Demand Media

Enabling BARB reporting

BARB is enabled by default in Echo JS (13.3.0+), Echo iOS (7.6.0+), and Echo Android (20.4.0+).

  • set the BARB_ENABLED config option to true (see advanced config) or simply don’t set a value for this configuration option, where it is enabled by default
  • provide a position and timestamp through your PlayerDelegate
  • start tracking a piece of media.

BARB Site code

When testing your application you may want to set the BARB_SITE_CODE configuration option to a value from the table below. It is not necessary to set this option when reporting ‘live’ data as this is the default value.

Echo Version Live (default) Test
JS bbcdotcom bbcdotcomtest
Android bbcandroid bbcandroidtest
iOS bbcios bbciostest

BARB depends on the value of the following cookies being preserved. This applies to both webviews and HTTP clients. Please ensure that you allow these cookies where appropriate (eg in the Auth Toolkit’s cookie whitelist, etc).

Delegate Domain Cookie Notes
BARB .2cnt.net i00 BARB/Kantar device ID

Live consumption

Since early June 2016 Echo has switched to BARB live reporting method 1.

Earlier Echo releases used the ‘channel only’ method 3 for live reporting.

Echo will report to BARB using:

  • a stream value including the service ID eg live/bbc_one_london
  • a pst value matching the live stream timestamp in seconds eg 1464702095

Example URL:

http://bbcdotcom.2cnt.net/j0=,,,,v=A%201.1.0+app=testapp+pl=mobiletestapp+did=868e10589389fd35+aid=bb97262e90e4ef1f+sy=768+plv=1.0.0.0+sx=1196;+,vt=16+uid=3a8w7ib+stream=live/bbc_one_london+pst=,,0+0+na8vcw;+,1407932109+1407932126+na8vcw;;+sy=360+dur=0+sx=640;;;;?lt=hysmffp1

This makes Echo live reporting dependent on players providing a live timestamp through a PlayerDelegate.

Webcasts

A webcast is usually expressed to Echo as a live media item with a version PID (no service ID). In this scenario Echo will use the ESS API to determine the service ID associated with the webcast version eg sport_stream_04.

If Echo is unable to identify a service ID using the ESS API the stream will be reported as live/no-service-id-found.

Backgrounding

On platforms that allow applications to be backgrounded (iOS, Android) Echo will automaticaly stop BARB tracking whenever you call EchoClient.appBackgrounded() (or automatically on iOS). BARB tracking will not start again until you call EchoClient.avPlayEvent() (usually after foregrounding and resuming playback).

Offline Mode

The Spring library features an offline mode that:

  • stores events when a device has no network connection
  • transmits the events to BARB when a connection becomes available

Offline mode is enabled by default. To disable Offline collection you will need to set the BARB_OFFLINE_MODE configuration flag to false (see advanced config). Kantar documentation around Offline Mode can be found here.

Note that this is separate from Echo’s general cache mode config, you can have cache mode off but still have BARB offline mode on. Make sure that if you want to change the default behaviour you have set both of these options as desired.

Testing

As a product implementing BARB reporting it is your responsibility to do this and understand the steps that must be taken prior to enabling live reporting. It will be necessary to communicate with both the Analytics Services team as well as Kantar to co-ordinate this.

It is possible to examine BARB requests using Charles or a similar proxy, or the Echo Chamber application. For more information regarding testing your product please refer to our testing documentation.

Media Length

Live Media

You should report a length of “zero” (0) for live media, as Echo will use ESS for Live Enrichment.

On Demand Media

Please set the Media object with the correct value for length. If you are unaware of the length of the Media, please report 0, and update setMediaLength as soon as you know the true length.

  • Media shorter than 30 seconds will not be reported to Barb. This is “Short Form Media”.
  • Media longer than 30 seconds will be reported to Barb.
    • Media with a reported length of “zero” (0) will be considered Long form, or “not Short Form Media”.