<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nielsentest.mywikis.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MagdalenaKostulska</id>
	<title>Engineering Client Portal - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nielsentest.mywikis.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MagdalenaKostulska"/>
	<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/wiki/Special:Contributions/MagdalenaKostulska"/>
	<updated>2026-04-08T09:03:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=3884</id>
		<title>DCR Poland Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=3884"/>
		<updated>2019-06-26T07:46:03Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Example Ad Object */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The Browser SDK is the framework for browsers developers to integrate Nielsen Measurement into their media player pages. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR). Nielsen SDKs are also equipped to measure static content and can track key life cycle events of pages like:&lt;br /&gt;
*Site launch events and how long page is viewed&lt;br /&gt;
*Time of viewing a sub section / page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Please note:'''&lt;br /&gt;
The Browser SDK is intended to be used for native Browser implementations and cannot be used in a hybrid framework environment on Apps (Android, iOS) - eg. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
In order to start using Nielsen's Browser SDK the following items are needed:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 30px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
|}&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for utilizing the Standard Nielsen Browser SDK for DCR.&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Static Queue Snippet ===&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
==== Initialization API Call ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing (not in production) || &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example SDK Initialization ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.eu.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique AppID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
 var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {nol_sdkDebug: &amp;quot;DEBUG&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	||&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	||&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || custom value that can be used for secondary crediting	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || custom value that can be used for secondary crediting	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Content Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  // SDK&lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  'VID123-123456',&lt;br /&gt;
  program:  'program name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '543'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset (64 character limit; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations)|| custom (no [[Special Characters]]) || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' &lt;br /&gt;
Avoid Carriage Return (CR) and/or Linefeeds (LF) in all fields!&lt;br /&gt;
Implementations have to filter out CR/LF with appropriate programming.&lt;br /&gt;
It's also a good idea to check and validate entries from other systems (eg. CMS, player) before simply copy them to the variables in metadata.&lt;br /&gt;
&lt;br /&gt;
==== Call Nielsen APIs ====&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
To indicate pause&lt;br /&gt;
&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Send '''loadMetadata''' with the same metadata and continue sending '''setPlayheadPosition''' once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending '''setPlayheadPosition''' once the playback resumes.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var stopped = false;&lt;br /&gt;
function closePlayer() {&lt;br /&gt;
	if (stopped) {return;}&lt;br /&gt;
	stopped = true;&lt;br /&gt;
	if (inMidroll) {    // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
		nSdkInstance.ggPM('stop', playheadPositionMidroll);&lt;br /&gt;
	}&lt;br /&gt;
	nSdkInstance.ggPM('end', playheadPositionContent);    // Indicate &amp;lt;end&amp;gt; for the content&lt;br /&gt;
};&lt;br /&gt;
window.addEventListener(&amp;quot;beforeunload&amp;quot;, function (e) {&lt;br /&gt;
	closePlayer();   // call nielsensdk with end/stop&lt;br /&gt;
});&lt;br /&gt;
window.addEventListener(&amp;quot;pagehide&amp;quot;, function (e) {	// for iOS mobile &amp;quot;pagehide&amp;quot; recommended by apple&lt;br /&gt;
	closePlayer();   // call nielsensdk with end/stop&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer or covering Safari on mobile browsers ... you may use &amp;quot;onpagehide&amp;quot; event as well).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event name !! Values to pass !!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each content/ad metadata object and after stop event when resuming '''video content''' (not after pausing and resuming an ad)&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;VOD (or ad ): || current position in seconds (integer) &amp;lt;br/&amp;gt;&lt;br /&gt;
*&amp;quot;Live: current UTC timestamp (seconds since January 1st 1970)&amp;lt;br/&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position in seconds	|| Call when ads complete playing and on pause event (when resume will be available). The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| This event has to be called once for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Playhead position as integer&lt;br /&gt;
&lt;br /&gt;
'''Note:''' 'setPlayheadPosition' has to be called every second&lt;br /&gt;
&lt;br /&gt;
==== Example Events ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' loadMetadata  |  '''Value Pass ( Object ):''' Content Metadata Object&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' loadMetadata  |  '''Value Pass  ( Object ):''' Pre-roll AD Metadata Object&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('loadMetadata', prerollMetadataObject); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' setPlayheadPosition  |  '''Value Pass ( Integer ):''' playheadPosition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' stop  |  '''Value Pass ( Integer ):''' stopPlayheadPosition &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('stop', stopPlayheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' end  |  '''Value Pass ( Integer ):''' endPlayheadPosition &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('end', endPlayheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  SDK Event Lifecycle ==&lt;br /&gt;
&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Examples|&lt;br /&gt;
without Ads|&lt;br /&gt;
&lt;br /&gt;
==== Event Lifecycle without ads: ====&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:even browser no ads.png]]&lt;br /&gt;
&lt;br /&gt;
==== Example without ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);  // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('end', endPlayheadPosition);  // has to be called here at the end of the content&lt;br /&gt;
// endPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|with Ads=&lt;br /&gt;
&lt;br /&gt;
==== Event Lifecycle with ads: ====&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:event browser.png|event browser.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example with ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);  // end pre-roll stream&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
  &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);  // end mid-roll stream&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition); &lt;br /&gt;
nSdkInstance.ggPM('end', endPlayheadPosition);  // has to be called here at the end of the content&lt;br /&gt;
// endPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition); // end post-roll stream&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* after an 'end' in case there is a new content played, there is a need to have another 'loadmetadata' again.&lt;br /&gt;
&lt;br /&gt;
* For Ad, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
* For pre-roll ads you have to call the loadMetadata event for content at the start of stream and after the preroll&lt;br /&gt;
&lt;br /&gt;
* '''For type 'content' ''': Sending a &amp;quot;loadMetadata&amp;quot; event after a &amp;quot;stop&amp;quot; event will be handled by the SDK as a &amp;quot;resume&amp;quot;, as long as the &amp;quot;assetid&amp;quot; and &amp;quot;type&amp;quot; are the same and not changed from the values before the &amp;quot;stop&amp;quot; event happened. Changing &amp;quot;assetid&amp;quot; value will lead into a new stream. Changing of &amp;quot;type&amp;quot; from &amp;quot;content&amp;quot; to &amp;quot;preroll&amp;quot; (&amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;) will lead into a new object (ad) with that content stream. Changing any other parameter (eg. &amp;quot;program&amp;quot; or &amp;quot;title&amp;quot;) for the content will not affect the reported content data (will stay as in the very first &amp;quot;content&amp;quot; metadata)&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/pl/pl/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click &amp;quot;Choices&amp;quot; to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen Online Measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/pl/pl/optout.html.''&lt;br /&gt;
&lt;br /&gt;
====Opt Back In====&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'debug'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
&lt;br /&gt;
====Example Production Initialization Call ====&lt;br /&gt;
Refer to the production initialization call below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;myPlayerName&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=3880</id>
		<title>DCR Poland Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=3880"/>
		<updated>2019-06-24T11:19:20Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: updated priv policy link (pl)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The Browser SDK is the framework for browsers developers to integrate Nielsen Measurement into their media player pages. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR). Nielsen SDKs are also equipped to measure static content and can track key life cycle events of pages like:&lt;br /&gt;
*Site launch events and how long page is viewed&lt;br /&gt;
*Time of viewing a sub section / page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Please note:'''&lt;br /&gt;
The Browser SDK is intended to be used for native Browser implementations and cannot be used in a hybrid framework environment on Apps (Android, iOS) - eg. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
In order to start using Nielsen's Browser SDK the following items are needed:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 30px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
|}&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for utilizing the Standard Nielsen Browser SDK for DCR.&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Static Queue Snippet ===&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
==== Initialization API Call ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing (not in production) || &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example SDK Initialization ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.eu.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique AppID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
 var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {nol_sdkDebug: &amp;quot;DEBUG&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	||&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	||&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || custom value that can be used for secondary crediting	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || custom value that can be used for secondary crediting	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Content Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  // SDK&lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  'VID123-123456',&lt;br /&gt;
  program:  'program name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '543'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset (64 character limit; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations)|| custom (no [[Special Characters]]) || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Please refer to the additional document describing mandatory and optional c-vars - currently &amp;quot;AGF Custom Variables and Metadata DCR v1.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Avoid Carriage Return (CR) and/or Linefeeds (LF) in all fields!&lt;br /&gt;
Implementations has to filter out CR/LF with appropriate programming.&lt;br /&gt;
It's also a good idea to check and validate entries from other systems (eg. CMS, player) before simply copy them to the variables in metadata.&lt;br /&gt;
&lt;br /&gt;
==== Call Nielsen APIs ====&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
To indicate pause&lt;br /&gt;
&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Send '''loadMetadata''' with the same metadata and continue sending '''setPlayheadPosition''' once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending '''setPlayheadPosition''' once the playback resumes.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var stopped = false;&lt;br /&gt;
function closePlayer() {&lt;br /&gt;
	if (stopped) {return;}&lt;br /&gt;
	stopped = true;&lt;br /&gt;
	if (inMidroll) {    // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
		nSdkInstance.ggPM('stop', playheadPositionMidroll);&lt;br /&gt;
	}&lt;br /&gt;
	nSdkInstance.ggPM('end', playheadPositionContent);    // Indicate &amp;lt;end&amp;gt; for the content&lt;br /&gt;
};&lt;br /&gt;
window.addEventListener(&amp;quot;beforeunload&amp;quot;, function (e) {&lt;br /&gt;
	closePlayer();   // call nielsensdk with end/stop&lt;br /&gt;
});&lt;br /&gt;
window.addEventListener(&amp;quot;pagehide&amp;quot;, function (e) {	// for iOS mobile &amp;quot;pagehide&amp;quot; recommended by apple&lt;br /&gt;
	closePlayer();   // call nielsensdk with end/stop&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer or covering Safari on mobile browsers ... you may use &amp;quot;onpagehide&amp;quot; event as well).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event name !! Values to pass !!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each content/ad metadata object and after stop event when resuming '''video content''' (not after pausing and resuming an ad)&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;VOD (or ad ): || current position in seconds (integer) &amp;lt;br/&amp;gt;&lt;br /&gt;
*&amp;quot;Live: current UTC timestamp (seconds since January 1st 1970)&amp;lt;br/&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position in seconds	|| Call when ads complete playing and on pause event (when resume will be available). The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| This event has to be called once for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Playhead position as integer&lt;br /&gt;
&lt;br /&gt;
'''Note:''' 'setPlayheadPosition' has to be called every second&lt;br /&gt;
&lt;br /&gt;
==== Example Events ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' loadMetadata  |  '''Value Pass ( Object ):''' Content Metadata Object&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' loadMetadata  |  '''Value Pass  ( Object ):''' Pre-roll AD Metadata Object&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('loadMetadata', prerollMetadataObject); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' setPlayheadPosition  |  '''Value Pass ( Integer ):''' playheadPosition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' stop  |  '''Value Pass ( Integer ):''' stopPlayheadPosition &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('stop', stopPlayheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Event:''' end  |  '''Value Pass ( Integer ):''' endPlayheadPosition &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  nSdkInstance.ggPM('end', endPlayheadPosition); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  SDK Event Lifecycle ==&lt;br /&gt;
&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Examples|&lt;br /&gt;
without Ads|&lt;br /&gt;
&lt;br /&gt;
==== Event Lifecycle without ads: ====&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:even browser no ads.png]]&lt;br /&gt;
&lt;br /&gt;
==== Example without ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);  // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('end', endPlayheadPosition);  // has to be called here at the end of the content&lt;br /&gt;
// endPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|with Ads=&lt;br /&gt;
&lt;br /&gt;
==== Event Lifecycle with ads: ====&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:event browser.png|event browser.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example with ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);  // end pre-roll stream&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
  &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition);  // end mid-roll stream&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition); &lt;br /&gt;
nSdkInstance.ggPM('end', endPlayheadPosition);  // has to be called here at the end of the content&lt;br /&gt;
// endPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);  // must be fired every second with playhead starting from 0&lt;br /&gt;
&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', lastPlayheadPosition); // end post-roll stream&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('stop', stopPlayheadPosition);  // stopPlayheadPosition = lastPlayheadPosition&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* after an 'end' in case there is a new content played, there is a need to have another 'loadmetadata' again.&lt;br /&gt;
&lt;br /&gt;
* For Ad, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
* For pre-roll ads you have to call the loadMetadata event for content at the start of stream and after the preroll&lt;br /&gt;
&lt;br /&gt;
* '''For type 'content' ''': Sending a &amp;quot;loadMetadata&amp;quot; event after a &amp;quot;stop&amp;quot; event will be handled by the SDK as a &amp;quot;resume&amp;quot;, as long as the &amp;quot;assetid&amp;quot; and &amp;quot;type&amp;quot; are the same and not changed from the values before the &amp;quot;stop&amp;quot; event happened. Changing &amp;quot;assetid&amp;quot; value will lead into a new stream. Changing of &amp;quot;type&amp;quot; from &amp;quot;content&amp;quot; to &amp;quot;preroll&amp;quot; (&amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;) will lead into a new object (ad) with that content stream. Changing any other parameter (eg. &amp;quot;program&amp;quot; or &amp;quot;title&amp;quot;) for the content will not affect the reported content data (will stay as in the very first &amp;quot;content&amp;quot; metadata)&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/de/de/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click &amp;quot;Choices&amp;quot; to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen Online Measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/pl/pl/optout.html.''&lt;br /&gt;
&lt;br /&gt;
====Opt Back In====&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'debug'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
&lt;br /&gt;
====Example Production Initialization Call ====&lt;br /&gt;
Refer to the production initialization call below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;myPlayerName&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''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.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Template:Android_Privacy_and_Opt-Out&amp;diff=3879</id>
		<title>Template:Android Privacy and Opt-Out</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Template:Android_Privacy_and_Opt-Out&amp;diff=3879"/>
		<updated>2019-06-24T11:18:16Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: undo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Privacy and Opt-Out ==&lt;br /&gt;
There are two primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen Android SDK versions (&amp;lt; 5.1.1.18)&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the Android's ''Opt out of Ads Personalization'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Opt out of Ads Personalization&amp;quot;'' (&amp;quot;Limit Ad Tracking&amp;quot; for iOS) setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen Android '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen Android SDK 5.1.1.18 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the current Nielsen opt-out URL via [[userOptOutURLString()]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[userOptOutURLString()]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut()]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=java&amp;gt;appSdk.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;);  // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Legacy Opt Out example code ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
WebView webView;&lt;br /&gt;
AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_OUT = &amp;quot;nielsenappsdk://1&amp;quot;;&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_IN = &amp;quot;nielsenappsdk://0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
//  Within your app you would provide your User the option to Opt Out.&lt;br /&gt;
//  Perhaps via a toggle or button&lt;br /&gt;
//  This is separate from Limit Ad Tracking &lt;br /&gt;
&lt;br /&gt;
      let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Retrieve current Opt-Out preference ===&lt;br /&gt;
Whether the user is opted out viaOS-level Opt-out or via App-level Opt-out, the current Opt-Out status as detected by the SDK is available via the [[getOptOutStatus()]] property in the Nielsen Android SDK API,&lt;br /&gt;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/us/en/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    WebView webView;&lt;br /&gt;
    AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onCreate(@Nullable Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_optout);&lt;br /&gt;
        webView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
&lt;br /&gt;
        webView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
        webView.setWebViewClient(new WebViewClient() {&lt;br /&gt;
            @SuppressWarnings(&amp;quot;deprecation&amp;quot;)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {&lt;br /&gt;
                Toast.makeText(OptOutActivity.this, description, Toast.LENGTH_SHORT).show();&lt;br /&gt;
            }&lt;br /&gt;
            @TargetApi(android.os.Build.VERSION_CODES.M)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, WebResourceRequest req, WebResourceError rerr) {&lt;br /&gt;
                // Redirect to deprecated method, so you can use it in all SDK versions&lt;br /&gt;
                onReceivedError(view, rerr.getErrorCode(), rerr.getDescription().toString(), req.getUrl().toString());&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
        //Getting the optPut URL from eventTracker&lt;br /&gt;
        String url = appSdk.userOptOutURLString();&lt;br /&gt;
        webView.loadUrl(url);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Template:Android_Privacy_and_Opt-Out&amp;diff=3878</id>
		<title>Template:Android Privacy and Opt-Out</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Template:Android_Privacy_and_Opt-Out&amp;diff=3878"/>
		<updated>2019-06-24T11:16:58Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: priv policy link updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Privacy and Opt-Out ==&lt;br /&gt;
There are two primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen Android SDK versions (&amp;lt; 5.1.1.18)&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the Android's ''Opt out of Ads Personalization'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Opt out of Ads Personalization&amp;quot;'' (&amp;quot;Limit Ad Tracking&amp;quot; for iOS) setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen Android '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen Android SDK 5.1.1.18 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the current Nielsen opt-out URL via [[userOptOutURLString()]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[userOptOutURLString()]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut()]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=java&amp;gt;appSdk.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;);  // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Legacy Opt Out example code ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
WebView webView;&lt;br /&gt;
AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_OUT = &amp;quot;nielsenappsdk://1&amp;quot;;&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_IN = &amp;quot;nielsenappsdk://0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
//  Within your app you would provide your User the option to Opt Out.&lt;br /&gt;
//  Perhaps via a toggle or button&lt;br /&gt;
//  This is separate from Limit Ad Tracking &lt;br /&gt;
&lt;br /&gt;
      let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Retrieve current Opt-Out preference ===&lt;br /&gt;
Whether the user is opted out viaOS-level Opt-out or via App-level Opt-out, the current Opt-Out status as detected by the SDK is available via the [[getOptOutStatus()]] property in the Nielsen Android SDK API,&lt;br /&gt;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/pl/pl/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    WebView webView;&lt;br /&gt;
    AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onCreate(@Nullable Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_optout);&lt;br /&gt;
        webView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
&lt;br /&gt;
        webView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
        webView.setWebViewClient(new WebViewClient() {&lt;br /&gt;
            @SuppressWarnings(&amp;quot;deprecation&amp;quot;)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {&lt;br /&gt;
                Toast.makeText(OptOutActivity.this, description, Toast.LENGTH_SHORT).show();&lt;br /&gt;
            }&lt;br /&gt;
            @TargetApi(android.os.Build.VERSION_CODES.M)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, WebResourceRequest req, WebResourceError rerr) {&lt;br /&gt;
                // Redirect to deprecated method, so you can use it in all SDK versions&lt;br /&gt;
                onReceivedError(view, rerr.getErrorCode(), rerr.getDescription().toString(), req.getUrl().toString());&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
        //Getting the optPut URL from eventTracker&lt;br /&gt;
        String url = appSdk.userOptOutURLString();&lt;br /&gt;
        webView.loadUrl(url);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Facebook_Instant_Articles_Browser_SDK&amp;diff=2269</id>
		<title>DCR Italy Static Facebook Instant Articles Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Facebook_Instant_Articles_Browser_SDK&amp;diff=2269"/>
		<updated>2017-12-18T10:27:04Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Metadata for Reporting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable Digital Content Ratings (DCR) measurement on your Facebook Instant Articles.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
=== Add Tracking Code ===&lt;br /&gt;
DCR measurement can be added to your Instant Articles through the Analytics element:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;figure class=&amp;quot;op-tracker&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;iframe&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Add Nielsen DCR Tracking Code here --&amp;gt;&lt;br /&gt;
    &amp;lt;/iframe&amp;gt;&lt;br /&gt;
&amp;lt;/figure&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information on the Analytics element, you can refer to the [https://developers.facebook.com/docs/instant-articles/analytics/overview | Insights and Analytics in Instant Articles] section of Facebook’s Instant Article Developer Documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Nielsen DCR Tracking code below will need to be added within the &amp;lt;code&amp;gt;&amp;lt;iframe&amp;gt;&amp;lt;/code&amp;gt; of the Analytics element on each article:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
  // Static Queue Snippet&lt;br /&gt;
!function(t,n){t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i){return s=t.document,r=s.createElement(&amp;quot;script&amp;quot;),r.async=1,r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),t[n][o]=t[n][o]||{g:c||{},ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]}}}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // SDK Initialization&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nsdkvOverride: &amp;quot;501&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
  &lt;br /&gt;
  // Content Metadata &lt;br /&gt;
  var nielsenMetadata = {&lt;br /&gt;
    type: 'static', &lt;br /&gt;
    assetid: '', // *DYNAMIC METADATA*: unique ID for each article **REQUIRED**&lt;br /&gt;
    section: '', // *DYNAMIC METADATA*: section of site **REQUIRED**&lt;br /&gt;
    segC: 'Instant Articles' &lt;br /&gt;
    }; &lt;br /&gt;
    &lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Metadata ===&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. The tracking code includes the Nielsen reserved keys and placeholder values, &amp;lt;code&amp;gt;&amp;lt;metadataPlaceholder&amp;gt;&amp;lt;/code&amp;gt;, for dynamic metadata. You will need to update these values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Metadata Keys====&lt;br /&gt;
The Nielsen reserved keys are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Example Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| apid || unique ID assigned by Nielsen || &amp;lt;code&amp;gt;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| section || section of the site to be measured || &amp;lt;code&amp;gt;Entertainment&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| segC || Reserved custom segment for Instant Articles || &amp;lt;code&amp;gt;'Instant Articles'&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Metadata for Reporting====&lt;br /&gt;
You can reference the table to determine how the metadata you pass is used to define your reporting structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Reporting Level !! Key !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Brand || apid || brand is determined by assigned App ID passed during initialization&lt;br /&gt;
|-&lt;br /&gt;
| Sub-brand || apid || sub-brand is determined is determined by assigned App ID passed during initialization&lt;br /&gt;
|-&lt;br /&gt;
| Section || section || section or category of the page&lt;br /&gt;
|-&lt;br /&gt;
| Custom Segment C || segC || Custom segment C is reserved for reporting ‘Instant Articles’. The Instant Articles custom segment will be available under sub-brand and will include the total metrics for all your Instant Articles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Going Live ===&lt;br /&gt;
Once you have added the DCR Tracking Code to your Instant Articles, Nielsen will validate your implementation after which you must disable Debug logging by deleting {nol_sdkDebug: 'DEBUG'} from the initialization call. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nsdkvOverride: &amp;quot;501&amp;quot;});&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Browser_SDK&amp;diff=2002</id>
		<title>DCR Italy Static Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Browser_SDK&amp;diff=2002"/>
		<updated>2017-11-08T17:36:16Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* onPaginate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
