Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@theoplayer/react-native-analytics-comscore

THEOplayer3.7kSEE LICENSE AT https://www.theoplayer.com/terms1.10.0TypeScript support: included

Comscore analytics connector for @theoplayer/react-native

react-native, THEOplayer, ios, android, comscore

readme

THEOplayer React-Native Comscore Connector

A Comscore analytics connector for @theoplayer/react-native.

Installation

npm install @theoplayer/react-native-analytics-comscore

Usage

Configuring the connector

Create the connector by providing the THEOplayer instance, a ComscoreConfiguration (which contains your publisher id) and the ComscoreMetadata of the first source you will set to the player (you can change it dynamically throughout the entire lifecycle of the connector):

import { useComscore } from '@theoplayer/react-native-analytics-comscore';

export const comscoreMetadata: ComscoreMetadata = {
    mediaType: ComscoreMediaType.longFormOnDemand,
    uniqueId: 'testuniqueId',
    length: 634.566,
    stationTitle: 'THEOTV',
    programTitle: 'Big Buck Bunny',
    episodeTitle: 'Intro',
    genreName: 'Animation',
    classifyAsAudioStream: false,
    customLabels: {
        testcustomlabel: 'testcustomvalue'
    }
};

const comscoreConfig: ComscoreConfiguration = {
    publisherId: '<your publisher id (aka c2 id)',
    applicationName: '<your app name>',
    userConsent: ComscoreUserConsent.granted,
    usagePropertiesAutoUpdateMode: ComscoreUsagePropertiesAutoUpdateMode.foregroundOnly,
    debug: true
};

const App = () => {
    const [comscore, initComscore] = useComscore(COMSCORE_METADATA, comscoreConfig);

    const onPlayerReady = (player: THEOplayer) => {
        // Initialize Comscore connector
        initComscore(player);
    };

    return <THEOplayerView config={playerConfig} onPlayerReady={onPlayerReady} />;
};

Passing metadata dynamically

The connector allows passing or updating the current asset's metadata at any time:

const onUpdateMetadata = () => {
    comscore.current.update({
        mediaType: ComscoreMediaType.longFormOnDemand,
        uniqueId: 'testuniqueId',
        length: 634.566,
        stationTitle: 'THEOTV',
        programTitle: 'Big Buck Bunny',
        episodeTitle: 'Intro',
        genreName: 'Animation',
        classifyAsAudioStream: false,
        customLabels: {
            testcustomlabel: 'testcustomvalue'
        }
    });
};

ComscoreMetadata fields

Based on the ComscoreMetadata type, you can tell which fields are mandatory and which aren't. Note that this is purely for the integration to work correctly. Depending on the Comscore solution you are using, different fields are required/optional. The mandatory fields in the ComscoreMetadata type are the ones that are mandatory for all three Comscore solutions:

  • Video Metrix (V)
  • Cross Platform Product Suite (X)
  • Cross Media Audience Measurement (C)
Property Required Optional
mediaType All
uniqueId All
length All
c3? V
c4? V
c6? V
stationTitle All
stationCode? | All
networkAffiliate? | All
publisherName? X C V
programTitle All
programId? | V C
episodeTitle All
episodeId? | X C
episodeSeasonNumber? X C
episodeNumber? X C
genreName All
genreId? | All
carryTvAdvertisementLoad? X
classifyAsCompleteEpisode? X
dateOfProduction? | C
timeOfProduction? | C
dateOfTvAiring? X C
timeOfTvAiring? | X C
dateOfDigitalAiring? X C
timeOfDigitalAiring? | X C
feedType? X
classifyAsAudioStream Al
deliveryMode? | All
deliverySubscriptionType? | All
deliveryComposition? | All
deliveryAdvertisementCapability? | All
mediaFormat? | All
distributionModel? | All
playlistTitle? | C
totalSegments? | V C
clipUrl? | V C
videoDimension? | C
customLabels? | All

changelog

@theoplayer/react-native-analytics-comscore

1.10.0

✨ Features

  • Added support for THEOplayer 9.0.

1.9.0

✨ Features

  • Passing the usagePropertiesAutoUpdateMode configuration property to the native iOS connector.

1.8.2

🐛 Issues

  • Fixed an issue on iOS where the podspec files did not contain all references when not using the New Architecture.

1.8.1

🐛 Issues

  • Fixed an issue on iOS where the project would not build when used in a project that has New Architecture enabled.

1.8.0

✨ Features

  • Added sdkVersions API to Nielsen, Mux, Conviva, Comscore, Adobe and Engage connectors

1.7.1

🐛 Issues

  • Deleted dependency on the removed ad module for Android.

1.7.0

✨ Features

  • Added support for THEOplayer 8.0

1.6.0

📦 Dependency Updates

  • Removed setup for Mux connector on tvOS. The Mux pod is only available for iOS.
  • Added support for react-native-theoplayer v7.0.0 and native player SDK v7.0.0.

1.5.0

🐛 Issues

  • Fixed an issue on Android where notifyPlay() was not called when the player would resume play-out.
  • Fixed an issue on Android where the user consent variables were not properly passed.
  • Fixed an issue on Web where the player position is reported as a decimal value instead of an integer.

✨ Features

  • Added the usagePropertiesAutoUpdateMode option to ComscoreConfiguration to indicate whether background playback is supported.

1.4.1

✨ Features

  • Relax restriction on react-native-theoplayer peer dependency versions.

1.4.0

📦 Dependency Updates

  • Added support for react-native-theoplayer v3.0 and THEOplayer 6.0.

1.3.0

🐛 Issues

  • Fixed an issue on Web where some duration and currentTime values were reported wrong.

1.2.0

🐛 Issues

  • Fixed an issue on Android where the usage properties would not update when the app transitions to the background.

1.1.0

📦 Dependency Updates

  • Updated Web dependency to Comscore SDK v7.7.0

1.0.0

✨ Features

  • Initial release