Skip to main content
Version: 7.12.0

THEOplayer Android Comscore Connector

A Comscore analytics connector for use with THEOplayer in Android applications.

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):

val comscoreConfiguration = ComscoreConfiguration(
publisherId = "<your publisher ID here>", // Can be a test or production key.
applicationName = "THEOplayer Demo",
userConsent = "1",
childDirected = false,
secureTransmission = true,
usagePropertiesAutoUpdateMode = 1,
debug = true
)
val metadata = ComscoreMetaData(
mediaType = ComscoreMediaType.LONG_FORM_ON_DEMAND,
uniqueId = "testuniqueId",
length = 634,
stationTitle = "THEOTV",
programTitle = "Big Buck Bunny",
episodeTitle = "Intro",
genreName = "Animation",
classifyAsAudioStream = false,
c3 = "c3value",
c4 = "c4value",
c6 = "c6value",
stationCode = null,
networkAffiliate = null,
publisherName = null,
programId = null,
episodeId = null,
episodeSeasonNumber = null,
episodeNumber = null,
genreId = null,
carryTvAdvertisementLoad = null,
classifyAsCompleteEpisode = null,
dateOfProduction = null,
timeOfProduction = null,
dateOfTvAiring = null,
timeOfTvAiring = null,
dateOfDigitalAiring = null,
timeOfDigitalAiring = null,
feedType = null,
deliveryMode = null,
deliverySubscriptionType = null,
deliveryComposition = null,
deliveryAdvertisementCapability = null,
mediaFormat = null,
distributionModel = null,
playlistTitle = null,
totalSegments = null,
clipUrl = null,
videoDimension = null,
customLabels = emptyMap(),
)

val comscore = ComscoreConnector(this, theoplayerView.player, comscoreConfiguration, metadata)

val playerConfig = THEOplayerConfig.Builder()
.analytics(comscore)
.build()

val theoplayerView = THEOplayerView(this)
theoplayerView.config = playerConfig

val theoplayer = theoplayerView.theoplayer
theoplayer.source = SourceDescription.Builder()
.sources("YOUR_SOURCE_URL_HERE")
.build()

theoplayerView.onCreatePlayer { player ->
// Initialize Comscore connector
comscore.init(player)
}

Passing Metadata Dynamically

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

comscoreConnector.update(ComscoreMetaData())

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)
PropertyRequiredOptional
mediaTypeAll
uniqueIdAll
lengthAll
c3V
c4V
c6V
stationTitleAll
stationCodeAll
networkAffiliateAll
publisherNameX CV
programTitleAll
programIdV C
episodeTitleAll
episodeIdX C
episodeSeasonNumberX C
episodeNumberX C
genreNameAll
genreIdAll
carryTvAdvertisementLoadX
classifyAsCompleteEpisodeX
dateOfProductionC
timeOfProductionC
dateOfTvAiringX C
timeOfTvAiringX C
dateOfDigitalAiringX C
timeOfDigitalAiringX C
feedTypeX
classifyAsAudioStreamAll
deliveryModeAll
deliverySubscriptionTypeAll
deliveryCompositionAll
deliveryAdvertisementCapabilityAll
mediaFormatAll
distributionModelAll
playlistTitleC
totalSegmentsV C
clipUrlV C
videoDimensionC
customLabelsAll