npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@theoplayer/react-native-analytics-comscore

v1.6.0

Published

Comscore analytics connector for @theoplayer/react-native

Downloads

56

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 |