=== Add Tracking Code ===&lt;br /&gt;
The Nielsen DCR Tracking Code must be added to each page.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
  // Static Queue Snippet&lt;br /&gt;
!function(t,n){t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i){return s=t.document,r=s.createElement(&amp;quot;script&amp;quot;),r.async=1,r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),t[n][o]=t[n][o]||{g:c||{},ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]}}}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // SDK Initialization&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
  &lt;br /&gt;
  // Content Metadata &lt;br /&gt;
  var nielsenMetadata = {&lt;br /&gt;
    type: 'static', &lt;br /&gt;
    assetid: '', // *DYNAMIC METADATA*: unique ID for each article **REQUIRED**&lt;br /&gt;
    section: '' // *DYNAMIC METADATA*: section of site **REQUIRED**&lt;br /&gt;
    }; &lt;br /&gt;
    &lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tracking Code Components ====&lt;br /&gt;
The tracking code includes&lt;br /&gt;
* Static Queue Snippet&lt;br /&gt;
* SDK Initialization&lt;br /&gt;
* Content Metadata&lt;br /&gt;
* staticstart Event&lt;br /&gt;
&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n){t[n]=t[n]||&lt;br /&gt;
{&lt;br /&gt;
  nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
      return s=t.document,&lt;br /&gt;
      r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
      r.async=1,&lt;br /&gt;
      r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),&lt;br /&gt;
      t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},t[o]}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static config file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and cached by the client-side browser(s).&lt;br /&gt;
