DCR Germany Static Browser SDK

From Engineering Client Portal

Revision as of 10:52, 6 July 2022 by MichelFodjo (talk | contribs)

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png AGF Implementation Documentation breadcrumbArrow.png DCR Germany Static Browser SDK


The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc. The Browser SDK is the framework for browsers developers to integrate Nielsen Measurement into their Web pages. It supports static content measurement and can track key life cycle events of pages like:

  • Site launch events and how long page is viewed
  • Time of viewing a sub section / page.

This guide will show you how to enable page measurement (aka Static) on your website(s). The Nielsen Tracking Code must be added to each page with different metadata.


To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.


Step 1: Add Static Queue Snippet

The static queue snippet allows the SDK APIs to be called while the actual SDK and configuration file are still being downloaded. As the queue can capture all API calls before the download completes, there is no wait time. Once the SDK is available, the API calls will transition from directing to the queue to the SDK seamlessly.

Add the following script tag to the website i.e. within the <head></head> tag :

	// Add Static Queue Snippet
		function t(e){
			return"object"==typeof e?JSON.parse(JSON.stringify(e)):e
				var s=e.document,
				var i=s.getElementsByTagName("script")[0];
				return i.parentNode.insertBefore(a,i),
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&&console.log&&console.log("Error: Cannot register event in Nielsen SDK queue.")}},
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&&console.log&&console.log("Error: Cannot register event in Nielsen SDK queue.")}}},

Step 2: Create SDK Instance

While creating an SDK instance, initialize the SDK by calling:

  // SDK Initialization
  var nSdkInstance = NOLBUNDLE.nlsQ("PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX","nlsnInstance", {nol_sdkDebug: "debug"});

The initialization call has the below parameters:

Parameter Description Required Values
apid Unique ID assigned to player/site Yes 'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
instanceName Name of SDK instance Yes "any string value"
nol_sdkDebug Enables Nielsen console logging. Only required for testing No "{nol_sdkDebug: "debug"})"

When the initialization call is made, a unique static config file, <apid>.js, will be downloaded based on the apid and cached by the client-side browser(s).

Once the static config file is downloaded, the SDK will be fully downloaded and initialized. All SDK modules are included in one file: "nlsSDK600.bundle.min.js".

Step 3: Create Metadata Object

Key Description Values Required (Obligatory)
assetid unique ID assigned to each article/page; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) custom (no Special Characters)
section section of each site (e.g. section value should be first level in page URL: website.com/section) custom
segA custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
segB custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
segC custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
subbrand vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) provided by Nielsen

Example Web Page Metadata Object

  window.articlemetadata = {
    type: "static",
    assetid: "Unique_page_ID", 
	section:  "Unique_section_ID", 
    segA: "Unique_section_segA", 
    segB: "Optional_section_segB",
    segC: "Optional_section_segC"
    subbrand: "subbrand_received_from_Nielsen"

Step 4: Call staticstart Event

Start static measurement :

  // Event 'staticstart' Call
  nSdkInstance.ggPM("staticstart", window.articlemetadata);

The content metadata object is passed as a parameter.

Step 5: Review Privacy and Opt-Out

The Browser SDK video measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen SDK video measurement is utilizing a cookieless domain.

In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:

Step 6: Testing

Monitoring Tools Testing the Browser Implementation

The steps to test the implementation are given below.

Step 6.1

Filter HTTP traffic with the string "nmr" to capture traffic from the SDK. This will capture traffic going to Nielsen servers.

Step 6.2

Verify that the Nielsen SDK is being downloaded correctly and is the correct version.


Step 6.3

When the page is loaded for the first time, the Browser SDK fires a View ping as soon as content is loaded. Utilizing your HTTP traffic filter tool, you can now validate the metadata that is being sent to the Nielsen collection servers.

Example View Ping Below:


Step 6.4

The first duration ping is fired after 5 minutes of content is viewed and is indicated by the cr value containing a D. This should fire every 5 minutes but only when the page is in focus.


Step 7: Going Live

Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.

  1. Debug Logging: Disable logging by deleting {nol_sdkDebug: 'debug'} from initialization call.

Example Production Initialization Call

Refer to the production initialization call below:

var nSdkInstance = NOLBUNDLE.nlsQ("P14273221-CF5C-46BF-A832-994AEFB7XXXX");

Note: before going live you have to inform Nielsen - this is necessary, because Nielsen team has to adjust internal configuration parameter to enable data collection. Without that notification no data will be collected and no data will be reported.

Step 8: Review the Sample Implementation for your Reference

The Sample Implementation for AGF located here.