Link Search Menu Expand Document

Echo analytics libraries

Providing a unified way for BBC products to manage client-side event-tracking of user interaction and AV events.

Quickstart guide What is Echo?

Supported platforms

Echo currently supports the following platforms:

Echo JS

Language Javascript

Latest release View

JS client on GitHub

Echo iOS

Language Swift

Latest release View

iOS client on GitHub

Echo Android

Language Java

Latest release View

Android client on GitHub

The Echo repositories are private. To request access, or for any other questions, please email the Analytics Services Team or contact us on Slack in the #help-echo channel.

Echo features

Single integration with many analytics providers

Echo provides a single unified interface for sharing user activity data with various suppliers including Piano, UKOM, BARB, and AppsFlyer.

Page-level tracking and custom events

Set up your page/screen level context and have subsequent events automatically associated with it, and its persistent properties. Now you can use custom events to provide richer details of user interactions.

AV reporting and live schedule data

Accurately capture detailed analytics of users’ interactions on individual items of content within a live audio or video stream.

ID and privacy focus

When logged in to BBC ID, all reported events automatically include the login status of the user, and have respect for personalisation status and user privacy.

Debug mode

Enabling debug mode during development allows you to be notified of problems with your implementation of Echo in a safe environment.

Top-notch support via Slack and email

Need help with your implementation of Echo? Reach out in a #help-echo or email us! We are dedicated to helping our users and continually improving Echo’s developer experience.

Echo is an ever-evolving product. We welcome queries and can add necessary features to our roadmap. Please email AnalyticsSupport@bbc.co.uk to discuss your requirements

Quickstart guide

Below is a quickstart guide to getting Echo into your app. See getting started for more information.

Create an Instance of the Echo Client

    // Tell require where to find the echo module (where x.x.x is the latest version)
    require.config({ paths: {'echo' : 'https://mybbc-analytics.files.bbci.co.uk/echo-client-js/echo-x.x.x.min.js'} });
    require(['echo'], function(Echo){
        var Media = Echo.Media,             // Media class
            EchoClient = Echo.EchoClient,   // Echo Client class
            Enums = Echo.Enums,             // Enums
            ConfigKeys = Echo.ConfigKeys,   // Key names to use in config
            Environment = Echo.Environment; // Class to allow overriding default behaviour
        var conf = {};
        conf[ConfigKeys.DESTINATION] = Enums.Destinations.FOOD;
        var echo = new EchoClient(
                    "MyApp",                    // App Name
                    ApplicationType.WEB,        // App type
                    conf,                       // Optional config dictionary
                    env,                        // Optional Environment class
                    callback                    // Optional callback function
                  );

        // You can optionally set the version of your application:
        echo.setAppVersion('1.1.1');
    });
  
    import uk.co.bbc.echo.EchoClient;
    import uk.co.bbc.echo.EchoConfigKeys;
    import uk.co.bbc.echo.Media;
    import uk.co.bbc.echo.enumerations.MediaAvType;
    import uk.co.bbc.echo.enumerations.MediaForm;
    import uk.co.bbc.echo.enumerations.ApplicationType;
    import uk.co.bbc.echo.enumerations.MediaRetrievalType;
    import uk.co.bbc.echo.enumerations.MediaConsumptionMode;
    import uk.co.bbc.echo.enumerations.MediaScheduleMode;
    import uk.co.bbc.echo.enumerations.PIPsType;

    import android.app.Application;

    public class TestShellApplication extends Application {
        public void initialiseEcho(HashMap<String, String>, config) {
            config.put(EchoConfigKeys.DESTINATION, Destination.FOOD.toString());

            EchoClient echo = new EchoClient(
                "MyApp",                    // App Name
                ApplicationType.MOBILE_APP, // App Type
                "echo.android.test",        // App start countername (no longer used for ATI)
                getApplicationContext(),    // The Android Context of your Application
                config,                     // config options HashMap
                bbcUser,                    // BBCUser instance
                this                        // Application instance of your Application
            );
        }
    }
  
    import Echo
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Echo Config
        var config:Dictionary<EchoConfigKey, String> = [
            .destination: Destination.Food.toString()
        ]
        // BBCUser
        user = BBCUser(signedIn: true,
                       hashedID: hashedId,
                       tokenRefreshTimestamp: Date(timeIntervalSince1970: 1510156737)
        )
        // Initialize Echo
        do {
            echo = try EchoClient(appName: "EchoDemoApp",             // App name
                                  appType: .mobileApp,                // App type
                                  startCounterName: "bbc.start.page", // App start countername (no longer used for ATI)
                                  config: config,                     // Optional config dictionary
                                  bbcUser: user)                      // Optional BBCUser instance
        } catch {
            // Handle Echo config errors
        }
        return true
    }