&lt;br /&gt;
Once the static config file is downloaded, the SDK will be fully downloaded and initialized. All SDK modules are included in one file:&lt;br /&gt;
&amp;quot;nlsSDK600.bundle.min.js&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Content Metadata'''&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. The tracking code includes the Nielsen reserved keys and placeholder values.&lt;br /&gt;
&lt;br /&gt;
Pass dynamic metadata for the keys with the &amp;lt;code&amp;gt;&amp;lt;metadataPlaceholder&amp;gt;&amp;lt;/code&amp;gt; value (e.g. &amp;lt;code&amp;gt;section: ''&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''staticstart Event'''&lt;br /&gt;
&lt;br /&gt;
There is only one event call required:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter when calling 'staticstart' event . To know more about configuring metadata refer [[Bundled_SDK_-_Static#Configure_Metadata|Step 3]].&lt;br /&gt;
&lt;br /&gt;
=== Pass App ID in Initialization Call ===&lt;br /&gt;
Pass the unique App ID in the first parameter of the initialization call, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has three parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site. || &amp;lt;code&amp;gt;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || Any string value&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug: &amp;quot;debug&amp;quot; || Enables Nielsen console logging. Only required for testing || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Update &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt; with the AppID provided. Refer to the [[#Going_Live|Going Live]] section to know about updating the AppID to production after testing is completed.&lt;br /&gt;
&lt;br /&gt;
=== Configure Metadata ===&lt;br /&gt;
Map the Nielsen keys to variables so that the content metadata is dynamically updated.&lt;br /&gt;
&lt;br /&gt;
The Nielsen reserved keys are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID for each article || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of each site (e.g. section value should be first level in page URL: website.com/section). Limit to 25 unique values || dynamic || custom || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement, the properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will refire the view ping with the existing/original metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;onPaginate&amp;quot;, scrolloffset);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;23%&amp;quot;| Parameter&lt;br /&gt;
!width=&amp;quot;19%&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
| event&lt;br /&gt;
| &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| scrolloffset&lt;br /&gt;
| The &amp;lt;code&amp;gt;scrolloffset&amp;lt;/code&amp;gt; value should be the y-scroll position:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== onPaginate ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; is a slightly modified version of &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; to enable tracking of user’s focus in pages with continuous scrolling. &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event provides the same behavior as &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; keeping it local to only clients who wish to implement continuous scrolling. (Note: This event &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will not reset the page duration timer.)&lt;br /&gt;
&lt;br /&gt;
* The maximum number of static View pings allowed per session is ‘1’. This is enforced via the &amp;lt;code&amp;gt;nol_maxPingCount&amp;lt;/code&amp;gt; parameter in the tag and the cadence of impression.&lt;br /&gt;
* When an &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event is called at the end of section / a focus shift (within the same page), this filter will reset the current ping count to ‘0’ for the static View ping. This change of value will cause a new View ping when the Browser SDK receives the next &amp;lt;code&amp;gt;staticPosition&amp;lt;/code&amp;gt; event (at the section end). This sequence continues through the end of scrolling or till the close of static page session.&lt;br /&gt;
&lt;br /&gt;
[[File:StaticPageEvent35.jpg|center|link=]]&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1971</id>
		<title>International</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1971"/>
		<updated>2017-11-08T15:40:20Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: come back to previous version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|International.png|International}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;This section is under maintenance. Please contact your Nielsen representative for documentation if the guides for your country aren't listed.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Italy&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{SmallIcon|ITFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video App SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video Browser SDK (6.0.1)]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|StaticIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Static App SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK (6.0.0)]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK (6.0.1)]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1970</id>
		<title>International</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1970"/>
		<updated>2017-11-08T15:38:30Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|International.png|International}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;This section is under maintenance. Please contact your Nielsen representative for documentation if the guides for your country aren't listed.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Italy&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{SmallIcon|ITFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video App SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video Browser SDK (6.0.1)]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|StaticIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Static App SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK (6.0.1)]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1969</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1969"/>
		<updated>2017-11-08T15:31:49Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Handling JSON Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;it&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;n&amp;quot;,&lt;br /&gt;
                &amp;quot;adloadtype&amp;quot;:&amp;quot;2&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;adloadtype&amp;quot;, &amp;quot;2&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]], [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make one update to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1968</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1968"/>
		<updated>2017-11-08T15:30:12Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Handling JSON Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;it&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;adloadtype&amp;quot;:&amp;quot;2&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;adloadtype&amp;quot;, &amp;quot;2&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]], [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make one update to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1967</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1967"/>
		<updated>2017-11-08T15:29:40Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Handling JSON Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;it&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;adloadtype&amp;quot;:&amp;quot;2&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put( &amp;quot;adloadtype&amp;quot;, &amp;quot;2&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]], [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make one update to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1942</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1942"/>
		<updated>2017-11-07T16:55:44Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* SDK Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;it&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]] , [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make one update to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1941</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1941"/>
		<updated>2017-11-07T16:54:54Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Going Live */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || it&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]] , [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make one update to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1940</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1940"/>
		<updated>2017-11-07T16:51:30Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Content metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || it&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]] , [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Collection Environment''': Change the &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;'eu-cert'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;'it'&amp;lt;/code&amp;gt; to point traffic to the Nielsen production collection environment. Please DO NOT use eu-cert for your production traffic!&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1939</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1939"/>
		<updated>2017-11-07T16:50:21Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Handling JSON Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || it&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;, &lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
Custom segments (segB and segC) can be used to aggregate video and/or static content within a single Brand to receive more granular reports within a brand.&lt;br /&gt;
&lt;br /&gt;
Examples regarding usage of segments within SDK:&lt;br /&gt;
* All comedy clips and stories for a Brand rolled into a “Comedy” segment&lt;br /&gt;
* genre grouping content by Comedy vs. Drama&lt;br /&gt;
* group related Text + Video content - i.e. for a show that has a lot of - static pages associated with it&lt;br /&gt;
* packaging based on how clients sell inventory&lt;br /&gt;
* grouping related types of content either by genre, category or platform.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]] , [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Collection Environment''': Change the &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;'eu-cert'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;'it'&amp;lt;/code&amp;gt; to point traffic to the Nielsen production collection environment. Please DO NOT use eu-cert for your production traffic!&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1938</id>
		<title>DCR Italy Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_App_SDK&amp;diff=1938"/>
		<updated>2017-11-07T16:49:11Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* SDK Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
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.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Android using Android Studio.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
xCode|&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Xcode Development Environment''' &lt;br /&gt;
&amp;lt;/big&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK is compatible with Apple iOS versions 9.0 and above.&lt;br /&gt;
&lt;br /&gt;
The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': All communications between the SDK and the Census (Collection Facility) use HTTPS.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Importing Frameworks'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.&lt;br /&gt;
* UIKit.framework&lt;br /&gt;
* Foundation.framework&lt;br /&gt;
* AdSupport.framework&lt;br /&gt;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework makes use of a number of functions in this library.&lt;br /&gt;
* AVFoundation.framework&lt;br /&gt;
** This framework is mandatory for the iOS SDK version 5.1.1 to work.&lt;br /&gt;
* CoreLocation.framework (Not applicable for International (Germany))&lt;br /&gt;
* CoreMedia.framework&lt;br /&gt;
* NielsenAppApi.framework&lt;br /&gt;
* libc++.tbd (as SDK contains Objective C++ source file)&lt;br /&gt;
** Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Example'''&lt;br /&gt;
* Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.&lt;br /&gt;
* Add the code &amp;lt;code&amp;gt;-#import NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller’s header file.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).&lt;br /&gt;
* Nielsen App SDK&lt;br /&gt;
* iOS security framework&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Swift'''&amp;lt;/big&amp;gt;&lt;br /&gt;
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.&lt;br /&gt;
&lt;br /&gt;
Select File/New File/Objective-C File  &amp;lt;br /&amp;gt;&lt;br /&gt;
Xcode will prompt you to create a bridging header.&lt;br /&gt;
[[File:bridgingheader 2x.png|600px|center|link=]] &amp;lt;br /&amp;gt;&lt;br /&gt;
Once this file has been created, you need to add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;'''Using Objective-C'''&amp;lt;/big&amp;gt;&lt;br /&gt;
Add the code &lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 to the View Controller’s header file.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|Android =&lt;br /&gt;
&amp;lt;big&amp;gt;'''Configuring Android Development Environment'''&amp;lt;/big&amp;gt;'&lt;br /&gt;
*The Nielsen App SDK (located in the ''com.nielsen.app.sdk'' package) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The Nielsen App SDK 1.2 library is composed of two parts:&lt;br /&gt;
* The Java AppSdk.jar library that runs on the Android’s Dalvik Virtual Machine.&lt;br /&gt;
* The C/C++ libAppSdk.so native library that runs directly on the device’s hardware.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': App SDK 4.0.0 contains AppSDK.jar component only and does not support C/C++ libAppSdk.so components.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Ensure to unzip the Nielsen App SDK sample app and copy the ''AppSdk.jar'' into the libs/ folder on the App’s Eclipse project. Copy the ''libAppSdk.so'' file under ''libs/armeabi/'' folder into the same Eclipse project.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture; the respective ''libAppSdk.so'' can be found under the ''libs/x86/'', ''libs/mips/'', and ''libs/armeabi-7a/'' folders.&lt;br /&gt;
Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   Download the latest ''google-play-services_lib'' and include it in the App’s project in order to use the App SDK.&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
To include the Google Play library in the media player project, copy the ''google-play-services_lib'' folder into the same location as the project&lt;br /&gt;
* Access '''File &amp;gt; Import'''.&lt;br /&gt;
* Select '''Existing Android Code into Workspace''' and click '''Next'''.&lt;br /&gt;
* Click '''Browse''' and navigate to the ''google-play-services_lib'' to include it into the projects.&lt;br /&gt;
* Select the exact '''Project Build Target''' for Eclipse to use from Android SDK.&lt;br /&gt;
** Android 4.4.2, etc. OR&lt;br /&gt;
** Edit ''project.properties'' file to point to Android target version e.g. target= android-19.&lt;br /&gt;
Once the google-play-services_lib is included into the App project, include the following code under the &amp;lt;code&amp;gt;&amp;lt;application&amp;gt;&amp;lt;/code&amp;gt; node in the &amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data android:name=&amp;quot;com.google.android.gms.version&amp;quot; android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, include the ''version.xml'' file that comes with the ''google-play-services_lib'' under the res/values directory of the media player project.&lt;br /&gt;
* Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Library'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nielsen App SDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
* google-play-services_lib&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Classes/package&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient;&lt;br /&gt;
* com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;&lt;br /&gt;
* com.google.android.gms.common.ConnectionResult;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesUtil;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesRepairableException;&lt;br /&gt;
* com.google.android.gms.common.GooglePlayServicesNotAvailableException;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. When a fifth SDK instance is launched, the SDK will return “nil” from [[initWithAppInfo:delegate:]]&lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No|| Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || Client-defined || No || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''Italian Clients'''&lt;br /&gt;
* &amp;quot;it&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || it&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Yes || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
           &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample code using AVPlayer.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ViewController.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class ViewController: UIViewController, NielsenAppApiDelegate, AVPictureInPictureControllerDelegate, CLLocationManagerDelegate  {&lt;br /&gt;
    &lt;br /&gt;
    let avPlayerViewController = AVPlayerViewController()&lt;br /&gt;
    var avPlayer:AVPlayer?&lt;br /&gt;
    var nielsenAppApi: NielsenAppApi!&lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
self.nielsenAppApi = NielsenInit.createNielsenAppApi(delegate: self)&lt;br /&gt;
NSLog(&amp;quot;Nielsen SDK initialized&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NlsAppApiFactory.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NlsAppApiFactory&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
{&lt;br /&gt;
    NSDictionary *appInformation = @{&lt;br /&gt;
                                     @&amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;appname&amp;quot;: &amp;quot;app name here&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;&lt;br /&gt;
                                     };&lt;br /&gt;
    return [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:delegate];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following would be the &amp;lt;code&amp;gt;NlsAppApiFactory.h&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;Foundation/Foundation.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@class NielsenAppApi;&lt;br /&gt;
@protocol NielsenAppApiDeligate;&lt;br /&gt;
&lt;br /&gt;
@interface NlsAppApiFactory : NSObject &lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppAPI *) createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate;&lt;br /&gt;
&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &lt;br /&gt;
&lt;br /&gt;
[[AppSDK()]] is no longer a singleton object and should be initialized as below.&lt;br /&gt;
&lt;br /&gt;
'''Initialization of App SDK object through a JSON object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
       let channelInfo = [&lt;br /&gt;
            &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
        &lt;br /&gt;
        let contentMetadata = [&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
                &amp;quot;assetid&amp;quot;: &amp;quot;88675545&amp;quot;,&lt;br /&gt;
                &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&lt;br /&gt;
                &amp;quot;isfullepisode&amp;quot;:&amp;quot;No&amp;quot;,&lt;br /&gt;
                &amp;quot;program&amp;quot;:&amp;quot;Program Name&amp;quot;,&lt;br /&gt;
                &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;,&lt;br /&gt;
                &amp;quot;segB&amp;quot;:&amp;quot;CustomSegmentValueB&amp;quot;,  //optional&lt;br /&gt;
                &amp;quot;segC&amp;quot;:&amp;quot;CustomSegmentValueC&amp;quot;,  //optional&lt;br /&gt;
                &amp;quot;airdate&amp;quot;:&amp;quot;20171020 10:05:00&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary  *channelInfo = @&lt;br /&gt;
{&lt;br /&gt;
  @&amp;quot;channelname&amp;quot;:@&amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *contentMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: [NSString stringWithFormat:@&amp;quot;ProgramAssetId-%d&amp;quot;, i],&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;segB&amp;quot;: @&amp;quot;CustomSegmentValueB&amp;quot;,   //optional&lt;br /&gt;
  @&amp;quot;segC&amp;quot;: @&amp;quot;CustomSegmentValueC&amp;quot;,  //optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject channelInfo = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;channelname&amp;quot;,&amp;quot;My Channel Name 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
Configure metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (40 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|}&lt;br /&gt;
Custom segments (segB and segC) can be used to aggregate video and/or static content within a single Brand to receive more granular reports within a brand.&lt;br /&gt;
&lt;br /&gt;
Examples regarding usage of segments within SDK:&lt;br /&gt;
* All comedy clips and stories for a Brand rolled into a “Comedy” segment&lt;br /&gt;
* genre grouping content by Comedy vs. Drama&lt;br /&gt;
* group related Text + Video content - i.e. for a show that has a lot of - static pages associated with it&lt;br /&gt;
* packaging based on how clients sell inventory&lt;br /&gt;
* grouping related types of content either by genre, category or platform.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter playheadPosition: position];&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;[nielsenMeter end];&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
=== Life cycle of SDK instance ===&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# '''Initial state''' – The SDK is not initialized and hence, not ready to process playing information. Once the SDK is moved out of this state, it needs instantiation of the new SDK instance in order to get the instance in the '''Initial state'''.&lt;br /&gt;
# '''Idle state''' – The SDK is initialized and is ready to process playing information. Once Initialized, the SDK instance is not processing any data, but is listening for the play event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. [[DCR_Video_APP_SDK#play|play]] and [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[DCR_Video_APP_SDK#stop|stop]] – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## [[DCR_Video_APP_SDK#end|end]] – SDK instance exits from Processing state when this API is called.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. SDK instance moves into this state in one of the following scenarios.&lt;br /&gt;
## Initialization fails&lt;br /&gt;
## &amp;lt;code&amp;gt;appDisableApi&amp;lt;/code&amp;gt; is called&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (assign) BOOL appDisableApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[DCR_Video_APP_SDK#play|play]] , [[DCR_Video_APP_SDK#loadMetadata|loadMetadata]] and  [[DCR_Video_APP_SDK#playheadPosition|playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:(JSONObject channelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void)loadMetadata:(id)contentMetadata;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void) playheadPosition: (long long) playheadPos&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sending playheadposition for content ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
AVPlayer *player;&lt;br /&gt;
CMTime curTime=[player currentTime];&lt;br /&gt;
int pos = CMTimeGetSeconds(curTime);&lt;br /&gt;
[nAppApiObject playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        //Monitor the Playhead position of the AVPlayer&lt;br /&gt;
        let timeInterval: CMTime = CMTimeMakeWithSeconds(1.0,10)&lt;br /&gt;
        self.avPlayerViewController.player?.addPeriodicTimeObserver(forInterval: timeInterval, queue: DispatchQueue.main) {(elapsedTime: CMTime) -&amp;gt; Void in&lt;br /&gt;
            if self.avPlayerViewController.player!.currentItem?.status == .readyToPlay {&lt;br /&gt;
                let time : Float64 = self.avPlayerViewController.player!.currentTime().seconds;&lt;br /&gt;
                let pos = Int64(time);&lt;br /&gt;
                NSLog(&amp;quot;New Elapse Time = \(time)&amp;quot;);&lt;br /&gt;
                self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void setPlayheadPosition(long position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;– (void) stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void) end;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
&lt;br /&gt;
iOS| &lt;br /&gt;
== iOS Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL for the Nielsen Privacy web page should be retrieved from the optOutURL property of the SDK object &amp;lt;code&amp;gt;optOutURL&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL in the optOutURL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the [[optOutStatus]] method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NielsenAppApi nAppApiObject;&lt;br /&gt;
@property(strong) UIWebView *optOutView;&lt;br /&gt;
&lt;br /&gt;
// create WebView and set self as delegate&lt;br /&gt;
self.optOutView=[[UIWebViewalloc]initWithFrame:self.view.bounds];&lt;br /&gt;
&lt;br /&gt;
self.optOutView.scalesPageToFit = yes;&lt;br /&gt;
// get Nielsen defined web address and load the page&lt;br /&gt;
NSString *webAddress = nAppApiObject.optOutURL;&lt;br /&gt;
&lt;br /&gt;
if(webAddress == nil)&lt;br /&gt;
    { // Handle it gracefully and retry later}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    [optOutView loadRequest:[NSURLRequest requestWithURL:webAddress]];&lt;br /&gt;
    // show the view to the user&lt;br /&gt;
    [self.view addSubview:optOutView];&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
*URL to this web page should be called from SDK and opened in 'WebView' / External browser.&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle this case and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status, use the [[optOutStatus]] property from Nielsen's SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@property (readonly) BOOL optOutStatus;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*App should provide a UI control like 'close' or 'back' button to close the 'WebView' / External browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users can opt out or opt back into Nielsen Measurement. Opt-Out feature relies on iOS' system setting – &amp;quot;Limit Ad Tracking&amp;quot;. The setting can be accessed in the Settings application on any iOS device: '''Settings → Privacy → Advertising → Limit Ad Tracking'''.&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen online measurement research when the &amp;quot;Limit Ad Tracking&amp;quot; setting is enabled.&lt;br /&gt;
&lt;br /&gt;
[[File:Opt-Out iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &lt;br /&gt;
== Android Opt-Out Implementation ==&lt;br /&gt;
To opt out, users must have access to &amp;quot;[https://priv-policy.imrworldwide.com/priv/mobile/it/it/optout.html About Nielsen Measurement]&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
&lt;br /&gt;
Include '''About Nielsen Measurement and Your Choices''' link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
*URL to this web page should be called from SDK by invoking &amp;lt;code&amp;gt;userOptOutURLString()&amp;lt;/code&amp;gt; and opened in 'WebView' / External browser.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public String userOptOutURLString()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
*To retrieve the current Opt-Out status of a device, use the &amp;lt;code&amp;gt; getOptOutStatus() &amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public boolean getOptOutStatus()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying Opt-Out in a WebView ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
optOutUrl = mAppSdk.userOptOutURLString();&lt;br /&gt;
if(optOutUrl !=null)&lt;br /&gt;
{&lt;br /&gt;
   mWebView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
   mWebView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
   mWebView.getSettings().setBuiltInZoomControls(true);&lt;br /&gt;
   mWebView.getSettings().setDisplayZoomControls(false);&lt;br /&gt;
   mWebView.getSettings().setLoadWithOverviewMode(true);&lt;br /&gt;
   mWebView.getSettings().setUseWideViewPort(true);&lt;br /&gt;
   mWebView.setWebViewClient(new MonitorWebView());&lt;br /&gt;
   mWebView.setWebChromeClient(new WebChromeClient());&lt;br /&gt;
   mWebView.loadUrl(optOutUrl);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
   //Handle it gracefully and Retry later&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The app must provide access to &amp;quot;About Nielsen Measurement&amp;quot; page for the users. Include &amp;quot;About Nielsen Measurement&amp;quot; and Your Choices link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
[[File:Privacy policy iOS.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When ‘WebView’ / External browser is closed, do not pass the status returned from ‘WebView’ / External browser to the SDK within the app, as the new Opt-Out page will not return any response.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' App SDK manages the user’s choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting from SDK version 5.1.1.18:&lt;br /&gt;
*SDK will be sending the data pings to census even though SDK is opted out (In earlier releases all the traffic from SDK to census will be ceased). However, all the outgoing pings will have the parameter uoo=true using which backend can ignore this data.&lt;br /&gt;
*Current Opt-Out page is now updated to have no hyperlinks for Opt-Out / Opt-In operations. SDK Opt-Out has to be done via&lt;br /&gt;
'''Google Settings → Ads → Opt out of Ads Personalization'''.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For Amazon devices, see [[#Opt-Out Implementation for Amazon Devices|Opt-Out Implementation for Amazon Devices]] below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:andr-ads.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out Implementation for Amazon Devices ==&lt;br /&gt;
Amazon device users can opt out or opt back into Nielsen Measurement, any time using the device’s setting – 'Limit Ad Tracking' (Interest-based ads).&lt;br /&gt;
&lt;br /&gt;
User is opted out of Nielsen Online Measurement when ‘Limit Ad Tracking’ is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''For devices running on Fire OS 5.1 and above, retrieve the Ad tracking value.'''&lt;br /&gt;
=== Retrieving Ad tracking Value ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ContentResolver cr = getContentResolver();&lt;br /&gt;
int limitAdTracking = Secure.getInt(cr, &amp;quot;limit_ad_tracking&amp;quot;, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;0&amp;quot; if enabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;1&amp;quot; if disabled&lt;br /&gt;
*Returns limit_ad_tracking value &amp;quot;2&amp;quot; if ad tracking is not supported (below Fire OS 5.1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Google Play Services are not needed to retrieve ad tracking state on Amazon devices. Limit Ad Tracking can be accessed through '''Settings → Apps &amp;amp; Games → Advertising ID'''.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Collection Environment''': Change the &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;'eu-cert'&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;'it'&amp;lt;/code&amp;gt; to point traffic to the Nielsen production collection environment. Please DO NOT use eu-cert for your production traffic!&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;iOS Example:&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit: NSObject {&lt;br /&gt;
    class func createNielsenAppApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
    let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1859</id>
		<title>International</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1859"/>
		<updated>2017-10-27T09:10:00Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: Undo revision 1855 by MagdalenaKostulska (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|International.png|International}}&lt;br /&gt;
&lt;br /&gt;
This section is under maintenance. Please contact your Nielsen representative for documentation.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1855</id>
		<title>International</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=International&amp;diff=1855"/>
		<updated>2017-10-26T15:51:37Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|International.png|International}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 42%;&amp;quot; | General Reference&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! General Reference&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;1&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Custom Variables Extension ]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Country&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|DEFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Audio &amp;amp; Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Audio &amp;amp; Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Audio &amp;amp; Video Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;5&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|ITFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{OSIcon|StaticIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK (6.0.0)]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Italy Static Browser SDK (6.0.1)]]'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;5&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|CZFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Czech Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Czech Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Czech Video Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|StaticIcon.png}}&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Czech Static Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;5&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|PLFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Poland Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Poland Audio &amp;amp; Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Poland Audio &amp;amp; Video Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;5&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|THFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR Thailand Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR Thailand Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Thailand Video Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;5&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|INFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR India Video iOS SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR India Video Android SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR India Video Browser SDK]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1854</id>
		<title>DCR Italy Video Browser SDK (6.0.1)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1854"/>
		<updated>2017-10-26T12:37:47Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Going Live */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show how to integrate the Nielsen Software Development Kit (SDK) to enable Digital Content Ratings (DCR) video measurement on browser players.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
* Add Static Queue Snippet&lt;br /&gt;
* Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Add Static Queue Snippet ===&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Create SDK Instance ===&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
       clientid: &amp;quot;XX-XXXXXX&amp;quot;,  // eg. &amp;quot;it-123456&amp;quot;&lt;br /&gt;
       vcid: &amp;quot;cXX&amp;quot;,            // eg. &amp;quot;c01&amp;quot;&lt;br /&gt;
       nol_sdkDebug: &amp;quot;debug&amp;quot;   // should be deleted when going live&lt;br /&gt;
    }&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site || &amp;lt;code&amp;gt;&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;lt;code&amp;gt;&amp;quot;any string value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value has to be passed in 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| vcid || VCID value has to be passed 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing. in 3rd parameter object || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {clientid: &amp;quot;it-123456&amp;quot;, vcid: &amp;quot;c01&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create Metadata Objects ==&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
* content: identify video&lt;br /&gt;
* ad: identify each ad&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*video – &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID assigned to content (max. 40 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. The estimated content length has to be passed for live content. || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot; || &amp;lt;code&amp;gt;YYYYMMDD hh:mm:ss&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; - full episode&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt; - non-full episode&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Linear&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Dynamic&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| subbrand || subbrand/VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| mediaURL || URL location of the content being streamed (max. 254 characters) || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
|| hasAds || Whether the content is ad supported ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; - No Ads&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Ad Supported&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Unknown (default)&lt;br /&gt;
|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//create content object&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           &amp;quot;content&amp;quot;,&lt;br /&gt;
  assetid:        &amp;quot;VID123-123456&amp;quot;,&lt;br /&gt;
  program:        &amp;quot;program name&amp;quot;,&lt;br /&gt;
  title:          &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  length:         &amp;quot;1020&amp;quot;,&lt;br /&gt;
  airdate:        &amp;quot;19700101 00:00:00&amp;quot;,&lt;br /&gt;
  isfullepisode:  &amp;quot;y&amp;quot;,&lt;br /&gt;
  adloadtype:     &amp;quot;2&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': all parameters should be provided as strings (also length)&lt;br /&gt;
&lt;br /&gt;
'''Note''': for Audiweb clients there is no need to use &amp;quot;mediaURL&amp;quot;, &amp;quot;segB&amp;quot;, &amp;quot;segC&amp;quot;, &amp;quot;crossId1&amp;quot;, &amp;quot;crossId2&amp;quot; and &amp;quot;hasAds&amp;quot;. These parameters can be left out completely from structure. They are optional and not mandatory (and out of current reporting too).&lt;br /&gt;
&lt;br /&gt;
=== Ad Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... you may ignore this paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || uniqueID assigned to ad || &amp;lt;code&amp;gt;custom&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create ad object&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: &amp;quot;AD-1&amp;quot;,&lt;br /&gt;
  type:    &amp;quot;preroll&amp;quot;&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''URL Character Limit:''' There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers.&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is &amp;lt;code&amp;gt;ggPM()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM('event', parameter, ...);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Number !! Values to pass !! Event Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'3'&amp;lt;/code&amp;gt; || content/ad metadata object || load content metadata || Load metadata event for content. Has to be called at the very first beginning of each stream.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'5'&amp;lt;/code&amp;gt; || playhead position || content play || Call when content or ads start playing or resumes from pause. &lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'6'&amp;lt;/code&amp;gt; || playhead position || pause || Call when content or ads is pausing. Use Event 5 to resume ...&lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt; || playhead position || stop || Call when ads complete playing and at the very end of the stream. The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'8'&amp;lt;/code&amp;gt; || playhead position from, playhead position to || seek || Call when scrubbing forward or backward with playhead position 'from' and 'to'&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt; || content/ad metadata object || load ad metadata || Call at the beginning of each ad, don’t use ‘play’ (event 5) if event 15 is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; || playhead position || playhead position || '''VOD''': current position in seconds. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
Note: has to be called on a secondly basis.&lt;br /&gt;
For each ad the playheads starts with 0 (no Live unix timestamp for ads)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt; || playhead position || end || This event has to be called '''once''' for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Lifecycle ===&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... please see 2nd example how to use without ads!&lt;br /&gt;
&lt;br /&gt;
==== example '''with''' ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// Preroll&lt;br /&gt;
nSdkInstance.ggPM('15', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Midroll&lt;br /&gt;
nSdkInstance.ggPM('15', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
nSdkInstance.ggPM('15', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example '''without''' ads:====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note''': if there are ads played in stream simply use a pause (event 6) when ads start playing and a play (event 5) when content start playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': Event &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling event &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when buffering occurs you have to send a event 6 (pause) and after buffering finished a 5 (play).&lt;br /&gt;
&lt;br /&gt;
'''Note''': For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
'''Note''': When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Pause'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; is used for handling pause. To indicate pause, stop passing the playhead position to the SDK and send Event 6 with playhead once. When content resumes, begin sending the playhead again with the correct playhead value. Also if buffering occurs for more than 1 second you may use Event 6 (pause) to indicate that.&lt;br /&gt;
e.g. pause at 1m2s and resume after a couple of seconds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('6', 62); // now send nothing to SDK until player resumes (automatically because of buffering ends or user unpauses/resumes play&lt;br /&gt;
nSdkInstance.ggPM('49', 63);&lt;br /&gt;
nSdkInstance.ggPM('49', 64);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Seek'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt; is used for handling forward/backward seek. To indicate seek, send Event 8 with 'from' and 'to' playhead.&lt;br /&gt;
e.g. seek from 1m2s to 2m0s:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('8', 62,120);&lt;br /&gt;
nSdkInstance.ggPM('49', 120);&lt;br /&gt;
nSdkInstance.ggPM('49', 121);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Interruption Scenarios'''&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate 'stop' for the ad&lt;br /&gt;
  if (insideMidroll) {&lt;br /&gt;
    nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // Indicate 'end' for the content and 'stop' for the stream&lt;br /&gt;
  nSdkInstance.ggPM('57', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.''&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1853</id>
		<title>DCR Italy Video Browser SDK (6.0.1)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1853"/>
		<updated>2017-10-26T12:36:53Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Ad Object */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show how to integrate the Nielsen Software Development Kit (SDK) to enable Digital Content Ratings (DCR) video measurement on browser players.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
* Add Static Queue Snippet&lt;br /&gt;
* Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Add Static Queue Snippet ===&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Create SDK Instance ===&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
       clientid: &amp;quot;XX-XXXXXX&amp;quot;,  // eg. &amp;quot;it-123456&amp;quot;&lt;br /&gt;
       vcid: &amp;quot;cXX&amp;quot;,            // eg. &amp;quot;c01&amp;quot;&lt;br /&gt;
       nol_sdkDebug: &amp;quot;debug&amp;quot;   // should be deleted when going live&lt;br /&gt;
    }&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site || &amp;lt;code&amp;gt;&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;lt;code&amp;gt;&amp;quot;any string value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value has to be passed in 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| vcid || VCID value has to be passed 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing. in 3rd parameter object || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {clientid: &amp;quot;it-123456&amp;quot;, vcid: &amp;quot;c01&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create Metadata Objects ==&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
* content: identify video&lt;br /&gt;
* ad: identify each ad&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*video – &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID assigned to content (max. 40 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. The estimated content length has to be passed for live content. || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot; || &amp;lt;code&amp;gt;YYYYMMDD hh:mm:ss&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; - full episode&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt; - non-full episode&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Linear&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Dynamic&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| subbrand || subbrand/VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| mediaURL || URL location of the content being streamed (max. 254 characters) || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
|| hasAds || Whether the content is ad supported ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; - No Ads&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Ad Supported&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Unknown (default)&lt;br /&gt;
|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//create content object&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           &amp;quot;content&amp;quot;,&lt;br /&gt;
  assetid:        &amp;quot;VID123-123456&amp;quot;,&lt;br /&gt;
  program:        &amp;quot;program name&amp;quot;,&lt;br /&gt;
  title:          &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  length:         &amp;quot;1020&amp;quot;,&lt;br /&gt;
  airdate:        &amp;quot;19700101 00:00:00&amp;quot;,&lt;br /&gt;
  isfullepisode:  &amp;quot;y&amp;quot;,&lt;br /&gt;
  adloadtype:     &amp;quot;2&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': all parameters should be provided as strings (also length)&lt;br /&gt;
&lt;br /&gt;
'''Note''': for Audiweb clients there is no need to use &amp;quot;mediaURL&amp;quot;, &amp;quot;segB&amp;quot;, &amp;quot;segC&amp;quot;, &amp;quot;crossId1&amp;quot;, &amp;quot;crossId2&amp;quot; and &amp;quot;hasAds&amp;quot;. These parameters can be left out completely from structure. They are optional and not mandatory (and out of current reporting too).&lt;br /&gt;
&lt;br /&gt;
=== Ad Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... you may ignore this paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || uniqueID assigned to ad || &amp;lt;code&amp;gt;custom&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create ad object&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: &amp;quot;AD-1&amp;quot;,&lt;br /&gt;
  type:    &amp;quot;preroll&amp;quot;&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''URL Character Limit:''' There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers.&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is &amp;lt;code&amp;gt;ggPM()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM('event', parameter, ...);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Number !! Values to pass !! Event Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'3'&amp;lt;/code&amp;gt; || content/ad metadata object || load content metadata || Load metadata event for content. Has to be called at the very first beginning of each stream.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'5'&amp;lt;/code&amp;gt; || playhead position || content play || Call when content or ads start playing or resumes from pause. &lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'6'&amp;lt;/code&amp;gt; || playhead position || pause || Call when content or ads is pausing. Use Event 5 to resume ...&lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt; || playhead position || stop || Call when ads complete playing and at the very end of the stream. The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'8'&amp;lt;/code&amp;gt; || playhead position from, playhead position to || seek || Call when scrubbing forward or backward with playhead position 'from' and 'to'&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt; || content/ad metadata object || load ad metadata || Call at the beginning of each ad, don’t use ‘play’ (event 5) if event 15 is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; || playhead position || playhead position || '''VOD''': current position in seconds. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
Note: has to be called on a secondly basis.&lt;br /&gt;
For each ad the playheads starts with 0 (no Live unix timestamp for ads)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt; || playhead position || end || This event has to be called '''once''' for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Lifecycle ===&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... please see 2nd example how to use without ads!&lt;br /&gt;
&lt;br /&gt;
==== example '''with''' ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// Preroll&lt;br /&gt;
nSdkInstance.ggPM('15', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Midroll&lt;br /&gt;
nSdkInstance.ggPM('15', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
nSdkInstance.ggPM('15', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example '''without''' ads:====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note''': if there are ads played in stream simply use a pause (event 6) when ads start playing and a play (event 5) when content start playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': Event &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling event &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when buffering occurs you have to send a event 6 (pause) and after buffering finished a 5 (play).&lt;br /&gt;
&lt;br /&gt;
'''Note''': For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
'''Note''': When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Pause'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; is used for handling pause. To indicate pause, stop passing the playhead position to the SDK and send Event 6 with playhead once. When content resumes, begin sending the playhead again with the correct playhead value. Also if buffering occurs for more than 1 second you may use Event 6 (pause) to indicate that.&lt;br /&gt;
e.g. pause at 1m2s and resume after a couple of seconds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('6', 62); // now send nothing to SDK until player resumes (automatically because of buffering ends or user unpauses/resumes play&lt;br /&gt;
nSdkInstance.ggPM('49', 63);&lt;br /&gt;
nSdkInstance.ggPM('49', 64);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Seek'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt; is used for handling forward/backward seek. To indicate seek, send Event 8 with 'from' and 'to' playhead.&lt;br /&gt;
e.g. seek from 1m2s to 2m0s:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('8', 62,120);&lt;br /&gt;
nSdkInstance.ggPM('49', 120);&lt;br /&gt;
nSdkInstance.ggPM('49', 121);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Interruption Scenarios'''&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate 'stop' for the ad&lt;br /&gt;
  if (insideMidroll) {&lt;br /&gt;
    nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // Indicate 'end' for the content and 'stop' for the stream&lt;br /&gt;
  nSdkInstance.ggPM('57', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.''&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1852</id>
		<title>DCR Italy Video Browser SDK (6.0.1)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1852"/>
		<updated>2017-10-26T12:36:13Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Content Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show how to integrate the Nielsen Software Development Kit (SDK) to enable Digital Content Ratings (DCR) video measurement on browser players.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
* Add Static Queue Snippet&lt;br /&gt;
* Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Add Static Queue Snippet ===&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Create SDK Instance ===&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
       clientid: &amp;quot;XX-XXXXXX&amp;quot;,  // eg. &amp;quot;it-123456&amp;quot;&lt;br /&gt;
       vcid: &amp;quot;cXX&amp;quot;,            // eg. &amp;quot;c01&amp;quot;&lt;br /&gt;
       nol_sdkDebug: &amp;quot;debug&amp;quot;   // should be deleted when going live&lt;br /&gt;
    }&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site || &amp;lt;code&amp;gt;&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;lt;code&amp;gt;&amp;quot;any string value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value has to be passed in 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| vcid || VCID value has to be passed 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing. in 3rd parameter object || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {clientid: &amp;quot;it-123456&amp;quot;, vcid: &amp;quot;c01&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create Metadata Objects ==&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
* content: identify video&lt;br /&gt;
* ad: identify each ad&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*video – &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID assigned to content (max. 40 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. The estimated content length has to be passed for live content. || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot; || &amp;lt;code&amp;gt;YYYYMMDD hh:mm:ss&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; - full episode&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt; - non-full episode&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Linear&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Dynamic&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| subbrand || subbrand/VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| mediaURL || URL location of the content being streamed (max. 254 characters) || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
|| hasAds || Whether the content is ad supported ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; - No Ads&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Ad Supported&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Unknown (default)&lt;br /&gt;
|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//create content object&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           &amp;quot;content&amp;quot;,&lt;br /&gt;
  assetid:        &amp;quot;VID123-123456&amp;quot;,&lt;br /&gt;
  program:        &amp;quot;program name&amp;quot;,&lt;br /&gt;
  title:          &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  length:         &amp;quot;1020&amp;quot;,&lt;br /&gt;
  airdate:        &amp;quot;19700101 00:00:00&amp;quot;,&lt;br /&gt;
  isfullepisode:  &amp;quot;y&amp;quot;,&lt;br /&gt;
  adloadtype:     &amp;quot;2&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': all parameters should be provided as strings (also length)&lt;br /&gt;
&lt;br /&gt;
'''Note''': for Audiweb clients there is no need to use &amp;quot;mediaURL&amp;quot;, &amp;quot;segB&amp;quot;, &amp;quot;segC&amp;quot;, &amp;quot;crossId1&amp;quot;, &amp;quot;crossId2&amp;quot; and &amp;quot;hasAds&amp;quot;. These parameters can be left out completely from structure. They are optional and not mandatory (and out of current reporting too).&lt;br /&gt;
&lt;br /&gt;
=== Ad Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... you may ignore this paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || uniqueID assigned to ad || &amp;lt;code&amp;gt;custom&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create ad object&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''URL Character Limit:''' There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers.&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is &amp;lt;code&amp;gt;ggPM()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM('event', parameter, ...);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Number !! Values to pass !! Event Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'3'&amp;lt;/code&amp;gt; || content/ad metadata object || load content metadata || Load metadata event for content. Has to be called at the very first beginning of each stream.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'5'&amp;lt;/code&amp;gt; || playhead position || content play || Call when content or ads start playing or resumes from pause. &lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'6'&amp;lt;/code&amp;gt; || playhead position || pause || Call when content or ads is pausing. Use Event 5 to resume ...&lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt; || playhead position || stop || Call when ads complete playing and at the very end of the stream. The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'8'&amp;lt;/code&amp;gt; || playhead position from, playhead position to || seek || Call when scrubbing forward or backward with playhead position 'from' and 'to'&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt; || content/ad metadata object || load ad metadata || Call at the beginning of each ad, don’t use ‘play’ (event 5) if event 15 is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; || playhead position || playhead position || '''VOD''': current position in seconds. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
Note: has to be called on a secondly basis.&lt;br /&gt;
For each ad the playheads starts with 0 (no Live unix timestamp for ads)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt; || playhead position || end || This event has to be called '''once''' for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Lifecycle ===&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... please see 2nd example how to use without ads!&lt;br /&gt;
&lt;br /&gt;
==== example '''with''' ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// Preroll&lt;br /&gt;
nSdkInstance.ggPM('15', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Midroll&lt;br /&gt;
nSdkInstance.ggPM('15', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
nSdkInstance.ggPM('15', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example '''without''' ads:====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note''': if there are ads played in stream simply use a pause (event 6) when ads start playing and a play (event 5) when content start playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': Event &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling event &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when buffering occurs you have to send a event 6 (pause) and after buffering finished a 5 (play).&lt;br /&gt;
&lt;br /&gt;
'''Note''': For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
'''Note''': When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Pause'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; is used for handling pause. To indicate pause, stop passing the playhead position to the SDK and send Event 6 with playhead once. When content resumes, begin sending the playhead again with the correct playhead value. Also if buffering occurs for more than 1 second you may use Event 6 (pause) to indicate that.&lt;br /&gt;
e.g. pause at 1m2s and resume after a couple of seconds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('6', 62); // now send nothing to SDK until player resumes (automatically because of buffering ends or user unpauses/resumes play&lt;br /&gt;
nSdkInstance.ggPM('49', 63);&lt;br /&gt;
nSdkInstance.ggPM('49', 64);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Seek'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt; is used for handling forward/backward seek. To indicate seek, send Event 8 with 'from' and 'to' playhead.&lt;br /&gt;
e.g. seek from 1m2s to 2m0s:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('8', 62,120);&lt;br /&gt;
nSdkInstance.ggPM('49', 120);&lt;br /&gt;
nSdkInstance.ggPM('49', 121);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Interruption Scenarios'''&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate 'stop' for the ad&lt;br /&gt;
  if (insideMidroll) {&lt;br /&gt;
    nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // Indicate 'end' for the content and 'stop' for the stream&lt;br /&gt;
  nSdkInstance.ggPM('57', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.''&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1851</id>
		<title>DCR Italy Video Browser SDK (6.0.1)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1851"/>
		<updated>2017-10-26T12:33:40Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Create SDK Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show how to integrate the Nielsen Software Development Kit (SDK) to enable Digital Content Ratings (DCR) video measurement on browser players.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
* Add Static Queue Snippet&lt;br /&gt;
* Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Add Static Queue Snippet ===&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Create SDK Instance ===&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
       clientid: &amp;quot;XX-XXXXXX&amp;quot;,  // eg. &amp;quot;it-123456&amp;quot;&lt;br /&gt;
       vcid: &amp;quot;cXX&amp;quot;,            // eg. &amp;quot;c01&amp;quot;&lt;br /&gt;
       nol_sdkDebug: &amp;quot;debug&amp;quot;   // should be deleted when going live&lt;br /&gt;
    }&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site || &amp;lt;code&amp;gt;&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;lt;code&amp;gt;&amp;quot;any string value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value has to be passed in 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| vcid || VCID value has to be passed 3rd parameter object || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing. in 3rd parameter object || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {clientid: &amp;quot;it-123456&amp;quot;, vcid: &amp;quot;c01&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create Metadata Objects ==&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
* content: identify video&lt;br /&gt;
* ad: identify each ad&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*video – &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID assigned to content (max. 40 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (max. 254 characters) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. The estimated content length has to be passed for live content. || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot; || &amp;lt;code&amp;gt;YYYYMMDD hh:mm:ss&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; - full episode&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt; - non-full episode&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Linear&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Dynamic&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| subbrand || subbrand/VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| mediaURL || URL location of the content being streamed (max. 254 characters) || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
|| hasAds || Whether the content is ad supported ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; - No Ads&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Ad Supported&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Unknown (default)&lt;br /&gt;
|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//create content object&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         '1020',&lt;br /&gt;
  airdate:        '19700101 00:00:00',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': all parameters should be provided as strings (also length)&lt;br /&gt;
&lt;br /&gt;
'''Note''': for Audiweb clients there is no need to use 'mediaURL', 'segB', 'segC', 'crossId1', 'crossId2' and 'hasAds'. These parameters can be left out completely from structure. They are optional and not mandatory (and out of current reporting too).&lt;br /&gt;
&lt;br /&gt;
=== Ad Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... you may ignore this paragraph&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || uniqueID assigned to ad || &amp;lt;code&amp;gt;custom&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create ad object&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''URL Character Limit:''' There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers.&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is &amp;lt;code&amp;gt;ggPM()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM('event', parameter, ...);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Number !! Values to pass !! Event Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'3'&amp;lt;/code&amp;gt; || content/ad metadata object || load content metadata || Load metadata event for content. Has to be called at the very first beginning of each stream.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'5'&amp;lt;/code&amp;gt; || playhead position || content play || Call when content or ads start playing or resumes from pause. &lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'6'&amp;lt;/code&amp;gt; || playhead position || pause || Call when content or ads is pausing. Use Event 5 to resume ...&lt;br /&gt;
'''VOD''' (or ad): The playhead position must be passed. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt; || playhead position || stop || Call when ads complete playing and at the very end of the stream. The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'8'&amp;lt;/code&amp;gt; || playhead position from, playhead position to || seek || Call when scrubbing forward or backward with playhead position 'from' and 'to'&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt; || content/ad metadata object || load ad metadata || Call at the beginning of each ad, don’t use ‘play’ (event 5) if event 15 is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; || playhead position || playhead position || '''VOD''': current position in seconds. &lt;br /&gt;
'''Live''': current unix timestamp (seconds since January 1st 1970).&lt;br /&gt;
Note: has to be called on a secondly basis.&lt;br /&gt;
For each ad the playheads starts with 0 (no Live unix timestamp for ads)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt; || playhead position || end || This event has to be called '''once''' for the current video asset at the end of the playback.&lt;br /&gt;
At the end of the content stream, if the user switches to another piece of content or when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Lifecycle ===&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
'''Attention:''' for Audiweb there is no need to tag ads in video stream ... please see 2nd example how to use without ads!&lt;br /&gt;
&lt;br /&gt;
==== example '''with''' ads: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream (even if 1st asset is preroll)&lt;br /&gt;
 &lt;br /&gt;
// Preroll&lt;br /&gt;
nSdkInstance.ggPM('15', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 for the first segment (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Midroll&lt;br /&gt;
nSdkInstance.ggPM('15', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from where it left off before mid-roll (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
nSdkInstance.ggPM('15', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // must be fired every second with playhead starting from 0&lt;br /&gt;
... /*** pass playhead every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example '''without''' ads:====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject); // must be called as start of stream&lt;br /&gt;
&lt;br /&gt;
// Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // must be fired every second with playhead starting from 0 (or with seconds since 1970-01-01 00:00:00 in case of livestream)&lt;br /&gt;
... /*** pass playheads every second ***/&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);  // pause is also needed for legacy reasons before event 57&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);  // has to be called here at the end of the content only once&lt;br /&gt;
 &lt;br /&gt;
// End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition); // must be called as indicator for end-of-stream&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note''': if there are ads played in stream simply use a pause (event 6) when ads start playing and a play (event 5) when content start playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': Event &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling event &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when buffering occurs you have to send a event 6 (pause) and after buffering finished a 5 (play).&lt;br /&gt;
&lt;br /&gt;
'''Note''': For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
'''Note''': When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Pause'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; is used for handling pause. To indicate pause, stop passing the playhead position to the SDK and send Event 6 with playhead once. When content resumes, begin sending the playhead again with the correct playhead value. Also if buffering occurs for more than 1 second you may use Event 6 (pause) to indicate that.&lt;br /&gt;
e.g. pause at 1m2s and resume after a couple of seconds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('6', 62); // now send nothing to SDK until player resumes (automatically because of buffering ends or user unpauses/resumes play&lt;br /&gt;
nSdkInstance.ggPM('49', 63);&lt;br /&gt;
nSdkInstance.ggPM('49', 64);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Handling Seek'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt; is used for handling forward/backward seek. To indicate seek, send Event 8 with 'from' and 'to' playhead.&lt;br /&gt;
e.g. seek from 1m2s to 2m0s:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
nSdkInstance.ggPM('49', 61);&lt;br /&gt;
nSdkInstance.ggPM('49', 62);&lt;br /&gt;
nSdkInstance.ggPM('8', 62,120);&lt;br /&gt;
nSdkInstance.ggPM('49', 120);&lt;br /&gt;
nSdkInstance.ggPM('49', 121);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Interruption Scenarios'''&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate 'stop' for the ad&lt;br /&gt;
  if (insideMidroll) {&lt;br /&gt;
    nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  // Indicate 'end' for the content and 'stop' for the stream&lt;br /&gt;
  nSdkInstance.ggPM('57', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at https://priv-policy.imrworldwide.com/priv/browser/it/it/optout.html.''&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1850</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1850"/>
		<updated>2017-10-26T12:32:04Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Content Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
apid: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Static Queue Snippet ===&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
==== Initialization API Call ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example SDK Initialization ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;, {clientid: &amp;quot;it-123456&amp;quot;, vcid: &amp;quot;c01&amp;quot;, nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds (86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Content Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Call Nielsen APIs ====&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Opt Back In ===&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
=== Going Live ===&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1849</id>
		<title>Digital Pre-Certification Checklist Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1849"/>
		<updated>2017-10-26T10:42:56Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* loadMetadata() - Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklist - VOD with Ads ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an APID&lt;br /&gt;
** informed you of our Opt-Out requirement to be included in your Privacy Policy section of your site&lt;br /&gt;
** informed you to add the Static Queue Snippit on each page you wish to enable video measurement &lt;br /&gt;
** informed you that the apid, 'instanceName', and ‘nol_sdkDebug’ : ‘DEBUG’ should be present in the SDK initialization&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing on page load, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || &amp;lt;code&amp;gt;&amp;quot;PXXXXX-XXXXXX-XXXXX-XXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || &amp;lt;code&amp;gt;&amp;quot;nlsnInstance&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || &amp;lt;code&amp;gt;&amp;quot;debug&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Browser SDK Queue Snippit &amp;amp; Initialization Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; || Correct APID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;instanceName&amp;lt;/code&amp;gt; || SDK Instance Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second, and starts at 0 || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of each asset before transition ie. content to ad, ad to content, ad to ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Should Be Called:&lt;br /&gt;
* Before each transition from ad to content, content to ad, or ad to ad&lt;br /&gt;
* Upon pause&lt;br /&gt;
* When playback is interrupted (connection lost, user exits video or page)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Called once content has completed fully || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** refresh page&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of or opt back into Nielsen measurement. Include the following two items in the site’s Privacy Policy:&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1848</id>
		<title>Digital Pre-Certification Checklist Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1848"/>
		<updated>2017-10-26T10:42:31Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* loadMetadata() - Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklist - VOD with Ads ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an APID&lt;br /&gt;
** informed you of our Opt-Out requirement to be included in your Privacy Policy section of your site&lt;br /&gt;
** informed you to add the Static Queue Snippit on each page you wish to enable video measurement &lt;br /&gt;
** informed you that the apid, 'instanceName', and ‘nol_sdkDebug’ : ‘DEBUG’ should be present in the SDK initialization&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing on page load, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || &amp;lt;code&amp;gt;&amp;quot;PXXXXX-XXXXXX-XXXXX-XXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || &amp;lt;code&amp;gt;&amp;quot;nlsnInstance&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || &amp;lt;code&amp;gt;&amp;quot;debug&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Browser SDK Queue Snippit &amp;amp; Initialization Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; || Correct APID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;instanceName&amp;lt;/code&amp;gt; || SDK Instance Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second, and starts at 0 || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of each asset before transition ie. content to ad, ad to content, ad to ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Should Be Called:&lt;br /&gt;
* Before each transition from ad to content, content to ad, or ad to ad&lt;br /&gt;
* Upon pause&lt;br /&gt;
* When playback is interrupted (connection lost, user exits video or page)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Called once content has completed fully || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** refresh page&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of or opt back into Nielsen measurement. Include the following two items in the site’s Privacy Policy:&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1847</id>
		<title>Digital Pre-Certification Checklist Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1847"/>
		<updated>2017-10-26T10:42:08Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklist - VOD with Ads ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an APID&lt;br /&gt;
** informed you of our Opt-Out requirement to be included in your Privacy Policy section of your site&lt;br /&gt;
** informed you to add the Static Queue Snippit on each page you wish to enable video measurement &lt;br /&gt;
** informed you that the apid, 'instanceName', and ‘nol_sdkDebug’ : ‘DEBUG’ should be present in the SDK initialization&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing on page load, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || &amp;lt;code&amp;gt;&amp;quot;PXXXXX-XXXXXX-XXXXX-XXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || &amp;lt;code&amp;gt;&amp;quot;nlsnInstance&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || &amp;lt;code&amp;gt;&amp;quot;debug&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Browser SDK Queue Snippit &amp;amp; Initialization Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; || Correct APID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;instanceName&amp;lt;/code&amp;gt; || SDK Instance Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second, and starts at 0 || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of each asset before transition ie. content to ad, ad to content, ad to ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Should Be Called:&lt;br /&gt;
* Before each transition from ad to content, content to ad, or ad to ad&lt;br /&gt;
* Upon pause&lt;br /&gt;
* When playback is interrupted (connection lost, user exits video or page)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Called once content has completed fully || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** refresh page&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of or opt back into Nielsen measurement. Include the following two items in the site’s Privacy Policy:&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1846</id>
		<title>Digital Pre-Certification Checklist Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_Browser_SDK&amp;diff=1846"/>
		<updated>2017-10-26T10:41:33Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklist - VOD with Ads ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an APID&lt;br /&gt;
** informed you of our Opt-Out requirement to be included in your Privacy Policy section of your site&lt;br /&gt;
** informed you to add the Static Queue Snippit on each page you wish to enable video measurement &lt;br /&gt;
** informed you that the apid, 'instanceName', and ‘nol_sdkDebug’ : ‘DEBUG’ should be present in the SDK initialization&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing on page load, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || &amp;lt;code&amp;gt;&amp;quot;PXXXXX-XXXXXX-XXXXX-XXXXX&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || &amp;lt;code&amp;gt;&amp;quot;nlsnInstance&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || &amp;lt;code&amp;gt;&amp;quot;debug&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Browser SDK Queue Snippit &amp;amp; Initialization Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; || Correct APID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;instanceName&amp;lt;/code&amp;gt; || SDK Instance Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;'DEBUG'&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second, and starts at 0 || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of each asset before transition ie. content to ad, ad to content, ad to ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Should Be Called:&lt;br /&gt;
* Before each transition from ad to content, content to ad, or ad to ad&lt;br /&gt;
* Upon pause&lt;br /&gt;
* When playback is interrupted (connection lost, user exits video or page)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Called once content has completed fully || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** refresh page&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of or opt back into Nielsen measurement. Include the following two items in the site’s Privacy Policy:&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1845</id>
		<title>Digital Pre-Certification Checklist App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1845"/>
		<updated>2017-10-26T10:34:44Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* loadMetadata() - Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-certification Checklist ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an AppID&lt;br /&gt;
** informed you of our Opt-Out requirement for your App/Play Store description&lt;br /&gt;
** informed you of our Opt-Out requirement for a WebView inside your apps&lt;br /&gt;
* Retrieving AppSDK logs&lt;br /&gt;
** 'nol_devDebug' : 'DEBUG' should be present in initialization call (see below)&lt;br /&gt;
** Android: use adb logcat (note: requires Android Studio)&lt;br /&gt;
** iOS: idevicesyslog (note: requires XCode)&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing at app startup, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| appid || &amp;lt;code&amp;gt;XXXXX-XXXXXX-XXXXX-XXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appname || &amp;lt;code&amp;gt;example app name&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''iOS Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
{ // AppID is Nielsen-supplied&lt;br /&gt;
	 @&amp;quot;appid&amp;quot;: @&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appname&amp;quot;: @&amp;quot;Sample App Name&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appversion&amp;quot;: @&amp;quot;2.0&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot; // required for testing only&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Android Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;,&amp;quot;2.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug”, &amp;quot;DEBUG&amp;quot;); // required for testing only&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt; || Correct app id || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt; || Player name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appversion&amp;lt;/code&amp;gt; || Correct build || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_devDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== play() ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; call is required only once per viewing session (until app is killed)&lt;br /&gt;
* Called just before playback commences for first piece of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Play || &amp;lt;code&amp;gt;channelname&amp;lt;/code&amp;gt; || Name of Channel || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Content || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Indicates one of the following:&lt;br /&gt;
* Playback of content or ad was interrupted&lt;br /&gt;
* Reached end of ad (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** app sent to background&lt;br /&gt;
** headphones removed (note, if app simply switches audio output from headphones to speaker without pausing, there is no need to call stop())&lt;br /&gt;
** alarm/call interruption&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| app sent to background || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| headphones removed || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| alarm/call interruption || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadataM&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
Users must have access to &amp;quot;About Nielsen Measurement&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
* URL to this web page should be called from SDK by invoking optOutURL and opened in 'WebView' / External browser.&lt;br /&gt;
* If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
* To retrieve the current Opt-Out status of a device, use the optOutStatus method.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;optOutView&amp;lt;/code&amp;gt; || User can Opt-Out || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1844</id>
		<title>Digital Pre-Certification Checklist App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1844"/>
		<updated>2017-10-26T10:33:07Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* loadMetadata() - Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-certification Checklist ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an AppID&lt;br /&gt;
** informed you of our Opt-Out requirement for your App/Play Store description&lt;br /&gt;
** informed you of our Opt-Out requirement for a WebView inside your apps&lt;br /&gt;
* Retrieving AppSDK logs&lt;br /&gt;
** 'nol_devDebug' : 'DEBUG' should be present in initialization call (see below)&lt;br /&gt;
** Android: use adb logcat (note: requires Android Studio)&lt;br /&gt;
** iOS: idevicesyslog (note: requires XCode)&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing at app startup, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| appid || &amp;lt;code&amp;gt;XXXXX-XXXXXX-XXXXX-XXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appname || &amp;lt;code&amp;gt;example app name&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''iOS Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
{ // AppID is Nielsen-supplied&lt;br /&gt;
	 @&amp;quot;appid&amp;quot;: @&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appname&amp;quot;: @&amp;quot;Sample App Name&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appversion&amp;quot;: @&amp;quot;2.0&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot; // required for testing only&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Android Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;,&amp;quot;2.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug”, &amp;quot;DEBUG&amp;quot;); // required for testing only&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt; || Correct app id || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt; || Player name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appversion&amp;lt;/code&amp;gt; || Correct build || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_devDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== play() ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; call is required only once per viewing session (until app is killed)&lt;br /&gt;
* Called just before playback commences for first piece of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Play || &amp;lt;code&amp;gt;channelname&amp;lt;/code&amp;gt; || Name of Channel || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Content || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Indicates one of the following:&lt;br /&gt;
* Playback of content or ad was interrupted&lt;br /&gt;
* Reached end of ad (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** app sent to background&lt;br /&gt;
** headphones removed (note, if app simply switches audio output from headphones to speaker without pausing, there is no need to call stop())&lt;br /&gt;
** alarm/call interruption&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| app sent to background || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| headphones removed || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| alarm/call interruption || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadataM&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
Users must have access to &amp;quot;About Nielsen Measurement&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
* URL to this web page should be called from SDK by invoking optOutURL and opened in 'WebView' / External browser.&lt;br /&gt;
* If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
* To retrieve the current Opt-Out status of a device, use the optOutStatus method.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;optOutView&amp;lt;/code&amp;gt; || User can Opt-Out || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1843</id>
		<title>Digital Pre-Certification Checklist App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Pre-Certification_Checklist_App_SDK&amp;diff=1843"/>
		<updated>2017-10-26T10:32:03Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Pre-certification Checklist ==&lt;br /&gt;
Before starting the certification process, please verify the following steps have been completed.&lt;br /&gt;
* Your Client Service representative should have already discussed a reporting hierarchy with you -- along with a Parent, Brand, and Sub-brand/Channel&lt;br /&gt;
* Your Technical Account Manager should have:&lt;br /&gt;
** provided you with an AppID&lt;br /&gt;
** informed you of our Opt-Out requirement for your App/Play Store description&lt;br /&gt;
** informed you of our Opt-Out requirement for a WebView inside your apps&lt;br /&gt;
* Retrieving AppSDK logs&lt;br /&gt;
** 'nol_devDebug' : 'DEBUG' should be present in initialization call (see below)&lt;br /&gt;
** Android: use adb logcat (note: requires Android Studio)&lt;br /&gt;
** iOS: idevicesyslog (note: requires XCode)&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
The first step in the Certification process is to ensure that the Nielsen SDK is initializing at app startup, and that the global metadata values are present.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Value&lt;br /&gt;
|-&lt;br /&gt;
| appid || &amp;lt;code&amp;gt;XXXXX-XXXXXX-XXXXX-XXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appname || &amp;lt;code&amp;gt;example app name&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''iOS Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;NSDictionary* appInformation = @&lt;br /&gt;
{ // AppID is Nielsen-supplied&lt;br /&gt;
	 @&amp;quot;appid&amp;quot;: @&amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appname&amp;quot;: @&amp;quot;Sample App Name&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;appversion&amp;quot;: @&amp;quot;2.0&amp;quot;,&lt;br /&gt;
 	 @&amp;quot;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot; // required for testing only&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Android Example'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appname&amp;quot;, &amp;quot;Sample App Name&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;appversion&amp;quot;,&amp;quot;2.0&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug”, &amp;quot;DEBUG&amp;quot;); // required for testing only&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
The following lists the test cases along with the Expected results:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| SDK Initialized || &amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt; || Correct app id || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appname&amp;lt;/code&amp;gt; || Player name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;appversion&amp;lt;/code&amp;gt; || Correct build || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;nol_devDebug&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;DEBUG&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== play() ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; call is required only once per viewing session (until app is killed)&lt;br /&gt;
* Called just before playback commences for first piece of content&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Param !! Expected Result !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Play || &amp;lt;code&amp;gt;channelname&amp;lt;/code&amp;gt; || Name of Channel || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Called at beginning of content, or when resuming content from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - ad ===&lt;br /&gt;
* Called at beginning of ad, or when resuming ad from interruption&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ad_2201343201&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Preroll ad ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of ad&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata() - Content ===&lt;br /&gt;
* Test is to validate Content metadata is the same as original metadata passed during initial loadMetadata call.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test !! Param !! Example Value !! Accepted Values !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata || &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;unique_id_500291&amp;quot;&amp;lt;/code&amp;gt; || (unique per asset) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;600&amp;quot;&amp;lt;/code&amp;gt; || length in seconds (int or float) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Episode Title&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;program&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Show Name&amp;quot;&amp;lt;/code&amp;gt; || (any non-empty value) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Primetime&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;segC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Comedy&amp;quot;&amp;lt;/code&amp;gt; || (any value), used for optional breakdown || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;EP018S9S290015&amp;quot;&amp;lt;/code&amp;gt; || Gracenote ID || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;crossId2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;ABC&amp;quot;&amp;lt;/code&amp;gt; || Network Name || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;isfullepisode&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; || (&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;) (&amp;lt;code&amp;gt;&amp;quot;Y&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt;) || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;airdate&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;20160206 23:00:00&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;YYYYMMDD[space]HH:MM:SS&amp;quot;&amp;lt;/code&amp;gt; -- note: HH=24 hour time || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;adloadtype&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for linear ads, &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; for DAI || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;hasAds&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; for no ads, &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; for has ads || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition() - Content ===&lt;br /&gt;
* Track current position of playhead&lt;br /&gt;
* Starts at 0 at the beginning of content&lt;br /&gt;
* Updated at least once per second&lt;br /&gt;
* Separate playhead position for ads and content, should accurately reflect current position in either ads or content&lt;br /&gt;
* Final playhead position for content must equal the length specified in loadMetadata(), followed by end() call&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;setPlayehadPosition&amp;lt;/code&amp;gt; || Called every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || Called at the end of Content || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== stop() ===&lt;br /&gt;
* Indicates one of the following:&lt;br /&gt;
* Playback of content or ad was interrupted&lt;br /&gt;
* Reached end of ad (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
=== end() ===&lt;br /&gt;
* Reached the end of content (no parameters or metadata)&lt;br /&gt;
&lt;br /&gt;
== Interruptions ==&lt;br /&gt;
* All interruptions to playback of content or ads should trigger a call to stop(). Once the interruption is over, loadMetadata() with the same metadata should be called, followed by playheadPosition resuming from where it left off.&lt;br /&gt;
&lt;br /&gt;
* Interruptions include:&lt;br /&gt;
** user-induced pause&lt;br /&gt;
** screen turned off&lt;br /&gt;
** app sent to background&lt;br /&gt;
** headphones removed (note, if app simply switches audio output from headphones to speaker without pausing, there is no need to call stop())&lt;br /&gt;
** alarm/call interruption&lt;br /&gt;
** internet connection lost (n.b. cached playback plays as normal until it expires)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| user-induced pause || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| screen turned off || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| app sent to background || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| headphones removed || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| alarm/call interruption || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| internet connection lost || &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| content paused || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; is not passed || &lt;br /&gt;
|-&lt;br /&gt;
| resume content || &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; is called for content || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;loadMetadataM&amp;lt;/code&amp;gt; is the same as original || &lt;br /&gt;
|-&lt;br /&gt;
|  || &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; continues from resumed position || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Expected SDK behavior for all interruptions:'''&lt;br /&gt;
# interruption triggers stop() call&lt;br /&gt;
# when content resumes, loadMetadata() is called with the same metadata that was playing previously (ad or content)&lt;br /&gt;
# playheadPosition() resumes from the same position before the interruption&lt;br /&gt;
&lt;br /&gt;
'''Example session:'''&lt;br /&gt;
* 5 minutes of content played, call interruption, content resumes until end of 15 min video&lt;br /&gt;
&lt;br /&gt;
== Scrubbing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| Scrub Backward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub Forward || new playhead position is accurate || &lt;br /&gt;
|-&lt;br /&gt;
|  || new playhead continues from new position || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub to end || final playhead position is passed || &lt;br /&gt;
|-&lt;br /&gt;
|  || end event called at completion of content playback || &lt;br /&gt;
|-&lt;br /&gt;
| Scrub past midroll || Playhead for content stops || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Midroll &amp;amp; Postroll Ads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; || Called for each Ad || &lt;br /&gt;
|-&lt;br /&gt;
|  || Required Metadata is accurate || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; || Passed every second || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || called for each ad || &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt; || correct sequence for each ad || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
Users must have access to &amp;quot;About Nielsen Measurement&amp;quot; page. User can click this page from app settings screen.&lt;br /&gt;
* URL to this web page should be called from SDK by invoking optOutURL and opened in 'WebView' / External browser.&lt;br /&gt;
* If the App SDK returns NULL as Opt-Out URL, handle the exception gracefully and retry later.&lt;br /&gt;
* To retrieve the current Opt-Out status of a device, use the optOutStatus method.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Case !! Test Condition !! Pass/Fail&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;optOutView&amp;lt;/code&amp;gt; || User can Opt-Out || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1842</id>
		<title>Digital Measurement Testing</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1842"/>
		<updated>2017-10-26T09:11:26Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Step 7: Video Duration Ping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Monitoring Tools ==&lt;br /&gt;
HTTP traffic-monitoring tool, such as Charles or Fiddler are required.&lt;br /&gt;
*'''Charles:''' http://www.charlesproxy.com&lt;br /&gt;
*'''Fiddler:''' http://www.telerik.com/fiddler&lt;br /&gt;
&lt;br /&gt;
== Step 1: Filter traffic ==&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;imr&amp;quot; to capture traffic from the SDK as shown in the below figure. This will capture traffic going to Nielsen servers. Now set up the device to proxy to this traffic analyzer.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Instructions may vary from device to device and are available online.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
[[File:fiddler-web-debugger.png|link=]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Check Opt-Out ==&lt;br /&gt;
If the opt-out function or app disable feature is previously tested, it has to be ensured that an opt-in is completed on the device before continuing. Terminate the app completely before starting.&lt;br /&gt;
&lt;br /&gt;
== Step 3: Hello Ping ==&lt;br /&gt;
The first HTTPS traffic that should be seen is the SDK request for configuration information, called a '''hello ping'''. In order to see this ping, Charles / Fiddler has to be configured to capture HTTPS traffic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-dcr.imrworldwide.com/cgi-bin/cfg?cfgv=100&amp;amp;longitude=-82.66&amp;amp;latitude=28.05&amp;amp;apid=&amp;amp;apv=3.84.043&amp;amp;apn=com.video.videop&lt;br /&gt;
layer&amp;amp;sdkv=aa .1.2.3&amp;amp;nuid=7B341CD-5109-B88-B77D-8ADE904717A7&amp;amp;osver=ANDROID.4.2.2&amp;amp;devtypid=LGE-Nexus-4&amp;amp;devid=FFA503E7-&lt;br /&gt;
7749-4448-9922-132492ED4E12&amp;amp;fmt=json&amp;amp;adf=&amp;amp;uoo=&amp;amp;sfcode=dcr&amp;amp;ccode=1&amp;amp;dma=&amp;amp;rnd=1527112029&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it is likely that the instance of the SDK failed to initialize. Please see Initialization ([[iOS SDK API Reference#Initialization|iOS SDK API Reference - Initialization]] and [[Android SDK API Reference#Initialization|Android SDK API Reference - Initialization]]) to see how to initialize the SDK.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: The L Ping ==&lt;br /&gt;
When the app is started after installing for the first time, and app is measuring '''DCR Static''' content only, a DCR static app launch known as '''L''' ping firing to secure-dcr.imrworldwide.com server in the traffic-monitor should be seen. However, the '''L''' ping will be observed again if app goes into background and resumes back after 5 minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=L&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=launch&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv ,aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,473&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=28.09&amp;lt;wbr /&amp;gt;&amp;amp;lon=-82.76&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432529128693&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the app is measuring '''DCR Video Content''' only, then the '''hello ping''' will fire but the '''L''' ping will not be observed upon app launch.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Static View Ping ==&lt;br /&gt;
For any sections that are tagged for static content, a '''DCR Static – view''' ping should be received. The first landing page should always be tagged. An example of this ping is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=V&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=view&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv,a a.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,0&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=&amp;lt;wbr /&amp;gt;&amp;amp;lon=&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.1&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.2&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432068181560&amp;lt;/code&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent the asset’s name assigned in the metadata. || Page-Asset&lt;br /&gt;
|-&lt;br /&gt;
| at || Action Type || Start&lt;br /&gt;
|-&lt;br /&gt;
| rt || This value should be “text” and indicates that this is a DCR tag for static content. || text&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c32 || Segment A – Client customized metadata || CustomSegmentValueA&lt;br /&gt;
|-&lt;br /&gt;
| c33 || Segment B – Client customized metadata || CustomSegmentValueB&lt;br /&gt;
|-&lt;br /&gt;
| c34 || Segment C – Client customized metadata || CustomSegmentValueC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 6: Video View Ping ==&lt;br /&gt;
Approximately 60 seconds into viewing of the stream, a '''DCR Video – view''' ping fire to secure-dcr.imrworldwide.com server indicated by the '''cr''' value containing a '''V''' in the format of 4_00_99_'''V'''1_00000 should be seen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, a common cause is improper metadata being passed to the SDK. Examples of the proper metadata to be passed in the &amp;lt;/code&amp;gt;loadMetadata&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7: Video Duration Ping ==&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed. A '''DCR Video''' – duration ping fire to secure-dcr.imrworldwide.com indicated by the '''cr''' value containing a '''D''' in the format of 4_00_99_'''D'''1_11111 should be seen. This D ping should fire approximately every 5 minutes after the initial duration ping has fired or when the content switches to an advertisement. The ad length (c51) is the total ad duration viewed in the previous session, and the ad count (c52) is the number of ads viewed in previous segment.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c51 || Ad Duration || adl,88&lt;br /&gt;
|-&lt;br /&gt;
| c52 || Ad Count || noad,1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it may be caused by not passing the setPlayheadPosition API call as expected. The instruction as well as examples can be found in the Developer’s Guide.&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8: 5min Duration Ping ==&lt;br /&gt;
View all channels for 5 minutes to ensure all channels fire a '''duration''' ping.&lt;br /&gt;
&lt;br /&gt;
== Step 9: Pending Duration Ping ==&lt;br /&gt;
Play a stream and move the app to the background. A pending '''duration''' ping should fire; crediting the appropriate number of minutes viewed from last ping (i.e. 4_00_99_D1_'''111'''00). No other pings should fire after it has been moved to the background. In case SDK does not get a chance to send out the ping while going to background, SDK will send the pending ping on next re-launch.&lt;br /&gt;
&lt;br /&gt;
== Step 10: Pending Duration Pings cont. ==&lt;br /&gt;
The same action will occur with any interruption to the stream’s playback (e.g., alarm, incoming call, etc.).&lt;br /&gt;
&lt;br /&gt;
== Step 11: Opt-Out Implementation ==&lt;br /&gt;
Test the Opt-Out implementation in four steps.&lt;br /&gt;
*Complete an opt-out in the app through the Nielsen opt-out webview.&lt;br /&gt;
*User opt-out, a '''goodbye ping''' is fired off to the Nielsen server. '''Example Goodbye Ping''':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=&amp;lt;wbr /&amp;gt;&amp;amp;latitude=&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=true&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434632964945&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any content (static or video) for at least three minutes. No pings will be rendered.&lt;br /&gt;
*Opt back in, a '''hello ping''' is fired off to the Nielsen server. ''Example Hello Ping'':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=-82.65&amp;lt;wbr /&amp;gt;&amp;amp;latitude=28.05&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=false&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434633027479&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any video content for at least three minutes and V/D pings – '''view''' and '''duration''' pings will be visible.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1841</id>
		<title>Digital Measurement Testing</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1841"/>
		<updated>2017-10-26T09:10:56Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Step 6: Video View Ping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Monitoring Tools ==&lt;br /&gt;
HTTP traffic-monitoring tool, such as Charles or Fiddler are required.&lt;br /&gt;
*'''Charles:''' http://www.charlesproxy.com&lt;br /&gt;
*'''Fiddler:''' http://www.telerik.com/fiddler&lt;br /&gt;
&lt;br /&gt;
== Step 1: Filter traffic ==&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;imr&amp;quot; to capture traffic from the SDK as shown in the below figure. This will capture traffic going to Nielsen servers. Now set up the device to proxy to this traffic analyzer.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Instructions may vary from device to device and are available online.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
[[File:fiddler-web-debugger.png|link=]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Check Opt-Out ==&lt;br /&gt;
If the opt-out function or app disable feature is previously tested, it has to be ensured that an opt-in is completed on the device before continuing. Terminate the app completely before starting.&lt;br /&gt;
&lt;br /&gt;
== Step 3: Hello Ping ==&lt;br /&gt;
The first HTTPS traffic that should be seen is the SDK request for configuration information, called a '''hello ping'''. In order to see this ping, Charles / Fiddler has to be configured to capture HTTPS traffic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-dcr.imrworldwide.com/cgi-bin/cfg?cfgv=100&amp;amp;longitude=-82.66&amp;amp;latitude=28.05&amp;amp;apid=&amp;amp;apv=3.84.043&amp;amp;apn=com.video.videop&lt;br /&gt;
layer&amp;amp;sdkv=aa .1.2.3&amp;amp;nuid=7B341CD-5109-B88-B77D-8ADE904717A7&amp;amp;osver=ANDROID.4.2.2&amp;amp;devtypid=LGE-Nexus-4&amp;amp;devid=FFA503E7-&lt;br /&gt;
7749-4448-9922-132492ED4E12&amp;amp;fmt=json&amp;amp;adf=&amp;amp;uoo=&amp;amp;sfcode=dcr&amp;amp;ccode=1&amp;amp;dma=&amp;amp;rnd=1527112029&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it is likely that the instance of the SDK failed to initialize. Please see Initialization ([[iOS SDK API Reference#Initialization|iOS SDK API Reference - Initialization]] and [[Android SDK API Reference#Initialization|Android SDK API Reference - Initialization]]) to see how to initialize the SDK.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: The L Ping ==&lt;br /&gt;
When the app is started after installing for the first time, and app is measuring '''DCR Static''' content only, a DCR static app launch known as '''L''' ping firing to secure-dcr.imrworldwide.com server in the traffic-monitor should be seen. However, the '''L''' ping will be observed again if app goes into background and resumes back after 5 minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=L&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=launch&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv ,aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,473&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=28.09&amp;lt;wbr /&amp;gt;&amp;amp;lon=-82.76&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432529128693&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the app is measuring '''DCR Video Content''' only, then the '''hello ping''' will fire but the '''L''' ping will not be observed upon app launch.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Static View Ping ==&lt;br /&gt;
For any sections that are tagged for static content, a '''DCR Static – view''' ping should be received. The first landing page should always be tagged. An example of this ping is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=V&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=view&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv,a a.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,0&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=&amp;lt;wbr /&amp;gt;&amp;amp;lon=&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.1&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.2&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432068181560&amp;lt;/code&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent the asset’s name assigned in the metadata. || Page-Asset&lt;br /&gt;
|-&lt;br /&gt;
| at || Action Type || Start&lt;br /&gt;
|-&lt;br /&gt;
| rt || This value should be “text” and indicates that this is a DCR tag for static content. || text&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c32 || Segment A – Client customized metadata || CustomSegmentValueA&lt;br /&gt;
|-&lt;br /&gt;
| c33 || Segment B – Client customized metadata || CustomSegmentValueB&lt;br /&gt;
|-&lt;br /&gt;
| c34 || Segment C – Client customized metadata || CustomSegmentValueC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 6: Video View Ping ==&lt;br /&gt;
Approximately 60 seconds into viewing of the stream, a '''DCR Video – view''' ping fire to secure-dcr.imrworldwide.com server indicated by the '''cr''' value containing a '''V''' in the format of 4_00_99_'''V'''1_00000 should be seen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, a common cause is improper metadata being passed to the SDK. Examples of the proper metadata to be passed in the &amp;lt;/code&amp;gt;loadMetadata&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7: Video Duration Ping ==&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed. A '''DCR Video''' – duration ping fire to secure-dcr.imrworldwide.com indicated by the '''cr''' value containing a '''D''' in the format of 4_00_99_'''D'''1_11111 should be seen. This D ping should fire approximately every 5 minutes after the initial duration ping has fired or when the content switches to an advertisement. The ad length (c51) is the total ad duration viewed in the previous session, and the ad count (c52) is the number of ads viewed in previous segment.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || APRP7&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c51 || Ad Duration || adl,88&lt;br /&gt;
|-&lt;br /&gt;
| c52 || Ad Count || noad,1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it may be caused by not passing the setPlayheadPosition API call as expected. The instruction as well as examples can be found in the Developer’s Guide.&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8: 5min Duration Ping ==&lt;br /&gt;
View all channels for 5 minutes to ensure all channels fire a '''duration''' ping.&lt;br /&gt;
&lt;br /&gt;
== Step 9: Pending Duration Ping ==&lt;br /&gt;
Play a stream and move the app to the background. A pending '''duration''' ping should fire; crediting the appropriate number of minutes viewed from last ping (i.e. 4_00_99_D1_'''111'''00). No other pings should fire after it has been moved to the background. In case SDK does not get a chance to send out the ping while going to background, SDK will send the pending ping on next re-launch.&lt;br /&gt;
&lt;br /&gt;
== Step 10: Pending Duration Pings cont. ==&lt;br /&gt;
The same action will occur with any interruption to the stream’s playback (e.g., alarm, incoming call, etc.).&lt;br /&gt;
&lt;br /&gt;
== Step 11: Opt-Out Implementation ==&lt;br /&gt;
Test the Opt-Out implementation in four steps.&lt;br /&gt;
*Complete an opt-out in the app through the Nielsen opt-out webview.&lt;br /&gt;
*User opt-out, a '''goodbye ping''' is fired off to the Nielsen server. '''Example Goodbye Ping''':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=&amp;lt;wbr /&amp;gt;&amp;amp;latitude=&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=true&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434632964945&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any content (static or video) for at least three minutes. No pings will be rendered.&lt;br /&gt;
*Opt back in, a '''hello ping''' is fired off to the Nielsen server. ''Example Hello Ping'':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=-82.65&amp;lt;wbr /&amp;gt;&amp;amp;latitude=28.05&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=false&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434633027479&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any video content for at least three minutes and V/D pings – '''view''' and '''duration''' pings will be visible.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1840</id>
		<title>Digital Measurement Testing</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Testing&amp;diff=1840"/>
		<updated>2017-10-26T09:10:25Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Step 5: Static View Ping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Monitoring Tools ==&lt;br /&gt;
HTTP traffic-monitoring tool, such as Charles or Fiddler are required.&lt;br /&gt;
*'''Charles:''' http://www.charlesproxy.com&lt;br /&gt;
*'''Fiddler:''' http://www.telerik.com/fiddler&lt;br /&gt;
&lt;br /&gt;
== Step 1: Filter traffic ==&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;imr&amp;quot; to capture traffic from the SDK as shown in the below figure. This will capture traffic going to Nielsen servers. Now set up the device to proxy to this traffic analyzer.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' Instructions may vary from device to device and are available online.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
[[File:fiddler-web-debugger.png|link=]]&lt;br /&gt;
&lt;br /&gt;
== Step 2: Check Opt-Out ==&lt;br /&gt;
If the opt-out function or app disable feature is previously tested, it has to be ensured that an opt-in is completed on the device before continuing. Terminate the app completely before starting.&lt;br /&gt;
&lt;br /&gt;
== Step 3: Hello Ping ==&lt;br /&gt;
The first HTTPS traffic that should be seen is the SDK request for configuration information, called a '''hello ping'''. In order to see this ping, Charles / Fiddler has to be configured to capture HTTPS traffic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-dcr.imrworldwide.com/cgi-bin/cfg?cfgv=100&amp;amp;longitude=-82.66&amp;amp;latitude=28.05&amp;amp;apid=&amp;amp;apv=3.84.043&amp;amp;apn=com.video.videop&lt;br /&gt;
layer&amp;amp;sdkv=aa .1.2.3&amp;amp;nuid=7B341CD-5109-B88-B77D-8ADE904717A7&amp;amp;osver=ANDROID.4.2.2&amp;amp;devtypid=LGE-Nexus-4&amp;amp;devid=FFA503E7-&lt;br /&gt;
7749-4448-9922-132492ED4E12&amp;amp;fmt=json&amp;amp;adf=&amp;amp;uoo=&amp;amp;sfcode=dcr&amp;amp;ccode=1&amp;amp;dma=&amp;amp;rnd=1527112029&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it is likely that the instance of the SDK failed to initialize. Please see Initialization ([[iOS SDK API Reference#Initialization|iOS SDK API Reference - Initialization]] and [[Android SDK API Reference#Initialization|Android SDK API Reference - Initialization]]) to see how to initialize the SDK.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: The L Ping ==&lt;br /&gt;
When the app is started after installing for the first time, and app is measuring '''DCR Static''' content only, a DCR static app launch known as '''L''' ping firing to secure-dcr.imrworldwide.com server in the traffic-monitor should be seen. However, the '''L''' ping will be observed again if app goes into background and resumes back after 5 minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=L&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=launch&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv ,aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,473&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=28.09&amp;lt;wbr /&amp;gt;&amp;amp;lon=-82.76&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.3&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432529128693&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the app is measuring '''DCR Video Content''' only, then the '''hello ping''' will fire but the '''L''' ping will not be observed upon app launch.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Static View Ping ==&lt;br /&gt;
For any sections that are tagged for static content, a '''DCR Static – view''' ping should be received. The first landing page should always be tagged. An example of this ping is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=APRP7&amp;lt;wbr /&amp;gt;&amp;amp;ch=APRP7_NA_defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;asn=defChnAsset&amp;lt;wbr /&amp;gt;&amp;amp;tl=&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,MTVR-APT-QA&amp;lt;wbr /&amp;gt;&amp;amp;sup=0&amp;lt;wbr /&amp;gt;&amp;amp;segment2=539&amp;lt;wbr /&amp;gt;&amp;amp;segment1=usa&amp;lt;wbr /&amp;gt;&amp;amp;forward=1&amp;lt;wbr /&amp;gt;&amp;amp;ad=1&amp;lt;wbr /&amp;gt;&amp;amp;cr=V&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,a69983bc65ad94f9e57109fec68cc847bf59575ee03cadb76b187f4c24eaf793&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,142a40706f9c03bfea020f7297828534a1f14895d7a8c5303d9b8a19b3337c13&amp;lt;wbr /&amp;gt;&amp;amp;r=&amp;lt;wbr /&amp;gt;&amp;amp;at=view&amp;lt;wbr /&amp;gt;&amp;amp;rt=text&amp;lt;wbr /&amp;gt;&amp;amp;c16=sdkv,a a.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,0&amp;lt;wbr /&amp;gt;&amp;amp;crs=0&amp;lt;wbr /&amp;gt;&amp;amp;si=&amp;lt;wbr /&amp;gt;&amp;amp;lat=&amp;lt;wbr /&amp;gt;&amp;amp;lon=&amp;lt;wbr /&amp;gt;&amp;amp;c29=plid,XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,aa.4.0.0.1&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,DROID&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,TAB&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,MBL&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;c26=1&amp;lt;wbr /&amp;gt;&amp;amp;c35=&amp;lt;wbr /&amp;gt;&amp;amp;c36=cref1,&amp;lt;wbr /&amp;gt;&amp;amp;c37=cref2,&amp;lt;wbr /&amp;gt;&amp;amp;c11=agg,1&amp;lt;wbr /&amp;gt;&amp;amp;c12=apv,apt.4.0.0.2&amp;lt;wbr /&amp;gt;&amp;amp;h33=2&amp;lt;wbr /&amp;gt;&amp;amp;c51=adl,0&amp;lt;wbr /&amp;gt;&amp;amp;c52=noad,0&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=asus-Nexus-7&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1432068181560&amp;lt;/code&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || us-123456&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent the asset’s name assigned in the metadata. || Page-Asset&lt;br /&gt;
|-&lt;br /&gt;
| at || Action Type || Start&lt;br /&gt;
|-&lt;br /&gt;
| rt || This value should be “text” and indicates that this is a DCR tag for static content. || text&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c32 || Segment A – Client customized metadata || CustomSegmentValueA&lt;br /&gt;
|-&lt;br /&gt;
| c33 || Segment B – Client customized metadata || CustomSegmentValueB&lt;br /&gt;
|-&lt;br /&gt;
| c34 || Segment C – Client customized metadata || CustomSegmentValueC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 6: Video View Ping ==&lt;br /&gt;
Approximately 60 seconds into viewing of the stream, a '''DCR Video – view''' ping fire to secure-dcr.imrworldwide.com server indicated by the '''cr''' value containing a '''V''' in the format of 4_00_99_'''V'''1_00000 should be seen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || APRP7&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, a common cause is improper metadata being passed to the SDK. Examples of the proper metadata to be passed in the &amp;lt;/code&amp;gt;loadMetadata&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7: Video Duration Ping ==&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed. A '''DCR Video''' – duration ping fire to secure-dcr.imrworldwide.com indicated by the '''cr''' value containing a '''D''' in the format of 4_00_99_'''D'''1_11111 should be seen. This D ping should fire approximately every 5 minutes after the initial duration ping has fired or when the content switches to an advertisement. The ad length (c51) is the total ad duration viewed in the previous session, and the ad count (c52) is the number of ads viewed in previous segment.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Example&lt;br /&gt;
|-&lt;br /&gt;
| ci || Client ID – this value should be consistent throughout all of the pings that fire for the implementation. || APRP7&lt;br /&gt;
|-&lt;br /&gt;
| asn || Asset Name – this value should represent asset’s name assigned in the metadata. || Video-Asset&lt;br /&gt;
|-&lt;br /&gt;
| tl || Episode Title || Episode Name – S2 – E1 – LF&lt;br /&gt;
|-&lt;br /&gt;
| cr || Crediting Ping Identifier || 4_00_99_V1_00000&lt;br /&gt;
|-&lt;br /&gt;
| rt || This Value should be “video” and indicates that this is a DCR tag for video content. || video&lt;br /&gt;
|-&lt;br /&gt;
| c10 || Platform Indicator || plt,DSK or plt,MBL&lt;br /&gt;
|-&lt;br /&gt;
| c13 || This value should contain the appid of the application. || asid,XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| c51 || Ad Duration || adl,88&lt;br /&gt;
|-&lt;br /&gt;
| c52 || Ad Count || noad,1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' If this ping fails to fire, it may be caused by not passing the setPlayheadPosition API call as expected. The instruction as well as examples can be found in the Developer’s Guide.&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8: 5min Duration Ping ==&lt;br /&gt;
View all channels for 5 minutes to ensure all channels fire a '''duration''' ping.&lt;br /&gt;
&lt;br /&gt;
== Step 9: Pending Duration Ping ==&lt;br /&gt;
Play a stream and move the app to the background. A pending '''duration''' ping should fire; crediting the appropriate number of minutes viewed from last ping (i.e. 4_00_99_D1_'''111'''00). No other pings should fire after it has been moved to the background. In case SDK does not get a chance to send out the ping while going to background, SDK will send the pending ping on next re-launch.&lt;br /&gt;
&lt;br /&gt;
== Step 10: Pending Duration Pings cont. ==&lt;br /&gt;
The same action will occur with any interruption to the stream’s playback (e.g., alarm, incoming call, etc.).&lt;br /&gt;
&lt;br /&gt;
== Step 11: Opt-Out Implementation ==&lt;br /&gt;
Test the Opt-Out implementation in four steps.&lt;br /&gt;
*Complete an opt-out in the app through the Nielsen opt-out webview.&lt;br /&gt;
*User opt-out, a '''goodbye ping''' is fired off to the Nielsen server. '''Example Goodbye Ping''':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=&amp;lt;wbr /&amp;gt;&amp;amp;latitude=&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=true&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434632964945&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any content (static or video) for at least three minutes. No pings will be rendered.&lt;br /&gt;
*Opt back in, a '''hello ping''' is fired off to the Nielsen server. ''Example Hello Ping'':&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-dcr.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/cfg?cfgv=200&amp;lt;wbr /&amp;gt;&amp;amp;longitude=-82.65&amp;lt;wbr /&amp;gt;&amp;amp;latitude=28.05&amp;lt;wbr /&amp;gt;&amp;amp;apid=&amp;lt;wbr /&amp;gt;&amp;amp;apv=01.00.00&amp;lt;wbr /&amp;gt;&amp;amp;apn=Nielsen%2520sample&amp;lt;wbr /&amp;gt;&amp;amp;sdkv=aa.4.0.0&amp;lt;wbr /&amp;gt;&amp;amp;bldv=aa.4.0.0.4&amp;lt;wbr /&amp;gt;&amp;amp;nuid=00b5926fea1807638ebfe6f04af6a455c5d9b2a1ed3e39f550f44daa39d0886d&amp;lt;wbr /&amp;gt;&amp;amp;osver=ANDROID.4.4.4&amp;lt;wbr /&amp;gt;&amp;amp;devtypid=samsung-SAMSUNG-SM-N910A&amp;lt;wbr /&amp;gt;&amp;amp;devid=42ec6a26b000ccd34015ba8625ee29cd283190a8c00f1622f356e900bb5b2a23&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;tz=-14400&amp;lt;wbr /&amp;gt;&amp;amp;fmt=json&amp;lt;wbr /&amp;gt;&amp;amp;adf=&amp;lt;wbr /&amp;gt;&amp;amp;uoo=false&amp;lt;wbr /&amp;gt;&amp;amp;sfcode=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ccode=&amp;lt;wbr /&amp;gt;&amp;amp;dma=539&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1434633027479&amp;lt;/code&amp;gt;&lt;br /&gt;
*Watch any video content for at least three minutes and V/D pings – '''view''' and '''duration''' pings will be visible.&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Browser_SDK_API_Reference&amp;diff=1815</id>
		<title>Browser SDK API Reference</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Browser_SDK_API_Reference&amp;diff=1815"/>
		<updated>2017-10-24T11:37:27Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Step 1: Configure Content Management System (CMS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Setting up Development Environment ==&lt;br /&gt;
=== Step 1: Configure Content Management System (CMS) ===&lt;br /&gt;
Configure CMS to send the required values (see table below). Any internal CMS_variable names can be used for passing the data.&lt;br /&gt;
&lt;br /&gt;
Ensure to capture these CMS_variable names in the SDK Configuration Form.&lt;br /&gt;
&lt;br /&gt;
For more information on setting variable names, see the SDK Configuration Form included within the SDK package.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Required Data !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| dataSrc || Used when both CMS metadata and ID3 data are present in the player. Setting this field tells the SDK whether to use the CMS metadata or the ID3 payload to derive the pings || cms&lt;br /&gt;
|-&lt;br /&gt;
| type || Type of asset: ad or content || preroll, midroll, postroll, or content&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom&lt;br /&gt;
|-&lt;br /&gt;
| OCR Tag || OCR tag provided by Nielsen for implementation on the ad unit || Complete OCR URL&lt;br /&gt;
|-&lt;br /&gt;
| program || Name of program (25 character limit) || custom&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (40 character limit) || custom&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds || Length in seconds, 86400 for live stream&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || Type of ad load || &amp;quot;1&amp;quot; - Linear &amp;quot;2&amp;quot; - Dynamic(default)&lt;br /&gt;
|-&lt;br /&gt;
| hasAds || Identify if content includes Ads ||  &amp;quot;0&amp;quot; - no ads &amp;quot;1&amp;quot; - includes ads &amp;quot;2&amp;quot; - unknown(default)&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag	|| &amp;quot;y&amp;quot; - full episode &amp;quot;n&amp;quot; - non full episode&lt;br /&gt;
|-&lt;br /&gt;
| segA || Segment A (this is not available for video reporting as the episode title is reported) || custom value&lt;br /&gt;
|-&lt;br /&gt;
| segB || Custom segment B || custom value&lt;br /&gt;
|-&lt;br /&gt;
| segC || Custom segment C || custom value&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom value&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || custom value&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original air date and time in Eastern Time. For non-US countries, it should be local time. || YYYYMMDD HH24:MI:SS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Management System for Digital Audio ====&lt;br /&gt;
Digital Audio measurement is for digital-only audio content. For Digital Audio, clients should provide the parameters shown in CMS Table for Digital Audio.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Required Data !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| dataSrc ** || Source of the data. For Digital Audio, pass dataSrc as “cms”. || cms&lt;br /&gt;
|-&lt;br /&gt;
| type || Type of content . For Digital Audio, set type as “radio”. || radio&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Station identifier, should include call letters and band. || WXYZ-FM&lt;br /&gt;
|-&lt;br /&gt;
| stationType || OTA station flag and / or OTA station type &lt;br /&gt;
*0: Custom station built per user &lt;br /&gt;
*1: OTA streaming station with the same ad load &lt;br /&gt;
*2: OTA station with a different ad load &lt;br /&gt;
*3: Multicast eRadio or online station &lt;br /&gt;
*4: On Demand Audio (podcasting) &lt;br /&gt;
|| 0, 1, 2, 3, or 4&lt;br /&gt;
|-&lt;br /&gt;
| provider || Name of Provider || XYZ Provider&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Complete the Nielsen SDK Configuration Form ===&lt;br /&gt;
The SDK is designed to map the &amp;lt;code&amp;gt;CMS_variable names&amp;lt;/code&amp;gt;. To support the custom mapping, the developer is required to complete the SDK Configuration Form. The form will be provided during onboarding along with this guide.&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
=== Obtain the Nielsen Application ID (apid) and Browser SDK URLs ===&lt;br /&gt;
The Nielsen &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; is required to enable SDK functionality. Technical Account Manager will provide an apid for each player configuration.  &lt;br /&gt;
Browser SDK can support URLs that use any of the protocols – HTTPS and HTTP.  &lt;br /&gt;
&lt;br /&gt;
=== Configure Browser SDK ===&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&lt;br /&gt;
'''Add Static Queue Snippet'''&lt;br /&gt;
&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Create SDK Instance'''&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
&lt;br /&gt;
=== SDK Initialization – Global Parameters ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || UniqueID assigned to player/site. || 	'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing || &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The debug parameter, &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt;, is only used for testing and should be removed before moving to production. The output is displayed in console debuggers when enabled.&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Browser SDK API Methods &amp;amp; Properties ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method / Property !! Event # !! DTVR !! DAR !! Digital Audio !! DCR !! International (Germany) !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[loadMetadata (Browser)]] || 3 || ✔ || ✔ || ✔ || ✔ || ✔ || Used when there is a preroll ad that needs to be associated with content metadata. The loadMetadata will first be called to populate the content metadata values and then the loadMetadata for ad metadata will be called. This allows sending a content ping with the ad info, even if the user bails out during the preroll ad.&lt;br /&gt;
|-&lt;br /&gt;
| [[play (Browser)]] || 5 || ✔ || ✘ || ✘ || ✔ || ✔ || Used when there is an ID3 fed product such as DTVR and the client does not want to send in all the CMS metadata that is sent in loadMetadata. This allows the client to send in at least the required “channel name” value associated to the ID3 feed. When the client passes in the channelName, they can change the CMS data stored by passing new values. If this event is not called then the “channel name” value populated will be the default value of “defaultChannelName”.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''VA Beacon:''' Called when content or ads start playing. The playhead position must be passed.&lt;br /&gt;
|-&lt;br /&gt;
| [[sendID3 (Browser)]] || 55 || ✔ || ✘ || ✘ || ✘ || ✘ || Used to send the ID3 metadata.&lt;br /&gt;
|-&lt;br /&gt;
| [[setPlayheadPosition (Browser)]] || 49 || ✘ || ✘ || ✔ || ✔ || ✔ || Used to send the playhead position.&lt;br /&gt;
|-&lt;br /&gt;
| [[stop (Browser)]] || 7 || ✘ || ✘ || ✘ || ✔ || ✔ || Used when switching between ad and content or content and ad.&lt;br /&gt;
|-&lt;br /&gt;
| [[end (Browser)]] || 57 || ✔ || ✘ || ✔ || ✔ || ✔ || This is triggered 1) at the end of the content stream, 2) if the user switches to another piece of content 3) when the browser is refreshed or closed&lt;br /&gt;
|-&lt;br /&gt;
| [[staticstart (Browser)]] || 14 || ✘ || ✘ || ✘ || ✔ || ✔ || Used to send the metadata for the static page.&lt;br /&gt;
|-&lt;br /&gt;
| [[getOptOutStatus (Browser)]] || 4 || ✘ || ✘ || ✘ || ✘ || ✔ || '''VA Beacon Only:''' Sent only after calling stop. The current position must be passed. Not needed for new International (Germany) implementations.&lt;br /&gt;
|-&lt;br /&gt;
| [[updateOTT (Browser)]] || - || ✘ || ✘ || ✘ || ✘ || ✔ || Used to notify Browser SDK that the remote OTT device (like Google ChromeCast, Roku, Amazon FireTV, etc.) is connected / disconnected (change of OTT status).&lt;br /&gt;
|-&lt;br /&gt;
| [[ onPaginate (Browser)]] || 30 || ✘ || ✘ || ✘ || ✔ || ✔ || Used to create a new instance of the SDK object&lt;br /&gt;
|-&lt;br /&gt;
| [[updateMetadata (Browser)]] || 35 || ✔ || ✔ || ✔ || ✔ || ✔ || This event is used for updating metadata parameters for the content or ad that is being played.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Retrieving ID3 Tags ==&lt;br /&gt;
The video player must have the ability to extract ID3 tags and supply them to the Browser SDK, based on the HLS standard.&lt;br /&gt;
*An ID3 tag spans two PES packets.&lt;br /&gt;
**In the first PES packet, look for www.nielsen.com, this is the start of the ID3 tag. Continue to parse the first PES packet until the undefined char &amp;quot;\ufffd&amp;quot; is found. This forms the first half of the ID3 tag&lt;br /&gt;
**In the second PES packet, identify the end pattern – a regEx of /(\/\d+){3}/ and look to remove the lowest index of either &amp;quot;\x00&amp;quot; and/or &amp;quot;\ufffd&amp;quot;. Now the second packet has been appended and the demarcation of the Nielsen-specific data has been defined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Follow the procedure below, to extract Nielsen ID3 tags from an MPEG-2 transport stream (including HLS streams).&lt;br /&gt;
#Parse the Program Map Table (PMT) to find the PID of the metadata stream. Confirm the presence of the metadata descriptor described in section 2.3.3 of Apple’s “HTTP Live Streaming Metadata Spec.pdf”. Only private streams with metadata descriptor present should be considered as ID3-tag metadata streams.&lt;br /&gt;
#Parse the HLS/Transport stream for any '''PES header''' with the PID found in step 1.&lt;br /&gt;
#Follow standard MPEG-2 parsing procedures to locate the start of the payload of the PES packet.&lt;br /&gt;
#Copy the PES payload into a buffer.&lt;br /&gt;
#The ID3 tag spans 2 PES packets. Parse the stream for the next packet whose PID is set to the PID found in step 1. Typically the ID3 Tag is of 249 bytes. The steps below guide towards extraction of the ID3 tag&lt;br /&gt;
##In the first PES packet, look for &amp;quot;www.nielsen.com&amp;quot; , this is the start of the ID3 tag. Keep on parsing the first PES packet until the undefined char &amp;quot;\ufffd&amp;quot; is found. This forms the first half of the ID3 tag&lt;br /&gt;
##In the second PES packet, identify the end pattern, a regEx of /(\/\d+){3}/ and look to remove the lowest index of either “\x00” and/or “\ufffd”. Now the second packet has been appended and the demarcation of the Nielsen specific data has been defined. This segment can be simply substringed.&lt;br /&gt;
##Concatenate this substringed segment with the payload derived from the first packet get the ID3 payload.&lt;br /&gt;
#Check the length of the contents in the buffer to make sure that it is equal to the size of a Nielsen ID3 tag.&lt;br /&gt;
#Ensure that the ID3 byte array is converted into the string and escape it, so that the SDK can consume it.&lt;br /&gt;
Repeat steps 2 through 7 for all ID3 tags in the stream.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
*[http://www.iso.org/iso/catalogue_detail?csnumber=44169. ISO/IEC 13818-1:2007] Information technology – Generic coding of moving pictures and associated audio information: Systems&lt;br /&gt;
*https://developer.apple.com/library/ios/sdk/developers/AudioVideo/Conceptual/HTTP_Live_Streaming_Metadata_Spec/HTTP_Live_Streaming_Metadata_Spec.pdf&lt;br /&gt;
&lt;br /&gt;
=== Sample ID3 tags ===&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/X100zdCIGeIlgZnkYj6UvQ==/AAAB2Jz2_k74GXSzx4npHuI_&amp;lt;wbr /&amp;gt;JwJd3QSUpW30rDkGTcbHEzIMWleCzM-uvNOP9fzJcQMWQLJqzXMCAxParOb5sGijSV9dNM3QiBniJYGZ5GI-lL1fXTTN0IgZ4iWBmeRiPpS9AAAAAAAAAAAAAAAAAAAAAFJWFM5SVhTONNU=/00000/00000/00&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/R8WHe7pEBeqBhu8jTeXydg==/AAICoyitYqlxT7n6aZ0oMCGhe&amp;lt;wbr /&amp;gt;Fi4CXFp46AMUPZz1lMr_M9tr3_cjee1SHqxrOiVerMDLeyn9xzocZSKwi746Re8vNOtpNCAZjYABs_J0R25IHpvOc1HS8&amp;lt;wbr /&amp;gt;QHGgD5TgOJeS6gX100zdCIGeIlgZnkYj6UvVJWFNhSVhTiPE0=/00000/46016/00&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': ID3 tags are not applicable for International (Germany)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Browser Opt-Out Implementation ==&lt;br /&gt;
The site in which video content is being measure via Nielsen methodology must provide the means for the user to opt-out of, or opt back into Nielsen Measurement.&lt;br /&gt;
&lt;br /&gt;
For Browser-based applications, opt-out setting is stored via Nielsen cookie. Therefore, it is only necessary that users be made aware of measurement opt-out by incorporating the template below in the user interface.&lt;br /&gt;
&lt;br /&gt;
=== Sample Opt Out Template ===&lt;br /&gt;
Our properties may feature Nielsen’s proprietary measurement software which will allow to contribute to market research, like Nielsen’s TV Ratings. To learn more about this information, see http://www.nielsen.com/digitalprivacy. Nielsen’s software may collect your choices with regards to it.&lt;br /&gt;
&lt;br /&gt;
== Nielsen Privacy Requirements ==&lt;br /&gt;
Privacy protections that Nielsen ensures to have with each App SDK integration are as follows.&lt;br /&gt;
*Disclosure of viewership data collection in app store description&lt;br /&gt;
*Disclosure of viewership data collection in EULA / Privacy Policy&lt;br /&gt;
*A link in the EULA/Privacy policy, or in another conspicuous location within the App, to a Nielsen-hosted web page outlining what Nielsen is collecting and how it is being used&lt;br /&gt;
*Method for users to opt-out of Nielsen measurement, any time while using the application&lt;br /&gt;
&lt;br /&gt;
=== Ratings Data Flow ===&lt;br /&gt;
Every view of creditable and watermarked content is measured by Nielsen.&lt;br /&gt;
[[File:RatingsDataFlow.png]]&lt;br /&gt;
&lt;br /&gt;
'''Information NOT Shared'''&lt;br /&gt;
* '''With Nielsen'''&lt;br /&gt;
** User's Identity&lt;br /&gt;
* '''With Data Provider'''&lt;br /&gt;
** Content information&lt;br /&gt;
** Whether user is viewing an ad or video content&lt;br /&gt;
** Player used to play the streaming (audio / video, etc.)&lt;br /&gt;
** Values being de-duped / aggregating for&lt;br /&gt;
&lt;br /&gt;
Nielsen collects only what it needs for audience measurement. Every view of creditable, watermarked content will be measured by Nielsen.&lt;br /&gt;
&lt;br /&gt;
=== Data Collected ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of Information !! Parameter !! Transmitted to Nielsen? !! Sent to Provider?&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | Nielsen ID3 Watermark&lt;br /&gt;
|-&lt;br /&gt;
| FinalDistributor Timestamp || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Program Content Timestamp || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Mobile Breakout Code || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Commercial Credit Code – Linear or Dynamic || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Time ShiftedViewing Code || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Segment Number || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Segment View Pattern || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Device/App Info&lt;br /&gt;
|-&lt;br /&gt;
| Device OSVersion || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| Device Model || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Cache Buster || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| SDKDisabled Flag || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| ServerCode || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Channel or URL || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Nielsen Identifiers&lt;br /&gt;
|-&lt;br /&gt;
| Client ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Campaign ID || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| Nielsen Unique Device ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Application ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| DeviceGroup (ex. Tablet, Smartphone, Desktop) || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| OS Group (ex. Android, iOS, Windows) || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| SDKVersion || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| IP Address for DMA, Country Code || Yes || Yes &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': Data is hashed, and encrypted using AES 128 before transmission to data provider.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example ping sent to provider ====&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://provider.com/cgi-bin/brandlift.php&amp;lt;/nowiki&amp;gt;?campaign_id=ff12725d724fac7934cf6003f096b4cd&amp;lt;wbr /&amp;gt;&amp;amp;placement_id=a4164b8fba9ee7c873a9c72c7091bb58&amp;lt;wbr /&amp;gt;&amp;amp;creative_id=25280139b61a947e127a52f56c8a2fdd&amp;lt;wbr /&amp;gt;&amp;amp;segment1=9000&amp;lt;wbr /&amp;gt;&amp;amp;segment2=41&amp;lt;wbr /&amp;gt;&amp;amp;segment3=iOS&amp;lt;wbr /&amp;gt;&amp;amp;OSVer=iOS6.1&amp;lt;wbr /&amp;gt;&amp;amp;c9=&amp;lt;wbr /&amp;gt;&amp;amp;devgrp=tablet&amp;lt;wbr /&amp;gt;&amp;amp;h=f5f243fe6d&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1376971827360&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This ping passes the following parameters to the provider:&lt;br /&gt;
* Campaign ID – (campaign, placement, creative)&lt;br /&gt;
* Country Code&lt;br /&gt;
* DMA&lt;br /&gt;
* OS Group (ex. iOS, Android)&lt;br /&gt;
* DeviceOS Version&lt;br /&gt;
* Device Advertiser ID&lt;br /&gt;
* DeviceGroup (ex. Tablet, Smartphone, Desktop)&lt;br /&gt;
* Cache Buster&lt;br /&gt;
&lt;br /&gt;
=== Nielsen Measurement Opt-Out ===&lt;br /&gt;
The site must provide a means for the user to opt‐out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt‐out option, it is mandatory to include the following two items in the site’s privacy policy&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click '''Choices''' to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For information, please see Opt-Out Implementation below.&lt;br /&gt;
&lt;br /&gt;
=== Opt-Out Implementation ===&lt;br /&gt;
The site must provide the means for the user to opt-out of, or opt back into Nielsen Measurement.&lt;br /&gt;
&lt;br /&gt;
'''Sample Opt Out Template'''&lt;br /&gt;
&lt;br /&gt;
Our properties may feature Nielsen’s proprietary measurement software which will allow to contribute to market research, like Nielsen’s TV Ratings. To learn more about this information, please [http://www.nielsen.com/digitalprivacy| click here]. Nielsen’s software may collect your choices with regards to it.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
See [[Digital Measurement Testing#Testing Browser Implementation|Digital Measurement Testing - Testing Browser Implementation]].&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Browser_SDK_API_Reference&amp;diff=1814</id>
		<title>Browser SDK API Reference</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Browser_SDK_API_Reference&amp;diff=1814"/>
		<updated>2017-10-24T11:36:40Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Step 1: Configure Content Management System (CMS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Setting up Development Environment ==&lt;br /&gt;
=== Step 1: Configure Content Management System (CMS) ===&lt;br /&gt;
Configure CMS to send the required values (see table below). Any internal CMS_variable names can be used for passing the data.&lt;br /&gt;
&lt;br /&gt;
Ensure to capture these CMS_variable names in the SDK Configuration Form.&lt;br /&gt;
&lt;br /&gt;
For more information on setting variable names, see the SDK Configuration Form included within the SDK package.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Required Data !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| dataSrc || Used when both CMS metadata and ID3 data are present in the player. Setting this field tells the SDK whether to use the CMS metadata or the ID3 payload to derive the pings || cms&lt;br /&gt;
|-&lt;br /&gt;
| type || Type of asset: ad or content || preroll, midroll, postroll, or content&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom&lt;br /&gt;
|-&lt;br /&gt;
| OCR Tag || OCR tag provided by Nielsen for implementation on the ad unit || Complete OCR URL&lt;br /&gt;
|-&lt;br /&gt;
| program || Name of program (25 character limit) || custom&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title (40 character limit) || custom&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds || Length in seconds, 86400 for live stream&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || Type of ad load || &amp;quot;1&amp;quot; - Linear &amp;quot;2&amp;quot; Dynamic(default)&lt;br /&gt;
|-&lt;br /&gt;
| hasAds || Identify if content includes Ads ||  &amp;quot;0&amp;quot; - no ads &amp;quot;1&amp;quot; - includes ads &amp;quot;2&amp;quot; - unknown(default)&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag	|| &amp;quot;y&amp;quot; - full episode &amp;quot;n&amp;quot; - non full episode&lt;br /&gt;
|-&lt;br /&gt;
| segA || Segment A (this is not available for video reporting as the episode title is reported) || custom value&lt;br /&gt;
|-&lt;br /&gt;
| segB || Custom segment B || custom value&lt;br /&gt;
|-&lt;br /&gt;
| segC || Custom segment C || custom value&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom value&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || custom value&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original air date and time in Eastern Time. For non-US countries, it should be local time. || YYYYMMDD HH24:MI:SS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Management System for Digital Audio ====&lt;br /&gt;
Digital Audio measurement is for digital-only audio content. For Digital Audio, clients should provide the parameters shown in CMS Table for Digital Audio.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Required Data !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| dataSrc ** || Source of the data. For Digital Audio, pass dataSrc as “cms”. || cms&lt;br /&gt;
|-&lt;br /&gt;
| type || Type of content . For Digital Audio, set type as “radio”. || radio&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Station identifier, should include call letters and band. || WXYZ-FM&lt;br /&gt;
|-&lt;br /&gt;
| stationType || OTA station flag and / or OTA station type &lt;br /&gt;
*0: Custom station built per user &lt;br /&gt;
*1: OTA streaming station with the same ad load &lt;br /&gt;
*2: OTA station with a different ad load &lt;br /&gt;
*3: Multicast eRadio or online station &lt;br /&gt;
*4: On Demand Audio (podcasting) &lt;br /&gt;
|| 0, 1, 2, 3, or 4&lt;br /&gt;
|-&lt;br /&gt;
| provider || Name of Provider || XYZ Provider&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Complete the Nielsen SDK Configuration Form ===&lt;br /&gt;
The SDK is designed to map the &amp;lt;code&amp;gt;CMS_variable names&amp;lt;/code&amp;gt;. To support the custom mapping, the developer is required to complete the SDK Configuration Form. The form will be provided during onboarding along with this guide.&lt;br /&gt;
&lt;br /&gt;
== Initialization ==&lt;br /&gt;
=== Obtain the Nielsen Application ID (apid) and Browser SDK URLs ===&lt;br /&gt;
The Nielsen &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; is required to enable SDK functionality. Technical Account Manager will provide an apid for each player configuration.  &lt;br /&gt;
Browser SDK can support URLs that use any of the protocols – HTTPS and HTTP.  &lt;br /&gt;
&lt;br /&gt;
=== Configure Browser SDK ===&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&lt;br /&gt;
'''Add Static Queue Snippet'''&lt;br /&gt;
&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Create SDK Instance'''&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
&lt;br /&gt;
=== SDK Initialization – Global Parameters ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters !! Description !! Value&lt;br /&gt;
|-&lt;br /&gt;
| apid || UniqueID assigned to player/site. || 	'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing || &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' The debug parameter, &amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt;, is only used for testing and should be removed before moving to production. The output is displayed in console debuggers when enabled.&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Browser SDK API Methods &amp;amp; Properties ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method / Property !! Event # !! DTVR !! DAR !! Digital Audio !! DCR !! International (Germany) !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[loadMetadata (Browser)]] || 3 || ✔ || ✔ || ✔ || ✔ || ✔ || Used when there is a preroll ad that needs to be associated with content metadata. The loadMetadata will first be called to populate the content metadata values and then the loadMetadata for ad metadata will be called. This allows sending a content ping with the ad info, even if the user bails out during the preroll ad.&lt;br /&gt;
|-&lt;br /&gt;
| [[play (Browser)]] || 5 || ✔ || ✘ || ✘ || ✔ || ✔ || Used when there is an ID3 fed product such as DTVR and the client does not want to send in all the CMS metadata that is sent in loadMetadata. This allows the client to send in at least the required “channel name” value associated to the ID3 feed. When the client passes in the channelName, they can change the CMS data stored by passing new values. If this event is not called then the “channel name” value populated will be the default value of “defaultChannelName”.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''VA Beacon:''' Called when content or ads start playing. The playhead position must be passed.&lt;br /&gt;
|-&lt;br /&gt;
| [[sendID3 (Browser)]] || 55 || ✔ || ✘ || ✘ || ✘ || ✘ || Used to send the ID3 metadata.&lt;br /&gt;
|-&lt;br /&gt;
| [[setPlayheadPosition (Browser)]] || 49 || ✘ || ✘ || ✔ || ✔ || ✔ || Used to send the playhead position.&lt;br /&gt;
|-&lt;br /&gt;
| [[stop (Browser)]] || 7 || ✘ || ✘ || ✘ || ✔ || ✔ || Used when switching between ad and content or content and ad.&lt;br /&gt;
|-&lt;br /&gt;
| [[end (Browser)]] || 57 || ✔ || ✘ || ✔ || ✔ || ✔ || This is triggered 1) at the end of the content stream, 2) if the user switches to another piece of content 3) when the browser is refreshed or closed&lt;br /&gt;
|-&lt;br /&gt;
| [[staticstart (Browser)]] || 14 || ✘ || ✘ || ✘ || ✔ || ✔ || Used to send the metadata for the static page.&lt;br /&gt;
|-&lt;br /&gt;
| [[getOptOutStatus (Browser)]] || 4 || ✘ || ✘ || ✘ || ✘ || ✔ || '''VA Beacon Only:''' Sent only after calling stop. The current position must be passed. Not needed for new International (Germany) implementations.&lt;br /&gt;
|-&lt;br /&gt;
| [[updateOTT (Browser)]] || - || ✘ || ✘ || ✘ || ✘ || ✔ || Used to notify Browser SDK that the remote OTT device (like Google ChromeCast, Roku, Amazon FireTV, etc.) is connected / disconnected (change of OTT status).&lt;br /&gt;
|-&lt;br /&gt;
| [[ onPaginate (Browser)]] || 30 || ✘ || ✘ || ✘ || ✔ || ✔ || Used to create a new instance of the SDK object&lt;br /&gt;
|-&lt;br /&gt;
| [[updateMetadata (Browser)]] || 35 || ✔ || ✔ || ✔ || ✔ || ✔ || This event is used for updating metadata parameters for the content or ad that is being played.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Retrieving ID3 Tags ==&lt;br /&gt;
The video player must have the ability to extract ID3 tags and supply them to the Browser SDK, based on the HLS standard.&lt;br /&gt;
*An ID3 tag spans two PES packets.&lt;br /&gt;
**In the first PES packet, look for www.nielsen.com, this is the start of the ID3 tag. Continue to parse the first PES packet until the undefined char &amp;quot;\ufffd&amp;quot; is found. This forms the first half of the ID3 tag&lt;br /&gt;
**In the second PES packet, identify the end pattern – a regEx of /(\/\d+){3}/ and look to remove the lowest index of either &amp;quot;\x00&amp;quot; and/or &amp;quot;\ufffd&amp;quot;. Now the second packet has been appended and the demarcation of the Nielsen-specific data has been defined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Follow the procedure below, to extract Nielsen ID3 tags from an MPEG-2 transport stream (including HLS streams).&lt;br /&gt;
#Parse the Program Map Table (PMT) to find the PID of the metadata stream. Confirm the presence of the metadata descriptor described in section 2.3.3 of Apple’s “HTTP Live Streaming Metadata Spec.pdf”. Only private streams with metadata descriptor present should be considered as ID3-tag metadata streams.&lt;br /&gt;
#Parse the HLS/Transport stream for any '''PES header''' with the PID found in step 1.&lt;br /&gt;
#Follow standard MPEG-2 parsing procedures to locate the start of the payload of the PES packet.&lt;br /&gt;
#Copy the PES payload into a buffer.&lt;br /&gt;
#The ID3 tag spans 2 PES packets. Parse the stream for the next packet whose PID is set to the PID found in step 1. Typically the ID3 Tag is of 249 bytes. The steps below guide towards extraction of the ID3 tag&lt;br /&gt;
##In the first PES packet, look for &amp;quot;www.nielsen.com&amp;quot; , this is the start of the ID3 tag. Keep on parsing the first PES packet until the undefined char &amp;quot;\ufffd&amp;quot; is found. This forms the first half of the ID3 tag&lt;br /&gt;
##In the second PES packet, identify the end pattern, a regEx of /(\/\d+){3}/ and look to remove the lowest index of either “\x00” and/or “\ufffd”. Now the second packet has been appended and the demarcation of the Nielsen specific data has been defined. This segment can be simply substringed.&lt;br /&gt;
##Concatenate this substringed segment with the payload derived from the first packet get the ID3 payload.&lt;br /&gt;
#Check the length of the contents in the buffer to make sure that it is equal to the size of a Nielsen ID3 tag.&lt;br /&gt;
#Ensure that the ID3 byte array is converted into the string and escape it, so that the SDK can consume it.&lt;br /&gt;
Repeat steps 2 through 7 for all ID3 tags in the stream.&lt;br /&gt;
&lt;br /&gt;
'''References'''&lt;br /&gt;
*[http://www.iso.org/iso/catalogue_detail?csnumber=44169. ISO/IEC 13818-1:2007] Information technology – Generic coding of moving pictures and associated audio information: Systems&lt;br /&gt;
*https://developer.apple.com/library/ios/sdk/developers/AudioVideo/Conceptual/HTTP_Live_Streaming_Metadata_Spec/HTTP_Live_Streaming_Metadata_Spec.pdf&lt;br /&gt;
&lt;br /&gt;
=== Sample ID3 tags ===&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/X100zdCIGeIlgZnkYj6UvQ==/AAAB2Jz2_k74GXSzx4npHuI_&amp;lt;wbr /&amp;gt;JwJd3QSUpW30rDkGTcbHEzIMWleCzM-uvNOP9fzJcQMWQLJqzXMCAxParOb5sGijSV9dNM3QiBniJYGZ5GI-lL1fXTTN0IgZ4iWBmeRiPpS9AAAAAAAAAAAAAAAAAAAAAFJWFM5SVhTONNU=/00000/00000/00&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/R8WHe7pEBeqBhu8jTeXydg==/AAICoyitYqlxT7n6aZ0oMCGhe&amp;lt;wbr /&amp;gt;Fi4CXFp46AMUPZz1lMr_M9tr3_cjee1SHqxrOiVerMDLeyn9xzocZSKwi746Re8vNOtpNCAZjYABs_J0R25IHpvOc1HS8&amp;lt;wbr /&amp;gt;QHGgD5TgOJeS6gX100zdCIGeIlgZnkYj6UvVJWFNhSVhTiPE0=/00000/46016/00&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': ID3 tags are not applicable for International (Germany)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Browser Opt-Out Implementation ==&lt;br /&gt;
The site in which video content is being measure via Nielsen methodology must provide the means for the user to opt-out of, or opt back into Nielsen Measurement.&lt;br /&gt;
&lt;br /&gt;
For Browser-based applications, opt-out setting is stored via Nielsen cookie. Therefore, it is only necessary that users be made aware of measurement opt-out by incorporating the template below in the user interface.&lt;br /&gt;
&lt;br /&gt;
=== Sample Opt Out Template ===&lt;br /&gt;
Our properties may feature Nielsen’s proprietary measurement software which will allow to contribute to market research, like Nielsen’s TV Ratings. To learn more about this information, see http://www.nielsen.com/digitalprivacy. Nielsen’s software may collect your choices with regards to it.&lt;br /&gt;
&lt;br /&gt;
== Nielsen Privacy Requirements ==&lt;br /&gt;
Privacy protections that Nielsen ensures to have with each App SDK integration are as follows.&lt;br /&gt;
*Disclosure of viewership data collection in app store description&lt;br /&gt;
*Disclosure of viewership data collection in EULA / Privacy Policy&lt;br /&gt;
*A link in the EULA/Privacy policy, or in another conspicuous location within the App, to a Nielsen-hosted web page outlining what Nielsen is collecting and how it is being used&lt;br /&gt;
*Method for users to opt-out of Nielsen measurement, any time while using the application&lt;br /&gt;
&lt;br /&gt;
=== Ratings Data Flow ===&lt;br /&gt;
Every view of creditable and watermarked content is measured by Nielsen.&lt;br /&gt;
[[File:RatingsDataFlow.png]]&lt;br /&gt;
&lt;br /&gt;
'''Information NOT Shared'''&lt;br /&gt;
* '''With Nielsen'''&lt;br /&gt;
** User's Identity&lt;br /&gt;
* '''With Data Provider'''&lt;br /&gt;
** Content information&lt;br /&gt;
** Whether user is viewing an ad or video content&lt;br /&gt;
** Player used to play the streaming (audio / video, etc.)&lt;br /&gt;
** Values being de-duped / aggregating for&lt;br /&gt;
&lt;br /&gt;
Nielsen collects only what it needs for audience measurement. Every view of creditable, watermarked content will be measured by Nielsen.&lt;br /&gt;
&lt;br /&gt;
=== Data Collected ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of Information !! Parameter !! Transmitted to Nielsen? !! Sent to Provider?&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | Nielsen ID3 Watermark&lt;br /&gt;
|-&lt;br /&gt;
| FinalDistributor Timestamp || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Program Content Timestamp || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Mobile Breakout Code || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Commercial Credit Code – Linear or Dynamic || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Time ShiftedViewing Code || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Segment Number || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Segment View Pattern || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Device/App Info&lt;br /&gt;
|-&lt;br /&gt;
| Device OSVersion || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| Device Model || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Cache Buster || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| SDKDisabled Flag || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| ServerCode || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Channel or URL || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Nielsen Identifiers&lt;br /&gt;
|-&lt;br /&gt;
| Client ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Campaign ID || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| Nielsen Unique Device ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Application ID || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| DeviceGroup (ex. Tablet, Smartphone, Desktop) || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| OS Group (ex. Android, iOS, Windows) || Yes || Yes &lt;br /&gt;
|-&lt;br /&gt;
| SDKVersion || Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| IP Address for DMA, Country Code || Yes || Yes &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': Data is hashed, and encrypted using AES 128 before transmission to data provider.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example ping sent to provider ====&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://provider.com/cgi-bin/brandlift.php&amp;lt;/nowiki&amp;gt;?campaign_id=ff12725d724fac7934cf6003f096b4cd&amp;lt;wbr /&amp;gt;&amp;amp;placement_id=a4164b8fba9ee7c873a9c72c7091bb58&amp;lt;wbr /&amp;gt;&amp;amp;creative_id=25280139b61a947e127a52f56c8a2fdd&amp;lt;wbr /&amp;gt;&amp;amp;segment1=9000&amp;lt;wbr /&amp;gt;&amp;amp;segment2=41&amp;lt;wbr /&amp;gt;&amp;amp;segment3=iOS&amp;lt;wbr /&amp;gt;&amp;amp;OSVer=iOS6.1&amp;lt;wbr /&amp;gt;&amp;amp;c9=&amp;lt;wbr /&amp;gt;&amp;amp;devgrp=tablet&amp;lt;wbr /&amp;gt;&amp;amp;h=f5f243fe6d&amp;lt;wbr /&amp;gt;&amp;amp;rnd=1376971827360&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This ping passes the following parameters to the provider:&lt;br /&gt;
* Campaign ID – (campaign, placement, creative)&lt;br /&gt;
* Country Code&lt;br /&gt;
* DMA&lt;br /&gt;
* OS Group (ex. iOS, Android)&lt;br /&gt;
* DeviceOS Version&lt;br /&gt;
* Device Advertiser ID&lt;br /&gt;
* DeviceGroup (ex. Tablet, Smartphone, Desktop)&lt;br /&gt;
* Cache Buster&lt;br /&gt;
&lt;br /&gt;
=== Nielsen Measurement Opt-Out ===&lt;br /&gt;
The site must provide a means for the user to opt‐out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt‐out option, it is mandatory to include the following two items in the site’s privacy policy&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click '''Choices''' to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Our properties may feature Nielsen proprietary measurement software, which will allow you to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, refer to Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For information, please see Opt-Out Implementation below.&lt;br /&gt;
&lt;br /&gt;
=== Opt-Out Implementation ===&lt;br /&gt;
The site must provide the means for the user to opt-out of, or opt back into Nielsen Measurement.&lt;br /&gt;
&lt;br /&gt;
'''Sample Opt Out Template'''&lt;br /&gt;
&lt;br /&gt;
Our properties may feature Nielsen’s proprietary measurement software which will allow to contribute to market research, like Nielsen’s TV Ratings. To learn more about this information, please [http://www.nielsen.com/digitalprivacy| click here]. Nielsen’s software may collect your choices with regards to it.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
See [[Digital Measurement Testing#Testing Browser Implementation|Digital Measurement Testing - Testing Browser Implementation]].&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Browser_SDK_(6.0.0)&amp;diff=1426</id>
		<title>DCR Static Browser SDK (6.0.0)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Browser_SDK_(6.0.0)&amp;diff=1426"/>
		<updated>2017-09-11T18:31:55Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
'''Prior Version Guide:''' [[DCR Static Browser SDK (5.1.1)|5.1.1]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
=== Add Tracking Code ===&lt;br /&gt;
The Nielsen DCR Tracking Code must be added to each page.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
  // Static Queue Snippet&lt;br /&gt;
!function(t,n){t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i){return s=t.document,r=s.createElement(&amp;quot;script&amp;quot;),r.async=1,r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),t[n][o]=t[n][o]||{g:c||{},ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]}}}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // SDK Initialization&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
  &lt;br /&gt;
  // Content Metadata &lt;br /&gt;
  var nielsenMetadata = {&lt;br /&gt;
    type: 'static', &lt;br /&gt;
    assetid: '', // *DYNAMIC METADATA*: unique ID for each article **REQUIRED**&lt;br /&gt;
    section: '', // *DYNAMIC METADATA*: section of site **REQUIRED**&lt;br /&gt;
    segA: '', // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    segB: '', // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    segC: ''  // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    }; &lt;br /&gt;
    &lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tracking Code Components ====&lt;br /&gt;
The tracking code includes&lt;br /&gt;
* Static Queue Snippet&lt;br /&gt;
* SDK Initialization&lt;br /&gt;
* Content Metadata&lt;br /&gt;
* staticstart Event&lt;br /&gt;
&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n){t[n]=t[n]||&lt;br /&gt;
{&lt;br /&gt;
  nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
      return s=t.document,&lt;br /&gt;
      r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
      r.async=1,&lt;br /&gt;
      r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),&lt;br /&gt;
      t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},t[o]}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static config file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and cached by the client-side browser(s).&lt;br /&gt;
&lt;br /&gt;
Once the static config file is downloaded, the SDK will be fully downloaded and initialized. All SDK modules are included in one file:&lt;br /&gt;
&amp;quot;nlsSDK600.bundle.min.js&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Content Metadata'''&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. The tracking code includes the Nielsen reserved keys and placeholder values.&lt;br /&gt;
&lt;br /&gt;
Pass dynamic metadata for the keys with the &amp;lt;code&amp;gt;&amp;lt;metadataPlaceholder&amp;gt;&amp;lt;/code&amp;gt; value (e.g. &amp;lt;code&amp;gt;section: ''&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''staticstart Event'''&lt;br /&gt;
&lt;br /&gt;
There is only one event call required:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter when calling 'staticstart' event . To know more about configuring metadata refer [[Bundled_SDK_-_Static#Configure_Metadata|Step 3]].&lt;br /&gt;
&lt;br /&gt;
=== Pass App ID in Initialization Call ===&lt;br /&gt;
Pass the unique App ID in the first parameter of the initialization call, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has three parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site. || &amp;lt;code&amp;gt;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || Any string value&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug: &amp;quot;debug&amp;quot; || Enables Nielsen console logging. Only required for testing || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Update &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt; with the AppID provided. Refer to the [[#Going_Live|Going Live]] section to know about updating the AppID to production after testing is completed.&lt;br /&gt;
&lt;br /&gt;
=== Configure Metadata ===&lt;br /&gt;
Map the Nielsen keys to variables so that the content metadata is dynamically updated.&lt;br /&gt;
&lt;br /&gt;
The Nielsen reserved keys are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID for each article || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of each site (e.g. section value should be first level in page URL: website.com/section). Limit to 25 unique values || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segA || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || fixed || custom || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
'''Aggregation Limits'''&lt;br /&gt;
There are limits on the number of unique values that can be aggregated on in reporting. The specific limitations by key are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Aggregation Limit&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segA || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segB || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segC || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement, the properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will refire the view ping with the existing/original metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;onPaginate&amp;quot;, scrolloffset);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;23%&amp;quot;| Parameter&lt;br /&gt;
!width=&amp;quot;19%&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
| event&lt;br /&gt;
| &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| scrolloffset&lt;br /&gt;
| The &amp;lt;code&amp;gt;scrolloffset&amp;lt;/code&amp;gt; value should be the y-scroll position:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== onPaginate ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onPageinate&amp;lt;/code&amp;gt; is a slightly modified version of &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; to enable tracking of user’s focus in pages with continuous scrolling. &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event provides the same behavior as &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; keeping it local to only clients who wish to implement continuous scrolling. (Note: This event &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will not reset the page duration timer.)&lt;br /&gt;
&lt;br /&gt;
* The maximum number of static View pings allowed per session is ‘1’. This is enforced via the &amp;lt;code&amp;gt;nol_maxPingCount&amp;lt;/code&amp;gt; parameter in the tag and the cadence of impression.&lt;br /&gt;
* When an &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event is called at the end of section / a focus shift (within the same page), this filter will reset the current ping count to ‘0’ for the static View ping. This change of value will cause a new View ping when the Browser SDK receives the next &amp;lt;code&amp;gt;staticPosition&amp;lt;/code&amp;gt; event (at the section end). This sequence continues through the end of scrolling or till the close of static page session.&lt;br /&gt;
&lt;br /&gt;
[[File:StaticPageEvent35.jpg|center|link=]]&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1425</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1425"/>
		<updated>2017-09-11T18:31:02Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Nielsen Opt-Out */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1424</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1424"/>
		<updated>2017-09-11T18:30:07Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Configure SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Change the apid to the production ID starting with the letter 'P'. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1423</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1423"/>
		<updated>2017-09-11T18:29:17Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'TXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Change the apid to the production ID starting with the letter 'P'. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1422</id>
		<title>DCR Italy Video Browser SDK (6.0.1)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Video_Browser_SDK_(6.0.1)&amp;diff=1422"/>
		<updated>2017-09-08T09:14:51Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show how to integrate the Nielsen Software Development Kit (SDK) to enable Digital Content Ratings (DCR) video measurement on browser players.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;TXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
* Add Static Queue Snippet&lt;br /&gt;
* Create SDK Instance&lt;br /&gt;
&lt;br /&gt;
=== Add Static Queue Snippet ===&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Create SDK Instance ===&lt;br /&gt;
&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site || &amp;lt;code&amp;gt;'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || &amp;lt;code&amp;gt;&amp;quot;any string value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug || Enables Nielsen console logging. Only required for testing || &amp;lt;code&amp;gt;&amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK601.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create Metadata Objects ==&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
* content: identify video&lt;br /&gt;
* ad: identify each ad&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| vcid || VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*video – &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID assigned to content || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. The estimated content length has to be passed for live content. || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (86400 for live stream) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL || URL location of the content being streamed || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (Eastern Time for US) || &amp;lt;code&amp;gt;YYYYMMDD HH24:MI:SS&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt; - full episode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt; - non-full episode&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || &lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || &lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || Nielsen provided || &lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Linear&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Dynamic&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|| hasAds || Whether the content is ad supported ||&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; - No Ads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; - Ad Supported&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - Unknown (default)&lt;br /&gt;
|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create content object&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2',&lt;br /&gt;
  hasAds:         '1'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Object ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || uniqueID assigned to ad || &amp;lt;code&amp;gt;custom&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//create ad object&lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''URL Character Limit:''' There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers.&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
The method for calling events is &amp;lt;code&amp;gt;ggPM()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM('event', parameter, ...);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
The events are included in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Number !! Values to pass !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'3'&amp;lt;/code&amp;gt; || content/ad metadata object || Load metadata event for content.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'5'&amp;lt;/code&amp;gt; || playhead position || Call when content or ads start playing. &lt;br /&gt;
&lt;br /&gt;
'''VOD''': The playhead position must be passed. &lt;br /&gt;
&lt;br /&gt;
'''Live''': Playhead in seconds from 1970&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'6'&amp;lt;/code&amp;gt; || playhead position || Call when content or ads start playing. &lt;br /&gt;
&lt;br /&gt;
'''VOD''': The playhead position must be passed. &lt;br /&gt;
&lt;br /&gt;
'''Live''': Playhead in seconds from 1970&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt; || playhead position || Call when content or ads complete playing. The playhead position must be passed when calling stop&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt; || content/ad metadata object || Call at the beginning of each asset, don’t use ‘play’ if event 15 is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; || playhead position || '''VOD''': current position in seconds. &lt;br /&gt;
&lt;br /&gt;
'''Live''': current unix timestamp Notehas to be called on a secondly basis&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt; || playhead position || This event has to be called for the current video asset at the end of the playback.&lt;br /&gt;
&lt;br /&gt;
'''Example''': at the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Lifecycle ===&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;//Start of stream&lt;br /&gt;
nSdkInstance.ggPM('3', contentMetadataObject);&lt;br /&gt;
 &lt;br /&gt;
//Preroll&lt;br /&gt;
nSdkInstance.ggPM('15', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // Event 49 should be fired every second with playhead starting from 0&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
//Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // Event 49 should be fired every second with playhead starting from 0 if this is the first segment&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
//Midroll&lt;br /&gt;
nSdkInstance.ggPM('15', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // Event 49 should be fired every second with playhead starting from 0&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
//Content&lt;br /&gt;
nSdkInstance.ggPM('5',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('49', contentPlayheadPosition); // Event 49 should be fired every second with playhead starting from where it left off before mid-roll&lt;br /&gt;
nSdkInstance.ggPM('6',  contentPlayheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('57', contentPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
//Postroll&lt;br /&gt;
nSdkInstance.ggPM('15', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('49', individualAdPlayheadPosition); // Event 49 should be fired every second with playhead starting from 0&lt;br /&gt;
nSdkInstance.ggPM('7',  individualAdPlayheadPosition);&lt;br /&gt;
 &lt;br /&gt;
//End of Stream&lt;br /&gt;
nSdkInstance.ggPM('7',  contentPlayheadPosition);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': Event &amp;lt;code&amp;gt;'49'&amp;lt;/code&amp;gt; is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling event &amp;lt;code&amp;gt;'7'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'57'&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;'15'&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Handling Pause'''&lt;br /&gt;
The event &amp;lt;code&amp;gt;49&amp;lt;/code&amp;gt; is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
'''Interruption Scenarios'''&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate  for the ad&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate  and  for the content&lt;br /&gt;
  nSdkInstance.ggPM('57', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('7', playheadPosition);&lt;br /&gt;
});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&lt;br /&gt;
''The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.''&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1417</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1417"/>
		<updated>2017-09-04T14:33:38Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Nielsen Opt-Out */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'TXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Change the apid to the production ID starting with the letter 'P'. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Browser_SDK_(6.0.0)&amp;diff=1416</id>
		<title>DCR Static Browser SDK (6.0.0)</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Browser_SDK_(6.0.0)&amp;diff=1416"/>
		<updated>2017-09-04T11:40:59Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
'''Prior Version Guide:''' [[DCR Static Browser SDK (5.1.1)|5.1.1]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
=== Add Tracking Code ===&lt;br /&gt;
The Nielsen DCR Tracking Code must be added to each page.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&amp;lt;script&amp;gt;&lt;br /&gt;
  // Static Queue Snippet&lt;br /&gt;
!function(t,n){t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i){return s=t.document,r=s.createElement(&amp;quot;script&amp;quot;),r.async=1,r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),t[n][o]=t[n][o]||{g:c||{},ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]}}}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // SDK Initialization&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
  &lt;br /&gt;
  // Content Metadata &lt;br /&gt;
  var nielsenMetadata = {&lt;br /&gt;
    type: 'static', &lt;br /&gt;
    assetid: '', // *DYNAMIC METADATA*: unique ID for each article **REQUIRED**&lt;br /&gt;
    section: '', // *DYNAMIC METADATA*: section of site **REQUIRED**&lt;br /&gt;
    segA: '', // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    segB: '', // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    segC: ''  // *DYNAMIC METADATA*: custom segment&lt;br /&gt;
    }; &lt;br /&gt;
    &lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tracking Code Components ====&lt;br /&gt;
The tracking code includes&lt;br /&gt;
* Static Queue Snippet&lt;br /&gt;
* SDK Initialization&lt;br /&gt;
* Content Metadata&lt;br /&gt;
* staticstart Event&lt;br /&gt;
&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(t,n){t[n]=t[n]||&lt;br /&gt;
{&lt;br /&gt;
  nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
      return s=t.document,&lt;br /&gt;
      r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
      r.async=1,&lt;br /&gt;
      r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],i.parentNode.insertBefore(r,i),&lt;br /&gt;
      t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},t[o]}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static config file, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;.js&amp;lt;/code&amp;gt;, will be downloaded based on the &amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; and cached by the client-side browser(s).&lt;br /&gt;
&lt;br /&gt;
Once the static config file is downloaded, the SDK will be fully downloaded and initialized. All SDK modules are included in one file:&lt;br /&gt;
&amp;quot;nlsSDK600.bundle.min.js&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Content Metadata'''&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. The tracking code includes the Nielsen reserved keys and placeholder values.&lt;br /&gt;
&lt;br /&gt;
Pass dynamic metadata for the keys with the &amp;lt;code&amp;gt;&amp;lt;metadataPlaceholder&amp;gt;&amp;lt;/code&amp;gt; value (e.g. &amp;lt;code&amp;gt;section: ''&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''staticstart Event'''&lt;br /&gt;
&lt;br /&gt;
There is only one event call required:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter when calling 'staticstart' event . To know more about configuring metadata refer [[Bundled_SDK_-_Static#Configure_Metadata|Step 3]].&lt;br /&gt;
&lt;br /&gt;
=== Pass App ID in Initialization Call ===&lt;br /&gt;
Pass the unique App ID in the first parameter of the initialization call, &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has three parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid || Unique ID assigned to player/site. || &amp;lt;code&amp;gt;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || Name of SDK instance || Any string value&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug: &amp;quot;debug&amp;quot; || Enables Nielsen console logging. Only required for testing || &amp;lt;code&amp;gt;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Update &amp;lt;code&amp;gt;&amp;lt;apid&amp;gt;&amp;lt;/code&amp;gt; with the AppID provided. Refer to the [[#Going_Live|Going Live]] section to know about updating the AppID to production after testing is completed.&lt;br /&gt;
&lt;br /&gt;
=== Configure Metadata ===&lt;br /&gt;
Map the Nielsen keys to variables so that the content metadata is dynamically updated.&lt;br /&gt;
&lt;br /&gt;
The Nielsen reserved keys are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID for each article || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of each site (e.g. section value should be first level in page URL: website.com/section). Limit to 25 unique values || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segA || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || fixed || custom || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
'''Aggregation Limits'''&lt;br /&gt;
There are limits on the number of unique values that can be aggregated on in reporting. The specific limitations by key are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Aggregation Limit&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segA || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segB || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segC || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy&lt;br /&gt;
* A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings)&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&lt;br /&gt;
The following paragraph is a template for an opt-out statement, the properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will refire the view ping with the existing/original metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;onPaginate&amp;quot;, scrolloffset);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;23%&amp;quot;| Parameter&lt;br /&gt;
!width=&amp;quot;19%&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
| event&lt;br /&gt;
| &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| scrolloffset&lt;br /&gt;
| The &amp;lt;code&amp;gt;scrolloffset&amp;lt;/code&amp;gt; value should be the y-scroll position:&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== onPaginate ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onPageinate&amp;lt;/code&amp;gt; is a slightly modified version of &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; to enable tracking of user’s focus in pages with continuous scrolling. &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event provides the same behavior as &amp;lt;code&amp;gt;staticstart&amp;lt;/code&amp;gt; keeping it local to only clients who wish to implement continuous scrolling. (Note: This event &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; will not reset the page duration timer.)&lt;br /&gt;
&lt;br /&gt;
* The maximum number of static View pings allowed per session is ‘1’. This is enforced via the &amp;lt;code&amp;gt;nol_maxPingCount&amp;lt;/code&amp;gt; parameter in the tag and the cadence of impression.&lt;br /&gt;
* When an &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event is called at the end of section / a focus shift (within the same page), this filter will reset the current ping count to ‘0’ for the static View ping. This change of value will cause a new View ping when the Browser SDK receives the next &amp;lt;code&amp;gt;staticPosition&amp;lt;/code&amp;gt; event (at the section end). This sequence continues through the end of scrolling or till the close of static page session.&lt;br /&gt;
&lt;br /&gt;
[[File:StaticPageEvent35.jpg|center|link=]]&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Once the DCR Tracking Code is added to Instant Articles, Nielsen will validate the implementation. Following Nielsen testing, users need to make a couple of updates to the initialization call to ensure that the site is being measured properly.&lt;br /&gt;
# '''App ID''': Ensure that correct &amp;lt;apid&amp;gt; is used during initialization&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;'PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_sdkDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
#* '''Example Production Initialization Call''' - Refer to the production initialization call below:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1415</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1415"/>
		<updated>2017-09-04T11:35:40Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Configure SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'TXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;TXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1414</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=1414"/>
		<updated>2017-09-04T11:34:29Z</updated>

		<summary type="html">&lt;p&gt;MagdalenaKostulska: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
To get started, an App ID is needed. The App ID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
apid: &amp;quot;TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two steps required for configuring the SDK:&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
*Add Static Queue Snippet&lt;br /&gt;
*Create SDK Instance&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
'''Static Queue Snippet'''&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
Add the following script tag to the website:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
&amp;lt;br/ &amp;gt;&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
'''Initialization API Call'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating an instance, pass the following three values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||	'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example SDK Initialization'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;   var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;apid&amp;gt;.js, will be downloaded based on the apid and will be cached on the user’s browser.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once the configuration is downloaded, the SDK itself will be downloaded and initialized. All SDK modules are included in one file: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Example SDK Configuration'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
 {&lt;br /&gt;
   t[n]=t[n]||{nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
   {&lt;br /&gt;
    return s=t.document,&lt;br /&gt;
    r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
    r.async=1,&lt;br /&gt;
    r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
    i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
    i.parentNode.insertBefore(r,i),&lt;br /&gt;
    t[o]=t[o]||{g:c,ggPM:function(n,e,c,r,s){(t[o].q=t[o].q||[]).push([n,e,c,r,s])}},&lt;br /&gt;
    t[o]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
} &lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Created SDK Instance&lt;br /&gt;
  var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''Content Metadata''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided App ID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the App ID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| vcid	|| sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
App ID. In order to override the sub-brand configured to the App ID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
Nielsen provided	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program (25 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode title (40 character limit)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| seconds 86400 for live stream)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| mediaURL	|| URL location of the content being streamed	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| segB	|| custom segment B	|| custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC	|| custom segment C	|| custom	 ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the airdate in the linear TV ||	YYYYMMDD HH:MI:SS	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
*&amp;quot;y&amp;quot;– full episode&lt;br /&gt;
*&amp;quot;n&amp;quot;– non full episode	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId1	|| standard episode ID	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| crossId2	|| content originator (only required for distributors)	|| Nielsen provided	||&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of ad load:&lt;br /&gt;
* 1) - Linear – matches TV ad load &lt;br /&gt;
* 2) Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
*&amp;quot;1&amp;quot; – content with linear ads &lt;br /&gt;
*&amp;quot;2&amp;quot; – content with dynamic ads	&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID123-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  mediaURL:       'http://www.site.com/videoAsset',&lt;br /&gt;
  segB:           'custom segment B',&lt;br /&gt;
  segC:           'custom segment C',&lt;br /&gt;
  airdate:        'YYYYMMDD HH:MI:SS',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  crossId1:       'Standard Episode ID',&lt;br /&gt;
  crossId2:       'Content Originator',&lt;br /&gt;
  adloadtype:     '2'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Call Nielsen APIs'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''SDK Events'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UTC timestamp &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;  &lt;br /&gt;
// START OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Nielsen Opt-Out ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The site must provide a means for the user to opt-out of, or opt back into, Nielsen Measurement. A user can opt-out if they would prefer not to participate in any Nielsen online measurement research. To implement the opt-out option, include the following two items in your privacy policy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*A notice that the player includes proprietary measurement software that allows users to contribute to market research (such as Nielsen TV Ratings).&lt;br /&gt;
*A link to the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
On the Nielsen Digital Measurement Privacy Policy page, users can click Choices to read more detailed information about the measurement software, learn about their options with regard to Nielsen measurement, and, if they do not want to participate in Nielsen online measurement, click a link to receive an opt-out cookie.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The following paragraph is a template for an opt-out statement.&lt;br /&gt;
&amp;lt;Br/&amp;gt;&lt;br /&gt;
The properties may feature Nielsen proprietary measurement software, which will allow users to contribute to market research, such as Nielsen TV Ratings. To learn more about the information that Nielsen software may collect and your choices with regard to it, please see the Nielsen Digital Measurement Privacy Policy at http://www.nielsen.com/digitalprivacy.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Opt Back In'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Once users have opted-out, they can choose to opt back into Nielsen Measurement at anytime by selecting the opt back in link on the Nielsen Digital Privacy Policy page. When a user selects the link, their opt-out cookie will be deleted and they will be able to be measured.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Going Live'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
Example Production Initialization Call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MagdalenaKostulska</name></author>
	</entry>
</feed>