ComScore Analytics

The AmpComScore plugin offers a quick way to integrate AmpPlayer with ComScore SDK. This plugin enables the reporting of data collected by ComScore in your application.

If you desire to check out a basic implementation please refer to our application samples:

Adding the Plugin to the Xcode project

Manual Installation

To manually install the plugin you’ll need to download our latest distribution. You will be using AmpComScore.xcframework and the AmpCore.xcframework to integrate this plugin.

You will also need the ComScore Analytics which you can download it on the release page.

This plugin will only work on iOS.
The latest version of the ComScore Analytics used by this plugin is 6.12.3 . Newer versions may be used, but you may run into unexpected errors until an update is released.

After aquiring the frameworks you can just drag them to you Xcode project directory.

manual installation 1

The last step, is to mark every imported framework for Embed & Sign in the project’s general tab.

manual installation 2

CocoaPods

If you don’t have CocoaPods installed, refer to the CocoaPods documentation. To use CocoaPods, first create a Podfile in the directory containing the Xcode project. For the AmpComScore plugin, the Podfile should look like this:

target "ProjectName" do

  use_frameworks!

  pod 'AmpCore'
  pod 'AmpComScore'
  pod 'ComScore'

end

Once you have added the Podfile just run the command pod install --repo-update in the directory it’s located. Once the command has been completed you should se a new .xcworkspace file in your folder. Now you can start integrating the library.

Implementation

You need a working implementation of the AmpPlayer before using this plugin. If you need the implementation guide for AmpPlayer please refer to our documentation.

Import

The first step is to import the AmpCore and ComScore plugins. In addition, if you wish to specify the content metadata, you will also need to import the ComScore plugin.

import AmpCoreTV
import AmpComScoreTV
import ComScore

Creating a new instance

To use this plugin you should first initialize it. You need to specify the publisher ID and the player being used.

var ampComScore: AmpComScore!

ampComScore = AmpComScore(publisherId: publisherId, ampPlayer: ampPlayer!)
The publisher ID is provided by ComScore.

Specifying content metadata

To specify the content metadata, you need to create an instance of SCORStreamingContentMetadata, set the desired values and pass it on to the AmpComScore instance by using the addMainContentAsset(builder: builder) API:

let metadata = SCORStreamingContentMetadata(builderBlock: { (builder) in
    builder?.setMediaType(SCORStreamingContentType.longFormOnDemand)
    builder?.setUniqueId("13579")
    builder?.setLength(1418000) // 23m58s in milliseconds
    builder?.setDictionaryClassificationC3("AMPC3")
    builder?.setDictionaryClassificationC4("AMPC4")
    builder?.setDictionaryClassificationC6("AMPC5")
    builder?.setStationTitle("AMPStation")
    builder?.setPublisherName("AMPPublisher")
    builder?.setProgramTitle("AMPTitle")
    builder?.setGenreName("AMPGenre")
    builder?.classify(asCompleteEpisode: true)
})!

ampComScore.addMainContentAsset(builder: metadata)

If you want a full specification of the SCORStreamingContentMetadata you can find it on the ComScore manuals.

Additional Information

This guide was written on 5/6/2020 and it’s last revision was made on 7/16/2024. If you need any additional support please contact us through our offical support email.