Nielsen SDK Documentation

DCR Implementation Guide – Browser SDK

API Version 5.1.0

For audio / video measurement, in order to integrate Browser SDK into the player application, perform the following steps.

Prerequisites

Before starting the integration with Browser SDK, secure the following details from the (point of contact) Nielsen TAM.

  • App ID (appid): Unique ID assigned to the player/site and configured by product.
  • sfcode: Location of collection environment. Use the sfcode as “dcr“.
  • ggCom.as (For Flash Player Projects only): Nielsen ActionScript Library to compile within the Flash player project. Configure ggCom.as as mentioned in subsequent sections and include the edited file in the project.

If you do not have any of these pre-requisites or if you have any questions, please contact our SDK sales support team.

Step 1: Import Library

In the HTML head section of each page, call the Nielsen library using the script tag, as shown below.

Step 2: Define GlobalParams

For Flash integration, global parameters must be set as an object in ggCom.as, as follows.

Step 3: Initialize SDK

Initialize Browser SDK as soon as the Parent / Main Page is loaded. During the initialization, custom parameters can be appended to the global parameter object. These custom (extended) parameters are optional. Use them only if the player application can handle the custom parameter data.

The Nielsen Browser SDK supports multiple processing instances. To create an instance, call the getInstance() function

All subsequent calls to getInstance with the same instanceName will return an already created SDK instance with that name. This will allow accessing the same object from different parts of the code.

The “instanceName” parameter is optional and will be set to “default” if missing. To use a single default SDK instance, call

To instantiate Nielsen Browser SDK for Flash integration, add the following line within the player setup.

In order to initialize the SDK, parameters must be passed when calling the initialization function (ggInitialize). The available parameters are listed in the table below.

Parameters Description Value Required? (Y/N)
apid UniqueID assigned to player/site. Nielsen assigned Yes
apn User-defined string value for describing the player/site. Client specified Yes
sfcode Location of collection environment. “dcr” Yes
nsdkv Nielsen SDK Version currently being used. Nielsen assigned (‘511’ for Browser SDK 5.1.1, etc.) Yes
nol_sdkdebug Enables Debug Mode which allows output to be viewed in console. “console” No

For Flash integration

Instantiate Nielsen Browser SDK in the Flash player’s controller. Below is an example code for player setup & instantiation of the SDK.

Step 4: Configure and fire API calls

The syntax for firing events is

CMS data to be sent as an object in the format mentioned above.

Event is passed in parameter 1 and the metadataObject is passed in parameter 2.

For Flash integration

Configure API calls – loadMetadata

Use loadMetadata to pass ‘content’ and ‘ad’ metadata. The CMS data must be passed as a JSON string.

Trigger the loadMetadata call with content metadata (“type”: “content”) before sending any “preroll” ad metadata.

Configure API calls – setPlayheadPosition (Content)

Use setPlayheadPosition to pass the position of the playhead for every one second while the content is being played.

Provide the appropriate playhead position value depending on the type of content streamed.

  • For live content streaming, pass the current UTC time in seconds.
  • For on demand / Video On Demand (VOD) station streaming, pass the offset from the beginning of the file.
# Key Description Values Required? (Y/N) Example

1.

Live ** UTC of the live content. Client-defined Yes Seconds since 1970.
2. Video On Demand (VOD) ** Position taken from beginning of the content in seconds. Client-defined Yes Current player position from beginning of the content.
** One of the parameters is mandatory.

For Flash integration

Video On Demand (VOD) Content

Live Content

Configure API calls – setPlayheadPosition (Ad)

Use setPlayheadPosition to pass the position of the playhead for every one second while the advertisement is being played.

# Key Description Values Required? (Y/N) Example

1.

Ad Position taken from beginning of the ad in seconds. Client-defined Yes

The playhead positions for ad and content should be maintained separately.

Configure API calls – stop

Call stop when switching between content and ads, and also on pause.

For Flash integration

Configure API calls – end

Call end only at the end of playback (but before a postroll occurs, if postrolls are inserted). Call play when resuming the stream / starting a new stream.

For Flash integration

API call sequence

Use Case 1: Content has no Advertisements

Call loadMetadata with JSON metadata for content as below.

Call setPlayheadPosition every one second until a pause / end.

The sample API sequence can be used for reference when identifying the specific events that need to be called during content playback without ads.

Type Sample code Description
Start of stream nSdkInstance.ggPM(loadMetadata, contentMetadataObject); // contentMetadataObject contains the JSON metadata for the content
Content nSdkInstance.ggPM(setPlayheadPosition, playheadPosition); // playheadPosition is position of the playhead while the content is being played
End of Stream nSdkInstance.ggPM(end, playheadPosition); // playheadPosition is position of the playhead while the content is being played

Use Case 2: Content has Advertisements

Call loadMetadata with JSON metadata for ad as below.

In case the individual ad details are not available, send ad pod (presence) details through the loadMetadata and playhead position through setPlayheadPosition.

Call setPlayheadPosition every one second until a pause / end / another loadMetadata is called. Playhead should be passed for the entire duration of ad pod, if the ad pod details is passed as part of loadMetadata.

The sample API sequence can be used for reference when identifying the specific events that need to be called during content and ad playback.

Content Type Sample code Description
Content

