DCR Germany Static Google Tag Manager

From Engineering Client Portal

Revision as of 13:55, 19 January 2022 by MichelFodjo (talk | contribs) (Step 1.3: Add a new GTM Tag)

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png AGF Implementation Documentation breadcrumbArrow.png DCR Germany Static Google Tag Manager


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.

Google Tag Manager provides easy-to-use tag templates for many Google and non-Google tools like Nielsen Browser SDK.

  • The Google Tag Manager framework is place on a publisher’s web page making it easy to add and maintain tags across sites without additional code.
  • All tag modification/additions, are performed via a point and click User Interface.


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.


Reporting Structure

The figures below show the reporting structures for Static content:

static reporting.jpg

Step 1: Create a new GTM Tag

Step 1.1: Prepare the code to load and initialize SDK with the page Metadata

Step 1.1.1: Prepare SDK Initialization API Call

NOLBUNDLE.nlsQ("<apid>", "<instanceName>",{nol_sdkDebug: "debug"})

When creating an instance, pass the following three values:

Parameter Description Values
apid Unique ID assigned to player/site 'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
instanceName Name of SDK instance "any string value"
nol_sdkDebug Enables Nielsen console logging. Only required for testing (not in production) "{nol_sdkDebug: "debug"})"
Example SDK Initialization API Call
var nSdkInstance = NOLBUNDLE.nlsQ('P51750D61-3152-4F5B-89A7-xxxxxxxxxx', 'nlsnInstance', {
      containerID: "my-sdkplayer",
      nol_sdkDebug: "debug"

Step 1.1.2: Prepare Web Page Metadata

Web Page Metadata should be ready when initializing a new SDK instance.

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
nol_segA custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
nol_segB custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
nol_segC custom segment for reporting: unique values across custom segments (segA + segB + segC) custom
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"

Step 1.2: Login to your Google Tag Manager Account

Step 1.3: Add a new GTM Tag

From within the GTM interface, select Add New Tag


Step 1.4: Add Custom HTML code using the above prepared SDK Initialization API Call and page metadata

Insert the following code into the Custom HTML Window substituting the appid of P51750D61-3152-4F5B-89A7-xxxxxxxxxx for the appid provided by your Technical Account Manager.

	// 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.")}}},
	// create and intitialize a new SDK instance
    var nSdkInstance = NOLBUNDLE.nlsQ('P51750D61-3152-4F5B-89A7-xxxxxxxxxx', 'nlsnInstance', {
      containerID: "my-sdkplayer",
      nol_sdkDebug: "debug"
    // create page/article metadata
	window.articlemetadata = {
    	type: "static",
    	assetid: "Unique_page_ID", 
		section:  "Unique_section_ID", 
    	segA: "Unique_section_segA", 
    	segB: "Optional_section_segB",
    	segC: "Optional_section_segC"
    // pass page/article metadata to the new SDK Instance for the measurement start 
   nSdkInstance.ggPM('staticstart',  window.articlemetadata);

Step 1.5 Configure Page Trigger

Do not forget to setup the Firing Trigger for this Custom HTML within the GTM interface. The recommended default setting should be 'All Pages'.


Step 1.6: Embed the GTM Container Script within your Pages

  • Once your container created in GTM, the script code snippet needs to be embedded within each webpage on your site.
  • You will find your GTM Container Script under ADMIN >> Install Google Tag Manager It will look similar to the below:

Paste this code as high in the <head> of the page as possible:

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

Additionally, paste this code immediately after the opening <body> tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-YourContainerTag"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Step 2: 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 3: Testing

Monitoring Tools Testing the Browser Implementation

The steps to test the implementation are given below.

Step 3.1

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

Step 3.2

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


Step 3.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 3.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 4: 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 5: Review the Sample Implementation for your Reference

The Sample Implementation for AGF located here.