nSdkInstance.ggPM(loadMetadata, contentMetadataObject);

// contentMetadataObject contains the JSON metadata for the content
Preroll

nSdkInstance.ggPM(loadMetadata, prerollMetadataObject); nSdkInstance.ggPM(setPlayheadPosition, playheadPosition);
nSdkInstance.ggPM(stop, playheadPosition);

// prerollMetadataObject contains the JSON metadata for preroll ad
// playheadPosition is position of the playhead while the preroll ad is being played
// playheadPosition is position of the playhead while the preroll ad is being played
Content

nSdkInstance.ggPM(loadMetadata, contentMetadataObject); nSdkInstance.ggPM(setPlayheadPosition, playheadPosition);
nSdkInstance.ggPM(stop, playheadPosition);

// contentMetadataObject contains the JSON metadata for the content
// playheadPosition is position of the playhead while the content is being played
// playheadPosition is position of the playhead while the content is being played
Midroll

nSdkInstance.ggPM(loadMetadata, midrollMetadataObject); nSdkInstance.ggPM(setPlayheadPosition, playheadPosition);
nSdkInstance.ggPM(stop, playheadPosition);

// midrollMetadataObject contains the JSON metadata for midroll ad
//playheadPosition is position of the playhead while the midroll ad is being played
// playheadPosition is position of the playhead while the midroll ad is being played
Content

nSdkInstance.ggPM(loadMetadata, contentMetadataObject); nSdkInstance.ggPM(setPlayheadPosition, playheadPosition);
nSdkInstance.ggPM(end, playheadPosition);

// contentMetadataObject contains the JSON metadata for the content
// playheadPosition is position of the playhead while the content is being played
//playheadPosition is position of the playhead while the content is being played
Postroll

nSdkInstance.ggPM(loadMetadata, postrollMetadataObject); nSdkInstance.ggPM(setPlayheadPosition, playheadPosition);
nSdkInstance.ggPM(stop, playheadPosition);

// postrollMetadataObject contains the JSON metadata for midroll ad
// playheadPosition is position of the playhead while the postroll ad is being played
// playheadPosition is position of the playhead while the postroll ad is being played

The sample event sequence can be used for reference when identifying the specific events that need to be called during content and ad playback in a Flash player.

Content Type Sample code Description
Content

ggCom.getInstance().PM(‘loadMetadata’,contentMetadataObject);

// contentMetadataObject contains the JSON metadata for the content
Preroll

ggCom.getInstance().PM(loadMetadata, prerollMetadataObject); ggCom.getInstance().PM(setPlayheadPosition, playheadPosition);
ggCom.getInstance().PM(stop, playheadPosition);

// prerollMetadataObject contains the JSON metadata for preroll ad
// playheadPosition is position of the playhead while the preroll ad is being played
// playheadPosition is position of the playhead while the preroll ad is being played
Content

ggCom.getInstance().PM(loadMetadata, contentMetadataObject); ggCom.getInstance().PM(setPlayheadPosition, playheadPosition);
ggCom.getInstance().PM(stop, playheadPosition);

// contentMetadataObject contains the JSON metadata for the content
// playheadPosition is position of the playhead while the content is being played
// playheadPosition is position of the playhead while the content is being played
Midroll

ggCom.getInstance().PM(loadMetadata, midrollMetadataObject); ggCom.getInstance().PM(setPlayheadPosition, playheadPosition);
ggCom.getInstance().PM(stop, playheadPosition);

// midrollMetadataObject contains the JSON metadata for midroll ad
//playheadPosition is position of the playhead while the midroll ad is being played
// playheadPosition is position of the playhead while the midroll ad is being played
Content

ggCom.getInstance().PM(loadMetadata, contentMetadataObject); ggCom.getInstance().PM(setPlayheadPosition, playheadPosition);
ggCom.getInstance().PM(end, playheadPosition);

// contentMetadataObject contains the JSON metadata for the content
// playheadPosition is position of the playhead while the content is being played
//playheadPosition is position of the playhead while the content is being played
Postroll

ggCom.getInstance().PM(loadMetadata, postrollMetadataObject); ggCom.getInstance().PM(setPlayheadPosition, playheadPosition);
ggCom.getInstance().PM(stop, playheadPosition);

// postrollMetadataObject contains the JSON metadata for midroll ad
// playheadPosition is position of the playhead while the postroll ad is being played
// playheadPosition is position of the playhead while the postroll ad is being played

Nielsen Measurement Opt-Out Implementation

  • As a global information and measurement leader, we are committed to protecting the privacy and security of the data we collect, process and use. Our digital measurement products are not used to identify the consumer in any way, but they help us and our clients measure and analyze how consumers engage with media across online, mobile and emerging technologies, and offer insights into consumer behavior.
  • When the user wants to opt in or opt out of Nielsen measurement, a new dynamic page (with content similar to http://www.nielsen.com/digitalprivacy) should be displayed.
  • For more details, refer to Opt-Out Implementation and Nielsen Digital Privacy.

Pre-Certification Checklists

  • After the application is ready to be sent for Nielsen Certification, please go through the Pre-Certification Checklist and ensure that it behaves as expected, before submitting to Nielsen.

Testing an Implementation – Browser

Click here for information on Testing the Browser Implementation.