<?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=MichelFodjo</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=MichelFodjo"/>
	<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/wiki/Special:Contributions/MichelFodjo"/>
	<updated>2026-04-07T21:27:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:250807_AGF_Metadata_Static-Display_v.1.0_english.pdf&amp;diff=6895</id>
		<title>File:250807 AGF Metadata Static-Display v.1.0 english.pdf</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:250807_AGF_Metadata_Static-Display_v.1.0_english.pdf&amp;diff=6895"/>
		<updated>2025-10-01T08:55:44Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: 250807_AGF Metadata Static-Display_v.1.0_english&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
250807_AGF Metadata Static-Display_v.1.0_english&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:250807_AGF_Metadata_Static-Display_v.1.0_deutsch.pdf&amp;diff=6894</id>
		<title>File:250807 AGF Metadata Static-Display v.1.0 deutsch.pdf</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:250807_AGF_Metadata_Static-Display_v.1.0_deutsch.pdf&amp;diff=6894"/>
		<updated>2025-10-01T08:54:02Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: 250807_AGF Metadata Static-Display_v.1.0_deutsch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
250807_AGF Metadata Static-Display_v.1.0_deutsch&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6548</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6548"/>
		<updated>2023-10-18T13:01:59Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Interruption Scenarios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: orange&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that you have to use the Staging Cloud API Endpoint until you get the green light from Nielsen to move to Production!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    var timestamp_ms = new Date().getTime();&lt;br /&gt;
    uid += String(timestamp_ms).substring(3);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for AGF by selection Germany in the country dropbox [https://nielsenonlinesupport.com/agf/RefImplCloudAPI/index.htm?debug=true RefImplCloudAPI].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_iOS_SDK&amp;diff=6541</id>
		<title>DCR Sweden Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_iOS_SDK&amp;diff=6541"/>
		<updated>2023-09-28T12:12:48Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; &amp;quot;See [[iOS SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
Version 8 of the Nielsen App SDK comes in three versions. One that is enabled to work with the App Tracking Transparency Framework, another version that does not use the Ad Framework, and a version for Kids Apps or where no ID is required. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! SDK Flavor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS Ad Version'''&lt;br /&gt;
|* Opt-In and Opt-Out functionality managed by the [https://developer.apple.com/documentation/apptrackingtransparency AppTrackingTransparency framework].  &amp;lt;br /&amp;gt;* The Nielsen SDK will attempt to collect the IDFA (Id for Advertisers) on the device.&amp;lt;br&amp;gt; * For iOS14+, if the value returned is &amp;lt;code&amp;gt;ATTrackingManager.AuthorizationStatus.authorized&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;*  If the device is running iOS12 or iOS13, the Limit Ad Tracking setting is requested.&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS No Ad Framework'''&lt;br /&gt;
|* Without the Ad Framework, the Nielsen SDK cannot read the IDFA, so it will attempt to retrieve the [https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor ID for Vendors (IDFV)].&amp;lt;br /&amp;gt;* The IDFV may be used for analytics across apps from the same content provider.&amp;lt;br /&amp;gt;* The developer is required to present the User Choice Optout page. The detailed requirement is described in the [https://engineeringportal.nielsen.com//docs/DCR_Sweden_Video_iOS_SDK#Global_iOS_SDK_No_Ad_Framework_Opt-out Global iOS SDK No Ad Framework Opt-out] Section.&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS SDK No ID'''&lt;br /&gt;
|* This version of the Nielsen SDK is perfect for Kid apps, or where no ID is required.&amp;lt;br&amp;gt;* Please review the [https://engineeringportal.nielsen.com/docs/DCR_Sweden_Video_iOS_SDK#Global_iOS_SDK_No_ID_Opt-out Global iOS SDK No ID Opt-out] Section.&lt;br /&gt;
|}&lt;br /&gt;
=== How to obtain the NielsenAppApi.Framework ===&lt;br /&gt;
The Nielsen AppSDK can either be downloaded directly or can be integrated directly within an application through the use of CocoaPods. We recommend using the CocoaPods-based integration whenever possible to ensure you maintain the most recent changes and enhancements to the Nielsen libraries.&lt;br /&gt;
* [[Digital_Measurement_iOS_Artifactory_Guide|Select to obtain CocoaPods implementation guide]]&lt;br /&gt;
* [[Special:Downloads|Select to Download Directly]]&lt;br /&gt;
* [[DCR_Video_iOS_SDK_xcframework|Using the XCFramework bundle]]&lt;br /&gt;
&lt;br /&gt;
== Setting up your iOS Development Environment ==&lt;br /&gt;
&lt;br /&gt;
=== Special Notes regarding iOS17 or TVOS17 ===&lt;br /&gt;
Beginning with iOS/TVOS 17, Apple is adding several requirements for App developers around tracking, use of Identifier For Advertisers (IDFA), and certain system APIs.&lt;br /&gt;
&lt;br /&gt;
This requirement entails users manually opting in to declare all domains employed for tracking purposes, which includes the collection of IDFAs (Identifier for Advertisers).&lt;br /&gt;
Currently, even if users choose not to opt in for tracking, it's essential to note that our Nielsen Digital SDKs continue to carry out measurements and transmit data without relying on IDFA. However, this new privacy measure introduced by Apple necessitates that we bring this development to your attention, as it could potentially impact your Nielsen measurement and tracking for iOS app usage.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the impact, we are asking that clients do the following:&lt;br /&gt;
&lt;br /&gt;
* '''Do not declare the Nielsen imrworldwide.com domain in the privacy manifest.'''&lt;br /&gt;
* Update to the latest Nielsen SDK release &amp;gt;= 9.2.0.0 when compiling your app for iOS 17.&lt;br /&gt;
&lt;br /&gt;
For any additional information please refer to the Nielsen global page: [[DCR and DTVR with iOS17 or TVOS17]].&lt;br /&gt;
&lt;br /&gt;
=== Configuring Xcode Development Environment ===&lt;br /&gt;
Starting with SDK version 6.0.0.0, the Nielsen App SDK is compatible with Apple iOS versions 8.0 and above.  In addition, the SDK uses the WKWebView class instead of the deprecated UIWebView as per Apple guidelines. &lt;br /&gt;
&lt;br /&gt;
=== Importing Frameworks ===&lt;br /&gt;
&lt;br /&gt;
1) Extract “NielsenAppApi.Framework” from the Nielsen App SDK zip file and copy it to the Frameworks folder of the Xcode project.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) Import following frameworks and libraries into the Frameworks 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&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&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) Include header file &amp;lt;code&amp;gt;NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller's header file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
* All communications between the SDK and the Census (Collection Facility) use HTTPS&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Using Swift ====&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;
&lt;br /&gt;
==== Using Objective-C ====&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;
&lt;br /&gt;
== Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can then be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || YES || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || NO || &amp;quot;Nielsen Sample App&amp;quot;&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;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || NO || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| hem_unknown ||  Hashed email using SHA512. This email is used by MMS reach model. &lt;br /&gt;
|| Client-defined || Required if login feature || &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| enableFpid || true/false value is required to set collection of first-party ID.&lt;br /&gt;
|| Nielsen-specified || NO || &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{enableFpid: &amp;quot;true&amp;quot;} //alternative: false&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;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&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;
&lt;br /&gt;
===== Using Objective-C=====&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;: @&amp;quot;DEBUG&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;hem_unknown&amp;quot;: @&amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;,&lt;br /&gt;
                                     @&amp;quot;enableFpid&amp;quot;: @&amp;quot;true&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;
&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;,&lt;br /&gt;
            &amp;quot;hem_unknown&amp;quot;: &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;,&lt;br /&gt;
            &amp;quot;enableFpid&amp;quot;: &amp;quot;true&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;
&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;
&lt;br /&gt;
==== Life cycle of SDK instance ====&lt;br /&gt;
The 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. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&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;
&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;
== Create Metadata Objects ==&lt;br /&gt;
The parameters passed must be either a JSON formatted NSString or an NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Create Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip, including when ads play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of content metadata.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:'''  Program and title metadata values should be passed to SDK as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of ad metadata.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&lt;br /&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;
=== MetaData Example ===&lt;br /&gt;
&lt;br /&gt;
==== Using Objective-C ====&lt;br /&gt;
&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;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;uniqueassetid&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot; : &amp;quot;2600&amp;quot;&lt;br /&gt;
  //Please see the metadata link above for all content parameters&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;uniquepostrolladid&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;&lt;br /&gt;
  //please see metadata link above for all ad parameters&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using 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;assetid&amp;quot; : &amp;quot;uniqueassetid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
        &amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
        &amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
        &amp;quot;length&amp;quot; : &amp;quot;2600&amp;quot;&lt;br /&gt;
       //Please see the metadata link above for all content parameters&lt;br /&gt;
     ]&lt;br /&gt;
&lt;br /&gt;
    let adMetadata = [&lt;br /&gt;
        &amp;quot;assetid&amp;quot; : &amp;quot;uniquepostrolladid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;&lt;br /&gt;
        //Please see the metadata link above for all ad parameters&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Call play only when initially starting the video.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi play:channelInfo];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.play(channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
It needs to be called at the beginning of each asset, and pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the beginning of the playlist - see below API call sequence examples.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi loadMetadata:metadataDict];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(metadataDict)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
Pass playhead position every second during playback. for VOD: pass the current position in seconds. for Live: current Unix timestamp (seconds since Jan-1-1970 UTC) - if it is possible to seek back in Live content, then pass related Unix time (not current). Pass the whole number that increments only by 1 like 1,2,3..&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
[self.nielsenAppApi playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* When a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see below chapter Interruption scenario&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call Sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Ads ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;channelName&amp;quot;: &amp;quot;TheMovieTitle&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
  &amp;quot;assetid&amp;quot;: &amp;quot;vid345-67483&amp;quot;,&lt;br /&gt;
  &amp;quot;program&amp;quot;: &amp;quot;ProgramName&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&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;
Call [[playheadPosition|playheadPosition()]] every one second until a pause.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Ads ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;channelName&amp;quot;: &amp;quot;TheMovieTitle&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
   &amp;quot;assetid&amp;quot;: &amp;quot;ad_123&amp;quot;,&lt;br /&gt;
   ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[playheadPosition|playheadPosition()]] every one second until a pause / another [[loadMetadata()]] is called. Playhead should be passed for the entire duration of a ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content (End of stream) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.playheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start. When content has resumed following an ad break, playhead position must continue from where the previous content segment was left off.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third-party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-v1.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-v1.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
There are currently three flavours of the Nielsen SDK. Please check the &amp;quot;Implementation&amp;quot; section to compare the three flavours. Implementing opt-out for the three flavours is different:&lt;br /&gt;
# '''[[#Global_iOS_SDK_Opt-out|Global iOS SDK Opt-out]]''' - managed by ''AppTracking'' or ''Limit Ad Tracking'' setting on device.&lt;br /&gt;
# '''[[#Global_iOS_SDK_No_Ad_Framework_Opt-out|Global iOS SDK No Ad Framework Opt-out]]''' - Direct call to SDK. Can be used without the Ad Framework.&lt;br /&gt;
# '''[[#Global_iOS_SDK_No_ID_Opt-out|Global iOS SDK No ID Opt-out]]''' - Direct call to SDK. It should be used for Kids Category.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
=== Global iOS SDK Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen iOS &lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the iOS's '''Limit Ad Tracking''' or '''AppTracking''' setting. &lt;br /&gt;
*  If the User's device is running &amp;lt; iOS 13.x, the Nielsen SDK will check the status of '''Limit Ad Tracking'''.&lt;br /&gt;
*  iOS14 modifies the way Apple manages the collection of a User's Opt-In status through '''AppTracking'''. Starting with Version 8.x+, the Nielsen App SDK will check the iOS version during initialization. If the device is running iOS12 or iOS13, the Limit Ad Tracking setting is requested. If iOS14.x +, then AppTracking is utilized.&lt;br /&gt;
==== Webview Element ====&lt;br /&gt;
It is a requirement to display a WebView element whose loadUrl is set to the value obtained from optOutURL.&lt;br /&gt;
If using the Global iOS SDK, this optOutURL informs the user how to deactivate/activate “App Tracking/Limit Ad Tracking”.&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;&amp;quot;Please note: This app features Nielsen’s proprietary measurement software, which contributes to market research, like Nielsen’s TV Ratings. Please see https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=sv for more information&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample Code for Global Build ====&lt;br /&gt;
===== Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import UIKit&lt;br /&gt;
import WebKit&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&lt;br /&gt;
class OptOutVC: UIViewController, NielsenAppApiDelegate, WKNavigationDelegate {&lt;br /&gt;
    var nielsenApi : NielsenAppApi!&lt;br /&gt;
    var webView: WKWebView!&lt;br /&gt;
   &lt;br /&gt;
    override func loadView() {&lt;br /&gt;
        webView = WKWebView()&lt;br /&gt;
        webView.navigationDelegate = self&lt;br /&gt;
        view = webView&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
    if let appApi = self.nielsenApi {&lt;br /&gt;
            //Getting the optPut URL from SDK&lt;br /&gt;
            if let url = URL(string: appApi.optOutURL) {&lt;br /&gt;
                webView.load(URLRequest(url: url))&lt;br /&gt;
                webView.allowsBackForwardNavigationGestures = true&lt;br /&gt;
            }}}&lt;br /&gt;
&lt;br /&gt;
        func closeOptOutView() {&lt;br /&gt;
            self.dismiss(animated: true, completion: nil)&lt;br /&gt;
        }}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Objective-C =====&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#import &amp;quot;OptOutVC.h&amp;quot;&lt;br /&gt;
#import &amp;quot;NielsenInit.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@interface OptOutVC ()&lt;br /&gt;
&lt;br /&gt;
@property (weak, nonatomic) IBOutlet UIWebView *webView;&lt;br /&gt;
@end&lt;br /&gt;
&lt;br /&gt;
@implementation OptOutVC&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
    //Getting the optPut URL from eventTracker&lt;br /&gt;
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL&lt;br /&gt;
 URLWithString:self.nielsenApi.optOutURL]]];&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global iOS SDK No Ad Framework Opt-out ===&lt;br /&gt;
The ''User Choice'' method can be used without the Ad Framework, or in situations where the publisher does not wish to use the [https://developer.apple.com/documentation/apptrackingtransparency App Tracking Transparency Framework]. As this flavour of the Nielsen, SDK does not use the Ad Framework, so it is necessary to display an Optout Page to the user and capture their selection.&lt;br /&gt;
&lt;br /&gt;
Similar to the Global iOS SDK Flavor, it is a requirement to display a WebView element whose loadUrl is set to the&lt;br /&gt;
value obtained from optOutURL. This special URL indicates Opt-in, or Opt-out and closes the WebView.  '''The steps are as follows:'''&lt;br /&gt;
&lt;br /&gt;
* Get the Nielsen opt-out URL via [[optOutURL]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[optOutURL]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and closes 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=swift&amp;gt;NielsenAppApi?.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;); // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample code for No Ad Framework Build ====&lt;br /&gt;
===== Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import UIKit&lt;br /&gt;
import WebKit&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&lt;br /&gt;
class OptOutVC: UIViewController, NielsenAppApiDelegate, WKNavigationDelegate {&lt;br /&gt;
    var nielsenApi : NielsenAppApi!&lt;br /&gt;
    var webView: WKWebView!&lt;br /&gt;
   &lt;br /&gt;
    override func loadView() {&lt;br /&gt;
        webView = WKWebView()&lt;br /&gt;
        webView.navigationDelegate = self&lt;br /&gt;
        view = webView&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
        if let appApi = self.nielsenApi {&lt;br /&gt;
            //Getting the optPut URL from SDK&lt;br /&gt;
            if let url = URL(string: appApi.optOutURL) {&lt;br /&gt;
                webView.load(URLRequest(url: url))&lt;br /&gt;
                webView.allowsBackForwardNavigationGestures = true&lt;br /&gt;
            }}}&lt;br /&gt;
&lt;br /&gt;
        func closeOptOutView() {&lt;br /&gt;
            self.dismiss(animated: true, completion: nil)&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: &lt;br /&gt;
@escaping (WKNavigationActionPolicy) -&amp;gt; Void) {&lt;br /&gt;
            print(navigationAction.request.url?.absoluteString as Any) //For debugging to check what is being passed from webpage.&lt;br /&gt;
            if navigationAction.request.url?.absoluteString == &amp;quot;nielsen://close&amp;quot; {&lt;br /&gt;
                closeOptOutView()&lt;br /&gt;
                decisionHandler(.cancel)&lt;br /&gt;
            } else {&lt;br /&gt;
                if let url = navigationAction.request.url?.absoluteString, url.hasPrefix(&amp;quot;nielsen&amp;quot;) {&lt;br /&gt;
                    nielsenApi?.userOptOut(url). //either nielsenappsdk://1 or nielsenappsdk://0&lt;br /&gt;
                    decisionHandler(.cancel)&lt;br /&gt;
                } else {&lt;br /&gt;
                    if navigationAction.navigationType == .linkActivated {&lt;br /&gt;
                        if let url = navigationAction.request.url?.absoluteString, url.hasSuffix(&amp;quot;#&amp;quot;) {&lt;br /&gt;
                            decisionHandler(.allow)&lt;br /&gt;
                        } else {&lt;br /&gt;
                            decisionHandler(.cancel)&lt;br /&gt;
                            webView.load(navigationAction.request)&lt;br /&gt;
                        }&lt;br /&gt;
                    } else {&lt;br /&gt;
                        decisionHandler(.allow)&lt;br /&gt;
                    }}}}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Objective-C =====&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#import &amp;quot;OptOutVC.h&amp;quot;&lt;br /&gt;
#import &amp;quot;NielsenInit.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@interface OptOutVC ()&lt;br /&gt;
&lt;br /&gt;
@property (weak, nonatomic) IBOutlet UIWebView *webView;&lt;br /&gt;
@end&lt;br /&gt;
&lt;br /&gt;
@implementation OptOutVC&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
    //Getting the optPut URL from eventTracker&lt;br /&gt;
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL&lt;br /&gt;
 URLWithString:self.nielsenApi.optOutURL]]];&lt;br /&gt;
}&lt;br /&gt;
     &lt;br /&gt;
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction&lt;br /&gt;
 decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler&lt;br /&gt;
{&lt;br /&gt;
    if ([navigationAction.request.URL.absoluteString isEqualToString:kNielsenWebClose])&lt;br /&gt;
    {   [self performSelector:@selector(closeOptOutView) withObject:nil afterDelay:0];&lt;br /&gt;
        decisionHandler(WKNavigationActionPolicyCancel); &lt;br /&gt;
     } else {&lt;br /&gt;
        if ([navigationAction.request.URL.absoluteString hasPrefix:@&amp;quot;nielsen&amp;quot;])&lt;br /&gt;
        {[self.nielsenAppApi userOptOut:navigationAction.request.URL.absoluteString];&lt;br /&gt;
            decisionHandler(WKNavigationActionPolicyCancel); &lt;br /&gt;
        } else {&lt;br /&gt;
            if (navigationAction.navigationType == WKNavigationTypeLinkActivated) &lt;br /&gt;
            { if ([navigationAction.request.URL.absoluteString hasSuffix:@&amp;quot;#&amp;quot;]) &lt;br /&gt;
                      {decisionHandler(WKNavigationActionPolicyAllow);&lt;br /&gt;
                } else {&lt;br /&gt;
                    decisionHandler(WKNavigationActionPolicyCancel);&lt;br /&gt;
                    [webView loadRequest:[NSURLRequest requestWithURL:navigationAction.request.URL]];&lt;br /&gt;
                }} else {&lt;br /&gt;
                 decisionHandler(WKNavigationActionPolicyAllow);&lt;br /&gt;
            }}}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global iOS SDK No ID Opt-out ===&lt;br /&gt;
If you are building an app that will be listed in the Kids Category:&lt;br /&gt;
#  Ensure that you are using the [https://nielsendownloads-green.digitalengsdk.com/digital/Nielsen-iOS-App-SDK-GlobalNoId_latest.zip NoID version] of the Nielsen SDK Framework.&lt;br /&gt;
#  Immediately following the initialization of the Nielsen SDK ensure you call the userOptOut API with Opt out selection: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=swift&amp;gt;NielsenAppApi?.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;); // User opt-out&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 via OS-level Opt-out or via User Choice Opt-out, the current Opt-Out status as detected by the SDK is available via the [[optOutStatus]] property in the Nielsen 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; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== First Party ID (FPID)===&lt;br /&gt;
- The broadcaster must enableFPID in the initialization settings which is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; depending on user consent. This is to be set by the broadcaster when initializing our SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The &amp;lt;code&amp;gt;enableFpid&amp;lt;/code&amp;gt; flag is needed to enable/disable FPID usage for the AppID. The default value for this flag is true. If this flag is changed from true to false, then the AppSDK should wipe out the stored FPID and use a blank value for the FPID parameter in all the pings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Generated FPID value is stored in the persistent memory until the application is uninstalled from a device or until FPID is wiped out or until it is expired.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The default value for this parameter is 180 days. Once this timeout is reached, the FPID should be regenerated.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Optional Step for AirPlay ==&lt;br /&gt;
To implement OTT measurement, report OTT changes to the SDK using the public API interface: [[updateOTT]]&lt;br /&gt;
&lt;br /&gt;
In order to detect AirPlay and mirroring changes, we use AVAudioSessionPortDescription properties that are different on different iOS versions. We found that on iOS versions 8 - 10 &amp;lt;code&amp;gt;AVAudioSessionPortDescription&amp;lt;/code&amp;gt; has the following values:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AirPlay: type = AirPlay; name = Apple TV 4K; UID = DC:56:E7:53:72:85-airplay &amp;lt;br&amp;gt;&lt;br /&gt;
Mirroring: type = AirPlay; name = Apple TV 4K; UID = DC:56:E7:53:72:85-screen&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For iOS 11+ some parameters like name and UID have different values:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
AirPlay: type = AirPlay; name = AirPlay; UID = 0eb63aae-5915-45f1-b0f7-0102a0e50d53 &amp;lt;br&amp;gt;&lt;br /&gt;
Mirroring: type = AirPlay; name = Apple TV 4K; UID = 4335E8A9-1C0A-4251-9000-28CA5FA2F3CF-192731714653291-screen&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code snipped is suggested for AirPlay/mirroring detection on iOS devices.&lt;br /&gt;
&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
– (void)updateOTT:(id)ottInfo;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Subscribe to AVAudioSessionRouteChangeNotification ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRouteChanged:) name:AVAudioSessionRouteChangeNotification object:nil];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Handle AVAudioSessionRouteChangeNotification and prepare OTT dictionary:===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
- (void)handleRouteChanged:(NSNotification *)notification&lt;br /&gt;
{&lt;br /&gt;
NSMutableDictionary *ottDict = [NSMutableDictionary dictionaryWithDictionary: @{@&amp;quot;ottStatus&amp;quot;: @&amp;quot;0&amp;quot;}];&lt;br /&gt;
&lt;br /&gt;
AVAudioSession *audioSession = [AVAudioSession sharedInstance];&lt;br /&gt;
AVAudioSessionRouteDescription *currentRoute = audioSession.currentRoute;&lt;br /&gt;
for (AVAudioSessionPortDescription *outputPort in currentRoute.outputs) {&lt;br /&gt;
if ([outputPort.portType isEqualToString:AVAudioSessionPortAirPlay]) {&lt;br /&gt;
ottDict[@&amp;quot;ottStatus&amp;quot;] = @&amp;quot;1&amp;quot;;&lt;br /&gt;
ottDict[@&amp;quot;ottDeviceModel&amp;quot;] = outputPort.portName;&lt;br /&gt;
ottDict[@&amp;quot;ottDeviceID&amp;quot;] = outputPort.UID;&lt;br /&gt;
&lt;br /&gt;
if ([outputPort.portName isEqualToString:@&amp;quot;AirPlay&amp;quot;]) {&lt;br /&gt;
ottDict[@&amp;quot;ottDevice&amp;quot;] = @&amp;quot;airplay&amp;quot;;&lt;br /&gt;
ottDict[@&amp;quot;ottType&amp;quot;] = @&amp;quot;airplay&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
if ([outputPort.portName containsString:@&amp;quot;Apple TV&amp;quot;]) {&lt;br /&gt;
ottDict[@&amp;quot;ottDevice&amp;quot;] = @&amp;quot;appleTV&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
ottDict[@&amp;quot;ottDevice&amp;quot;] = @&amp;quot;other&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ([outputPort.UID hasSuffix:@&amp;quot;airplay&amp;quot;]) {&lt;br /&gt;
ottDict[@&amp;quot;ottType&amp;quot;] = @&amp;quot;airplay&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else if ([outputPort.UID hasSuffix:@&amp;quot;screen&amp;quot;]) {&lt;br /&gt;
ottDict[@&amp;quot;ottType&amp;quot;] = @&amp;quot;mirroring&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
ottDict[@&amp;quot;ottType&amp;quot;] = @&amp;quot;other&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// report OTT status update to Nielsen SDK&lt;br /&gt;
[self reportOTTWithDict:ottDict];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Report OTT update to the Nielsen SDK ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
- (void)reportOTTWithDict:(NSDictionary *)ottDict&lt;br /&gt;
{&lt;br /&gt;
[self.nielsenSDK updateOTT:ottDict];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
nielsenSdk.updateOTT(currentStatus)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to AVAudioSessionRouteChangeNotification === &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
NotificationCenter.default.addObserver(self, selector: #selector(handleRouteChanged(_:)), name: NSNotification.Name.AVAudioSessionRouteChange, object: nil)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Handle AVAudioSessionRouteChangeNotification and prepare OTT dictionary:===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;Swift&amp;quot;&amp;gt;&lt;br /&gt;
func handleRouteChanged(_ notification: Notification) {&lt;br /&gt;
var currentStatus: [String: String] = [&amp;quot;ottStatus&amp;quot;: &amp;quot;0&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
let session = AVAudioSession.sharedInstance()&lt;br /&gt;
let currentRoute = session.currentRoute&lt;br /&gt;
for outputPort in currentRoute.outputs {&lt;br /&gt;
if outputPort.portType == AVAudioSessionPortAirPlay {&lt;br /&gt;
currentStatus[&amp;quot;ottStatus&amp;quot;] = &amp;quot;1&amp;quot;&lt;br /&gt;
currentStatus[&amp;quot;ottDeviceModel&amp;quot;] = outputPort.portName&lt;br /&gt;
currentStatus[&amp;quot;ottDeviceID&amp;quot;] = outputPort.uid&lt;br /&gt;
&lt;br /&gt;
if outputPort.portName == &amp;quot;AirPlay&amp;quot; {&lt;br /&gt;
currentStatus[&amp;quot;ottDevice&amp;quot;] = &amp;quot;airplay&amp;quot;&lt;br /&gt;
currentStatus[&amp;quot;ottType&amp;quot;] = &amp;quot;airplay&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
if outputPort.portName.contains(&amp;quot;Apple TV&amp;quot;) {&lt;br /&gt;
currentStatus[&amp;quot;ottDevice&amp;quot;] = &amp;quot;appleTV&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
currentStatus[&amp;quot;ottDevice&amp;quot;] = &amp;quot;other&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if outputPort.uid.hasSuffix(&amp;quot;airplay&amp;quot;) {&lt;br /&gt;
currentStatus[&amp;quot;ottType&amp;quot;] = &amp;quot;airplay&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
else if outputPort.uid.hasSuffix(&amp;quot;screen&amp;quot;) {&lt;br /&gt;
currentStatus[&amp;quot;ottType&amp;quot;] = &amp;quot;mirroring&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
currentStatus[&amp;quot;ottType&amp;quot;] = &amp;quot;other&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// report OTT status update to Nielsen SDK&lt;br /&gt;
self.reportOTTUpdate(currentStatus)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Report OTT update to the Nielsen SDK===&lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;Swift&amp;quot;&amp;gt;&lt;br /&gt;
func reportOTTUpdate(_ ottDict: [String: String]) {&lt;br /&gt;
if let nielsenSdk = self.nielsenAppApi {&lt;br /&gt;
nielsenSdk.updateOTT(currentStatus)&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via the same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;imr&amp;quot; and confirm the presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-sw.imrworldwide.com/cgi-bin/gn?prd=dcr&amp;amp;ci=se-910685&amp;amp;ch=se-910685_c01_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=a2nfmy17lyvkhlxqstvmgypqly90m1629966210&amp;amp;fp_cr_tm=1629966210&amp;amp;fp_acc_tm=1629966210&amp;amp;fp_emm_tm=1629966210&amp;amp;ve_id=20A7CFD5-9860-4256-A6CE-45C251F4C243&amp;amp;sessionId=yvx0rtsxydmaxueji8zgfzj0f2f1w1629966209&amp;amp;tl=&amp;amp;prv=1&amp;amp;c6=vc,c01&amp;amp;ca=se-910685_c01_51HERB1501&amp;amp;cg=Play%20%3E%20Webbtv%20%3E%20Nyheter&amp;amp;c13=asid,P3D8D326A-2DBC-486A-8FD8-9AF4452B2A41&amp;amp;c32=segA,NA&amp;amp;c33=segB,NA&amp;amp;c34=segC,NA&amp;amp;c15=apn,Aftonbladet&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=1&amp;amp;cr=4_00_99_D1_00000&amp;amp;c9=devid,12b9377cbe7e5c94e8a70d9d23929523d14afa954793130f8a3959c7b849aca8&amp;amp;enc=true&amp;amp;c1=nuid,12b9377cbe7e5c94e8a70d9d23929523d14afa954793130f8a3959c7b849aca8&amp;amp;at=timer&amp;amp;rt=video&amp;amp;c16=sdkv,ai.8.1.0&amp;amp;c27=cln,15&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid,16299662096458868&amp;amp;c30=bldv,ai.8.1.0.0_gsxaoni&amp;amp;st=dcr&amp;amp;c7=osgrp,&amp;amp;c8=devgrp,&amp;amp;c10=plt,&amp;amp;c40=adbid,&amp;amp;c14=osver,iOS14.6&amp;amp;c26=dmap,1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid,&amp;amp;c36=cref1,&amp;amp;c37=cref2,&amp;amp;c11=agg,1&amp;amp;c12=apv,5.47.83.0.25245&amp;amp;c51=adl,15&amp;amp;c52=noad,1&amp;amp;sd=15&amp;amp;pc=NA&amp;amp;c53=fef,n&amp;amp;c54=oad,&amp;amp;c55=cref3,&amp;amp;c57=adldf,2&amp;amp;ai=51HERB1501&amp;amp;c3=st,a&amp;amp;c64=starttm,1629966240&amp;amp;adid=51HERB1501&amp;amp;c58=isLive,false&amp;amp;c59=sesid,iqal6k21r0de8gm901kif5xznar7q1629966240&amp;amp;c61=createtm,1629966255&amp;amp;c63=pipMode,&amp;amp;ci_userid=&amp;amp;is_auto_play=&amp;amp;pl_title=&amp;amp;is_prem=&amp;amp;is_prog=&amp;amp;ad_origin=&amp;amp;adidx=1%2F1&amp;amp;is_tpad=&amp;amp;ci_passthr=&amp;amp;c62=sendTime,1629966255&amp;amp;c68=bndlid,se.aftonbladet.Aftonbladet&amp;amp;c69=cvw,&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype,&amp;amp;c74=dvcnm,&amp;amp;c76=adbsnid,&amp;amp;uoo=&amp;amp;c44=progen,&amp;amp;davty=1&amp;amp;si=&amp;amp;c66=mediaurl,&amp;amp;sdd=retry,0~~retryreason,~~devmodel,iPhone9%2C4~~devtypid,iPhone9%2C4~~sysname,iOS~~sysversion,14.6~~manuf,Apple&amp;amp;cat_id=a6f7fb13-8801-484c-9692-6db6dfb470aa&amp;amp;vtoff=0&amp;amp;rnd=1629966255319&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
Following Nielsen testing, you will need to:&lt;br /&gt;
&lt;br /&gt;
# '''Disable Debug Logging''': Disable logging by deleting &amp;lt;code&amp;gt;{nol_devDebug: 'DEBUG'}&amp;lt;/code&amp;gt; from initialization call.&lt;br /&gt;
# '''Notify Nielsen''': Once you are ready to go live, let us know so we can enable you for reporting. We will not be able to collect or report data prior to receiving notification from you.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6540</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6540"/>
		<updated>2023-09-28T12:06:47Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Special Notes regarding iOS17 or TVOS17 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&lt;br /&gt;
==== Special Notes regarding iOS17 or TVOS17  ====&lt;br /&gt;
Beginning with iOS/TVOS 17, Apple is adding several requirements for App developers around tracking, use of Identifier For Advertisers (IDFA), and certain system APIs.&lt;br /&gt;
&lt;br /&gt;
Since AGF market is not making use of the IDFA, the change is expected to have no impact.&lt;br /&gt;
&lt;br /&gt;
However, in order to minimize any eventual impact, we are asking that AGF clients do the following:&lt;br /&gt;
&lt;br /&gt;
* '''Do not declare the Nielsen nmrodam.com domain in the privacy manifest'''&lt;br /&gt;
* Update to the latest Nielsen SDK release &amp;gt;= 9.2.0.0 when compiling your app for iOS 17&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For any additional information please refer to the Nielsen global page: [[DCR and DTVR with iOS17 or TVOS17]].&lt;br /&gt;
&lt;br /&gt;
==== General  ====&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Werbung&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Denmark_Video_iOS_SDK&amp;diff=6539</id>
		<title>DCR Denmark Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Denmark_Video_iOS_SDK&amp;diff=6539"/>
		<updated>2023-09-28T12:06:03Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Special Notes regarding iOS17 or TVOS17 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&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 ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; &amp;quot;See [[iOS SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 1: Setting up your iOS Development Environment ==&lt;br /&gt;
&lt;br /&gt;
=== Special Notes regarding iOS17 or TVOS17 ===&lt;br /&gt;
Beginning with iOS/TVOS 17, Apple is adding several requirements for App developers around tracking, use of Identifier For Advertisers (IDFA), and certain system APIs.&lt;br /&gt;
&lt;br /&gt;
This requirement entails users manually opting in to declare all domains employed for tracking purposes, which includes the collection of IDFAs (Identifier for Advertisers).&lt;br /&gt;
Currently, even if users choose not to opt in for tracking, it's essential to note that our Nielsen Digital SDKs continue to carry out measurements and transmit data without relying on IDFA. However, this new privacy measure introduced by Apple necessitates that we bring this development to your attention, as it could potentially impact your Nielsen measurement and tracking for iOS app usage.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the impact, we are asking that clients do the following:&lt;br /&gt;
&lt;br /&gt;
* '''Do not declare the Nielsen imrworldwide.com domain in the privacy manifest.'''&lt;br /&gt;
* Update to the latest Nielsen SDK release &amp;gt;= 9.2.0.0 when compiling your app for iOS 17.&lt;br /&gt;
&lt;br /&gt;
For any additional information please refer to the Nielsen global page: [[DCR and DTVR with iOS17 or TVOS17]].&lt;br /&gt;
&lt;br /&gt;
=== Configuring Xcode Development Environment ===&lt;br /&gt;
Starting with SDK version 6.0.0.0, the Nielsen App SDK is compatible with Apple iOS versions 8.0 and above.  In addition, the SDK uses the WKWebView class instead of the deprecated UIWebView as per Apple guidelines. &lt;br /&gt;
&lt;br /&gt;
=== Importing Frameworks ===&lt;br /&gt;
&lt;br /&gt;
1) Extract “NielsenAppApi.Framework” from the Nielsen App SDK zip file and copy it to Frameworks folder of the Xcode project.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) Import following frameworks and libraries into the Frameworks 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&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&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) Include header file &amp;lt;code&amp;gt;NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller's header file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
* All communications between the SDK and the Census (Collection Facility) use HTTPS&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Using Swift ====&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;
&lt;br /&gt;
==== Using Objective-C ====&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;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can then be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| 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 ||  ✓ || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || '''value is automatically populated through App Name included in the App Resource File''' ||  || &amp;quot;Nielsen Sample App&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || '''value is automatically populated through App Version included in the App Resource File''' ||  || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified ||  || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&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;
&lt;br /&gt;
===== Using Objective-C=====&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;
&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;
&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;
&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. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&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;
&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;
== Step 3: Create Metadata Objects ==&lt;br /&gt;
The parameters passed must be either a JSON formatted NSString 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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Create 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;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; program and title metadata values should be passed to SDK as UTF-8 strings. &amp;lt;/blockquote&amp;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 asset	|| &amp;quot;content&amp;quot; for main content	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset 	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program 	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode name	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| Length of content in seconds (86400 seconds for live stream (24/7). For Event-Live streams planned length. For VoD video length)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the original date (local time with hh:mm:ss as 24h time stamp) content became available. This date does not change if the content is rebroadcasted on linear TV. ||	YYYYMMDD HH:MI:SS (if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;)	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
* &amp;quot;y&amp;quot; full episode (full content for a program)&lt;br /&gt;
* &amp;quot;n&amp;quot; non full episode (only one part of the entire content for a program , i.e. preview, sub-episodes)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of Ad load&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;1&amp;quot; Linear - matches TV ad load &lt;br /&gt;
* &amp;quot;2&amp;quot; Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|stationId	|| Unique Gracenote Station ID generated by Nielsen that uniquely identifies a live channel&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|pbstarttm	|| Playback Start Time (UTC): Unix timestamp in seconds matching the broadcast time for Content and Ad when a user starts and joins a live stream (seconds since Jan-1-1970 UTC)&lt;br /&gt;
||&lt;br /&gt;
i.e. &amp;quot;1631098029&amp;quot; for live stream and &amp;quot;&amp;quot;(empty string) for a VoD.&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen &lt;br /&gt;
||&lt;br /&gt;
✓ &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Create Ad Metadata (optional for DR) ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
Note: All metadata values should be passed as UTF-8 strings.&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;,  &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt;  - If specific type can not be identified.||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to Ad	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]])	|| ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|stationId	|| Unique Gracenote Station ID generated by Nielsen that uniquely identifies a live channel&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|pbstarttm	|| Playback Start Time (UTC): Unix timestamp in seconds matching the broadcast time for Content and Ad when a user starts and joins a live stream (seconds since Jan-1-1970 UTC)&lt;br /&gt;
||&lt;br /&gt;
i.e. &amp;quot;1631098029&amp;quot; for live stream and &amp;quot;&amp;quot;(empty string) for a VoD.&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	|| provided by Nielsen || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MetaData Example ===&lt;br /&gt;
&lt;br /&gt;
==== Using Objective-C ====&lt;br /&gt;
&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;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;unique_content_id&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot; : &amp;quot;length in seconds&amp;quot;,&lt;br /&gt;
  @&amp;quot;airdate&amp;quot; : &amp;quot;20161013 20:00:00&amp;quot;,&lt;br /&gt;
  @&amp;quot;isfullepisode&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;adloadtype&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
  @&amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
  @&amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
  @&amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;unique_postroll_ad_id&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
  @&amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
  @&amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using 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;assetid&amp;quot; : &amp;quot;unique_content_id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
        &amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
        &amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
        &amp;quot;length&amp;quot; : &amp;quot;length in seconds&amp;quot;,&lt;br /&gt;
        &amp;quot;airdate&amp;quot; : &amp;quot;20200713 10:22:00&amp;quot;,&lt;br /&gt;
        &amp;quot;isfullepisode&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;adloadtype&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
        &amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
        &amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
&lt;br /&gt;
    let adMetadata = [&lt;br /&gt;
        &amp;quot;assetid&amp;quot; : &amp;quot;unique_postroll_ad_id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
        &amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
        &amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Call play only when initially starting the video.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi play:channelInfo];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.play(channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the begining of playlist - see below API call sequence examples.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi loadMetadata:metadataDict];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(metadataDict)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background-color:#d0f6f8&amp;quot;&amp;gt;&lt;br /&gt;
Note: &amp;quot;playheadPosition&amp;quot; has to be called every second and the value passed should match the broadcast time for live channel.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* VOD: current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3... &amp;lt;br/&amp;gt;&lt;br /&gt;
* Live: Unix timestamp matching the broadcast time for Content and Ad (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
[self.nielsenAppApi playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== sendID3 ====&lt;br /&gt;
Needs to be called when ID3 Tags are included in the Video Stream.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi sendID3:id3];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.sendID3(id3)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
ID3 Tags are parsed from the Video Stream, refer to the DK Reference Implementation [http://nielsenonlinesupport.com/dk/index.htm sdkRefImplDK] on how to parse ID3 Tags included in a sample HLS Stream.&lt;br /&gt;
For further technical details, please contact your Technical Account Manager (TAM).&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start the Measurement ===&lt;br /&gt;
In order to start the measurement, follow the 3 first steps below i.e. for Content without Ads. When terminating the Content playback call &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; to terminate the Content Measurement for the given asset.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Playlist !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1. Start of stream || &amp;lt;code&amp;gt;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;loadMetadata(contentMetadataObject)&amp;lt;/code&amp;gt; || contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| 2. Content is playing|| &amp;lt;code&amp;gt;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;
| || &amp;lt;code&amp;gt;sendID3(id3)&amp;lt;/code&amp;gt; || id3 is an ID3 Tag parsed from the Video Stream, pass ID3 Tag immediately to SDK when found&lt;br /&gt;
|-&lt;br /&gt;
| 3. End of Stream || &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 5: Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Step 6: Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-v1.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-v1.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Step 7 : Disclose Nielsen Privacy Statement ==&lt;br /&gt;
The App SDK uses Mobile Ad IDs (Android ID or IDFA) which are fully hashed on the device before being sent to Nielsen (Nielsen never receives un-hashed values).&lt;br /&gt;
Users retain the possibility to oppose the use of Mobile Ad IDs, or to reset them, by using the functionality provided by the mobile operating system (iOS or Android).&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=da .&lt;br /&gt;
&lt;br /&gt;
== Step 8 : Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers VoD and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll Ad.&lt;br /&gt;
&lt;br /&gt;
Download the Reference Implementation for iOS [https://nielsenonlinesupport.com/dk/ios/DKRefImplSwift.zip DKRefImplSwift].&lt;br /&gt;
Unzip and open the project in Xcode, then run it i.e. in the simulator or on iOS device and then filter the Xcode output with &amp;quot;##&amp;quot; in order to see only relevant Nielsen SDK API Calls, as below:&lt;br /&gt;
&amp;lt;syntaxhighlight&lt;br /&gt;
==##&amp;gt; Nielsen SDK NielsenInit.getAppApi() - create Instance &lt;br /&gt;
==##!!&amp;gt; LandingVC -- viewDidAppear&lt;br /&gt;
==##!!&amp;gt; LandingVC -- Nielsen SDK eventOccurred&lt;br /&gt;
==##&amp;gt; Nielsen SDK .play(sdkMethods.loadChannelInfo())&lt;br /&gt;
==##&amp;gt; Nielsen SDK nielsenApi.loadMetadata&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 0 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 1 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 2 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 3 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 4 / 378&lt;br /&gt;
==##&amp;gt; terminatePlaybackSession Nielsen SDK end()&lt;br /&gt;
==##!!&amp;gt; LandingVC -- viewDidAppear&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 9 :  Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;nmr&amp;quot; and confirm presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-dmk.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=&amp;amp;fp_cr_tm=&amp;amp;fp_acc_tm=&amp;amp;fp_emm_tm=&amp;amp;ve_id=&amp;amp;devmodel=&amp;amp;manuf=&amp;amp;sysname=&amp;amp;sysversion=&amp;amp;sessionId=zlmmxkq867zt4bpnumlyz6dpn9hyp1610980356&amp;amp;tl=Episode%201&amp;amp;prv=1&amp;amp;c6=vc%2Cc77&amp;amp;ca=us-500207_c77_VID5556674-123456&amp;amp;cg=TAMSample%20DK&amp;amp;c13=asid%2CP10DF14BA-937E-436D-99DF-ED39A0422387&amp;amp;c32=segA%2CNA&amp;amp;c33=segB%2CNA&amp;amp;c34=segC%2CNA&amp;amp;c15=apn%2C&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=0&amp;amp;cr=4_00_99_V1_00000&amp;amp;c9=devid%2C&amp;amp;enc=true&amp;amp;c1=nuid%2C999&amp;amp;at=view&amp;amp;rt=video&amp;amp;c16=sdkv%2Cbj.6.0.0&amp;amp;c27=cln%2C0&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid%2C16109803568088038&amp;amp;c30=bldv%2C6.0.0.563&amp;amp;st=dcr&amp;amp;c7=osgrp%2C&amp;amp;c8=devgrp%2C&amp;amp;c10=plt%2C&amp;amp;c40=adbid%2C&amp;amp;c14=osver%2CNA&amp;amp;c26=dmap%2C1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid%2C&amp;amp;c36=cref1%2C&amp;amp;c37=cref2%2C&amp;amp;c11=agg%2C1&amp;amp;c12=apv%2C&amp;amp;c51=adl%2C0&amp;amp;c52=noad%2C0&amp;amp;sd=170&amp;amp;devtypid=&amp;amp;pc=NA&amp;amp;c53=fef%2Cy&amp;amp;c54=oad%2C20200713%2010%3A22%3A00&amp;amp;c55=cref3%2C&amp;amp;c57=adldf%2C2&amp;amp;ai=VID5556674-123456&amp;amp;c3=st%2Cc&amp;amp;c64=starttm%2C1610980392&amp;amp;adid=VID5556674-123456&amp;amp;c58=isLive%2Cfalse&amp;amp;c59=sesid%2Cgezrb92q4i9b9jg7acxgn783gjw0a1610980365&amp;amp;c61=createtm%2C1610980392&amp;amp;c63=pipMode%2C&amp;amp;c68=bndlid%2C&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype%2C&amp;amp;c74=dvcnm%2C&amp;amp;c76=adbsnid%2C&amp;amp;c77=adsuprt%2C2&amp;amp;uoo=&amp;amp;evdata=&amp;amp;c71=ottflg%2C0&amp;amp;c72=otttyp%2Cnone&amp;amp;c44=progen%2C&amp;amp;davty=0&amp;amp;si=http%3A%2F%2Fnielsenonlinesupport.com%2Fdk%2Findex.htm&amp;amp;c66=mediaurl%2Cassets%252FRTVOD_C3%252Fprog_index.m3u8&amp;amp;c62=sendTime%2C1610980392&amp;amp;rnd=714644&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 10 :  Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Step 11 :  Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), disable debug logging by deleting {nol_devDebug: &amp;quot;DEBUG&amp;quot;} from initialization call - see Step 2.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Denmark_Video_iOS_SDK&amp;diff=6538</id>
		<title>DCR Denmark Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Denmark_Video_iOS_SDK&amp;diff=6538"/>
		<updated>2023-09-28T12:05:10Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&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 ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; &amp;quot;See [[iOS SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 1: Setting up your iOS Development Environment ==&lt;br /&gt;
&lt;br /&gt;
=== Special Notes regarding iOS17 or TVOS17 ===&lt;br /&gt;
Beginning with iOS/TVOS 17, Apple is adding several requirements for App developers around tracking, use of Identifier For Advertisers (IDFA), and certain system APIs.&lt;br /&gt;
&lt;br /&gt;
This requirement entails users manually opting in to declare all domains employed for tracking purposes, which includes the collection of IDFAs (Identifier for Advertisers).&lt;br /&gt;
Currently, even if users choose not to opt in for tracking, it's essential to note that our Nielsen Digital SDKs continue to carry out measurements and transmit data without relying on IDFA. However, this new privacy measure introduced by Apple necessitates that we bring this development to your attention, as it could potentially impact your Nielsen measurement and tracking for iOS app usage.&lt;br /&gt;
&lt;br /&gt;
In order to minimize the impact, we are asking that clients do the following:&lt;br /&gt;
&lt;br /&gt;
* '''Do not declare the Nielsen imrworldwide.com domain in the privacy manifest.'''&lt;br /&gt;
* Update to the latest Nielsen SDK release &amp;gt;= 9,2.0.0 when compiling your app for iOS 17.&lt;br /&gt;
&lt;br /&gt;
For any additional information please refer to the Nielsen global page: [[DCR and DTVR with iOS17 or TVOS17]].&lt;br /&gt;
&lt;br /&gt;
=== Configuring Xcode Development Environment ===&lt;br /&gt;
Starting with SDK version 6.0.0.0, the Nielsen App SDK is compatible with Apple iOS versions 8.0 and above.  In addition, the SDK uses the WKWebView class instead of the deprecated UIWebView as per Apple guidelines. &lt;br /&gt;
&lt;br /&gt;
=== Importing Frameworks ===&lt;br /&gt;
&lt;br /&gt;
1) Extract “NielsenAppApi.Framework” from the Nielsen App SDK zip file and copy it to Frameworks folder of the Xcode project.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) Import following frameworks and libraries into the Frameworks 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&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&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) Include header file &amp;lt;code&amp;gt;NielsenAppApi/NielsenAppApi.h&amp;lt;/code&amp;gt; to the View Controller's header file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The SDK uses the NSURLSession instead of the deprecated NSURLConnection.&lt;br /&gt;
* All communications between the SDK and the Census (Collection Facility) use HTTPS&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Using Swift ====&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;
&lt;br /&gt;
==== Using Objective-C ====&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;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can then be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| 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 ||  ✓ || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || '''value is automatically populated through App Name included in the App Resource File''' ||  || &amp;quot;Nielsen Sample App&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || '''value is automatically populated through App Version included in the App Resource File''' ||  || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified ||  || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&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;
&lt;br /&gt;
===== Using Objective-C=====&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;
&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;
&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;
&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. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&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;
&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;
== Step 3: Create Metadata Objects ==&lt;br /&gt;
The parameters passed must be either a JSON formatted NSString 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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Create 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;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; program and title metadata values should be passed to SDK as UTF-8 strings. &amp;lt;/blockquote&amp;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 asset	|| &amp;quot;content&amp;quot; for main content	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset 	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program 	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode name	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| Length of content in seconds (86400 seconds for live stream (24/7). For Event-Live streams planned length. For VoD video length)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the original date (local time with hh:mm:ss as 24h time stamp) content became available. This date does not change if the content is rebroadcasted on linear TV. ||	YYYYMMDD HH:MI:SS (if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;)	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
* &amp;quot;y&amp;quot; full episode (full content for a program)&lt;br /&gt;
* &amp;quot;n&amp;quot; non full episode (only one part of the entire content for a program , i.e. preview, sub-episodes)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of Ad load&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;1&amp;quot; Linear - matches TV ad load &lt;br /&gt;
* &amp;quot;2&amp;quot; Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|stationId	|| Unique Gracenote Station ID generated by Nielsen that uniquely identifies a live channel&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|pbstarttm	|| Playback Start Time (UTC): Unix timestamp in seconds matching the broadcast time for Content and Ad when a user starts and joins a live stream (seconds since Jan-1-1970 UTC)&lt;br /&gt;
||&lt;br /&gt;
i.e. &amp;quot;1631098029&amp;quot; for live stream and &amp;quot;&amp;quot;(empty string) for a VoD.&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen &lt;br /&gt;
||&lt;br /&gt;
✓ &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Create Ad Metadata (optional for DR) ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
Note: All metadata values should be passed as UTF-8 strings.&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;,  &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt;  - If specific type can not be identified.||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to Ad	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]])	|| ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|stationId	|| Unique Gracenote Station ID generated by Nielsen that uniquely identifies a live channel&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|pbstarttm	|| Playback Start Time (UTC): Unix timestamp in seconds matching the broadcast time for Content and Ad when a user starts and joins a live stream (seconds since Jan-1-1970 UTC)&lt;br /&gt;
||&lt;br /&gt;
i.e. &amp;quot;1631098029&amp;quot; for live stream and &amp;quot;&amp;quot;(empty string) for a VoD.&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	|| provided by Nielsen || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MetaData Example ===&lt;br /&gt;
&lt;br /&gt;
==== Using Objective-C ====&lt;br /&gt;
&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;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;unique_content_id&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot; : &amp;quot;length in seconds&amp;quot;,&lt;br /&gt;
  @&amp;quot;airdate&amp;quot; : &amp;quot;20161013 20:00:00&amp;quot;,&lt;br /&gt;
  @&amp;quot;isfullepisode&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;adloadtype&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
  @&amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
  @&amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
  @&amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {&lt;br /&gt;
  @&amp;quot;assetid&amp;quot; : &amp;quot;unique_postroll_ad_id&amp;quot;,&lt;br /&gt;
  @&amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
  @&amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
  @&amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
  @&amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using 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;assetid&amp;quot; : &amp;quot;unique_content_id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;content&amp;quot;,&lt;br /&gt;
        &amp;quot;program&amp;quot; : &amp;quot;program name&amp;quot;,&lt;br /&gt;
        &amp;quot;title&amp;quot; : &amp;quot;episode title&amp;quot;,&lt;br /&gt;
        &amp;quot;length&amp;quot; : &amp;quot;length in seconds&amp;quot;,&lt;br /&gt;
        &amp;quot;airdate&amp;quot; : &amp;quot;20200713 10:22:00&amp;quot;,&lt;br /&gt;
        &amp;quot;isfullepisode&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;adloadtype&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
        &amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
        &amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
&lt;br /&gt;
    let adMetadata = [&lt;br /&gt;
        &amp;quot;assetid&amp;quot; : &amp;quot;unique_postroll_ad_id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot; : &amp;quot;postroll&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot; : &amp;quot;c05&amp;quot;,&lt;br /&gt;
        &amp;quot;stationId&amp;quot; : &amp;quot;TESTXXYYSSWWLL&amp;quot;,&lt;br /&gt;
        &amp;quot;islivestn&amp;quot; : &amp;quot;y&amp;quot;,&lt;br /&gt;
        &amp;quot;pbstarttm&amp;quot; : &amp;quot;1631098029&amp;quot;&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Call play only when initially starting the video.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi play:channelInfo];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.play(channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the begining of playlist - see below API call sequence examples.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi loadMetadata:metadataDict];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(metadataDict)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background-color:#d0f6f8&amp;quot;&amp;gt;&lt;br /&gt;
Note: &amp;quot;playheadPosition&amp;quot; has to be called every second and the value passed should match the broadcast time for live channel.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* VOD: current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3... &amp;lt;br/&amp;gt;&lt;br /&gt;
* Live: Unix timestamp matching the broadcast time for Content and Ad (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
[self.nielsenAppApi playheadPosition:pos];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.nielsenAppApi?.playheadPosition(pos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== sendID3 ====&lt;br /&gt;
Needs to be called when ID3 Tags are included in the Video Stream.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi sendID3:id3];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.sendID3(id3)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
ID3 Tags are parsed from the Video Stream, refer to the DK Reference Implementation [http://nielsenonlinesupport.com/dk/index.htm sdkRefImplDK] on how to parse ID3 Tags included in a sample HLS Stream.&lt;br /&gt;
For further technical details, please contact your Technical Account Manager (TAM).&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.stop;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
===== Using Objective-C =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[self.nielsenAppApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===== Using Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start the Measurement ===&lt;br /&gt;
In order to start the measurement, follow the 3 first steps below i.e. for Content without Ads. When terminating the Content playback call &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; to terminate the Content Measurement for the given asset.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Playlist !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1. Start of stream || &amp;lt;code&amp;gt;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;loadMetadata(contentMetadataObject)&amp;lt;/code&amp;gt; || contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| 2. Content is playing|| &amp;lt;code&amp;gt;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;
| || &amp;lt;code&amp;gt;sendID3(id3)&amp;lt;/code&amp;gt; || id3 is an ID3 Tag parsed from the Video Stream, pass ID3 Tag immediately to SDK when found&lt;br /&gt;
|-&lt;br /&gt;
| 3. End of Stream || &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 5: Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Step 6: Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-v1.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-v1.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Step 7 : Disclose Nielsen Privacy Statement ==&lt;br /&gt;
The App SDK uses Mobile Ad IDs (Android ID or IDFA) which are fully hashed on the device before being sent to Nielsen (Nielsen never receives un-hashed values).&lt;br /&gt;
Users retain the possibility to oppose the use of Mobile Ad IDs, or to reset them, by using the functionality provided by the mobile operating system (iOS or Android).&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=da .&lt;br /&gt;
&lt;br /&gt;
== Step 8 : Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers VoD and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll Ad.&lt;br /&gt;
&lt;br /&gt;
Download the Reference Implementation for iOS [https://nielsenonlinesupport.com/dk/ios/DKRefImplSwift.zip DKRefImplSwift].&lt;br /&gt;
Unzip and open the project in Xcode, then run it i.e. in the simulator or on iOS device and then filter the Xcode output with &amp;quot;##&amp;quot; in order to see only relevant Nielsen SDK API Calls, as below:&lt;br /&gt;
&amp;lt;syntaxhighlight&lt;br /&gt;
==##&amp;gt; Nielsen SDK NielsenInit.getAppApi() - create Instance &lt;br /&gt;
==##!!&amp;gt; LandingVC -- viewDidAppear&lt;br /&gt;
==##!!&amp;gt; LandingVC -- Nielsen SDK eventOccurred&lt;br /&gt;
==##&amp;gt; Nielsen SDK .play(sdkMethods.loadChannelInfo())&lt;br /&gt;
==##&amp;gt; Nielsen SDK nielsenApi.loadMetadata&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 0 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 1 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 2 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 3 / 378&lt;br /&gt;
==##&amp;gt; Nielsen SDK updatePlayheadPosition, pos = 4 / 378&lt;br /&gt;
==##&amp;gt; terminatePlaybackSession Nielsen SDK end()&lt;br /&gt;
==##!!&amp;gt; LandingVC -- viewDidAppear&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 9 :  Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;nmr&amp;quot; and confirm presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-dmk.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=&amp;amp;fp_cr_tm=&amp;amp;fp_acc_tm=&amp;amp;fp_emm_tm=&amp;amp;ve_id=&amp;amp;devmodel=&amp;amp;manuf=&amp;amp;sysname=&amp;amp;sysversion=&amp;amp;sessionId=zlmmxkq867zt4bpnumlyz6dpn9hyp1610980356&amp;amp;tl=Episode%201&amp;amp;prv=1&amp;amp;c6=vc%2Cc77&amp;amp;ca=us-500207_c77_VID5556674-123456&amp;amp;cg=TAMSample%20DK&amp;amp;c13=asid%2CP10DF14BA-937E-436D-99DF-ED39A0422387&amp;amp;c32=segA%2CNA&amp;amp;c33=segB%2CNA&amp;amp;c34=segC%2CNA&amp;amp;c15=apn%2C&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=0&amp;amp;cr=4_00_99_V1_00000&amp;amp;c9=devid%2C&amp;amp;enc=true&amp;amp;c1=nuid%2C999&amp;amp;at=view&amp;amp;rt=video&amp;amp;c16=sdkv%2Cbj.6.0.0&amp;amp;c27=cln%2C0&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid%2C16109803568088038&amp;amp;c30=bldv%2C6.0.0.563&amp;amp;st=dcr&amp;amp;c7=osgrp%2C&amp;amp;c8=devgrp%2C&amp;amp;c10=plt%2C&amp;amp;c40=adbid%2C&amp;amp;c14=osver%2CNA&amp;amp;c26=dmap%2C1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid%2C&amp;amp;c36=cref1%2C&amp;amp;c37=cref2%2C&amp;amp;c11=agg%2C1&amp;amp;c12=apv%2C&amp;amp;c51=adl%2C0&amp;amp;c52=noad%2C0&amp;amp;sd=170&amp;amp;devtypid=&amp;amp;pc=NA&amp;amp;c53=fef%2Cy&amp;amp;c54=oad%2C20200713%2010%3A22%3A00&amp;amp;c55=cref3%2C&amp;amp;c57=adldf%2C2&amp;amp;ai=VID5556674-123456&amp;amp;c3=st%2Cc&amp;amp;c64=starttm%2C1610980392&amp;amp;adid=VID5556674-123456&amp;amp;c58=isLive%2Cfalse&amp;amp;c59=sesid%2Cgezrb92q4i9b9jg7acxgn783gjw0a1610980365&amp;amp;c61=createtm%2C1610980392&amp;amp;c63=pipMode%2C&amp;amp;c68=bndlid%2C&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype%2C&amp;amp;c74=dvcnm%2C&amp;amp;c76=adbsnid%2C&amp;amp;c77=adsuprt%2C2&amp;amp;uoo=&amp;amp;evdata=&amp;amp;c71=ottflg%2C0&amp;amp;c72=otttyp%2Cnone&amp;amp;c44=progen%2C&amp;amp;davty=0&amp;amp;si=http%3A%2F%2Fnielsenonlinesupport.com%2Fdk%2Findex.htm&amp;amp;c66=mediaurl%2Cassets%252FRTVOD_C3%252Fprog_index.m3u8&amp;amp;c62=sendTime%2C1610980392&amp;amp;rnd=714644&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 10 :  Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Step 11 :  Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), disable debug logging by deleting {nol_devDebug: &amp;quot;DEBUG&amp;quot;} from initialization call - see Step 2.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6537</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6537"/>
		<updated>2023-09-28T11:43:49Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&lt;br /&gt;
==== Special Notes regarding iOS17 or TVOS17  ====&lt;br /&gt;
Beginning with iOS/TVOS 17, Apple is adding several requirements for App developers around tracking, use of Identifier For Advertisers (IDFA), and certain system APIs.&lt;br /&gt;
&lt;br /&gt;
Since AGF market is not making use of the IDFA, the change is expected to have no impact.&lt;br /&gt;
&lt;br /&gt;
However, in order to minimize any eventual impact, we are asking that AGF clients do the following:&lt;br /&gt;
&lt;br /&gt;
* '''Do not declare the Nielsen nmrodam.com domain in the privacy manifest'''&lt;br /&gt;
* Update to the latest Nielsen SDK release &amp;gt;= 9,2.0.0 when compiling your app for iOS 17&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For any additional information please refer to the Nielsen global page: [[DCR and DTVR with iOS17 or TVOS17]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== General  ====&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Werbung&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Czech_Video_Browser_SDK&amp;diff=6528</id>
		<title>DCR Czech Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Czech_Video_Browser_SDK&amp;diff=6528"/>
		<updated>2023-09-25T09:36:32Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Step 1: Configure SDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{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. If not, please contact Nielsen local staff - See [[Czech Contacts]].&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;
== Step 1: Configure SDK ==&lt;br /&gt;
Add the following script tag (Static Queue Snippet) 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(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&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;
== Step 2: Create SDK Instance==&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call (already added in above code):&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;appid&amp;quot;, &amp;quot;instanceName&amp;quot;, {debugMode&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When creating an instance, pass the following  values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Required !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||Yes	||'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance or Player||Yes	 ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| debugMode	|| Enables Nielsen console logging. Only required for testing	||No	|| &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;
For development phase  - including DEBUG mode&amp;lt;br /&amp;gt;&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;PXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;myPlayerName&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;
&lt;br /&gt;
For production phase (after approval)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;,&amp;quot;myPlayerName&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&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: “nlsSDK600.bundle.min.js”.&lt;br /&gt;
&lt;br /&gt;
== Step 3: Create Metadata Objects ==&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&amp;lt;br /&amp;gt;&lt;br /&gt;
&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;
=== Content Metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&amp;lt;br /&amp;gt;&lt;br /&gt;
See [[Czech SDK Metadata]].&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata should be passed for each individual ad.&amp;lt;br /&amp;gt;&lt;br /&gt;
See [[Czech SDK Metadata]].&lt;br /&gt;
&lt;br /&gt;
== Step 4 : Call Nielsen APIs ==&lt;br /&gt;
The method for calling SDK API 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('eventName', parameter);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Type of SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description!! Example&lt;br /&gt;
|-&lt;br /&gt;
| loadMetadata	|| content or ad metadata JSON || Needs to be called at the beginning of each asset|| nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, metadataObjectContent)&lt;br /&gt;
|-&lt;br /&gt;
| setPlayheadPosition|| playhead position in seconds as integer	|| Pass playhead position every second during playback. for VOD: pass current position in seconds.  for Live: current Unix timestamp (seconds since Jan-1-1970 UTC) - if it's possible to seek back in Live content, then pass related Unix timestamp (not current)|| nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, currentPosition);&lt;br /&gt;
|-&lt;br /&gt;
| stop ||	playhead position in seconds as integer		|| Call when content or ads complete playing and pass playhead position, call stop when pausing playback|| nSdkInstance.ggPM(&amp;quot;stop&amp;quot;, parseInt(playerPosition));&lt;br /&gt;
|-&lt;br /&gt;
| end || playhead position in seconds as integer	|| Call when the current video asset completes playback and pass the playhead position.|| nSdkInstance.ggPM(&amp;quot;end&amp;quot;, parseInt(playerPosition));&lt;br /&gt;
|}&lt;br /&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;
* If 1st video in playlist is content - call 'loadMetadata' for content. If 1st video in playlist is ad (not content), call 'loadMetadata' for content and than 'loadMetadata' for add - see below SDK Event Lifecycle.&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;
&lt;br /&gt;
* If last video in playlist is content (not ad) - call 'end' at the end of playlist. If last video in playlist in ad (not content), than call 'end' at the end of content video and stop at the end of ad - see bellow SDK Event Sequence. Summary: call 'end' 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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Event Sequence ===&lt;br /&gt;
The sample event life-cycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
Playlist for this sample is : preRoll → content → midRoll → content resumed → postRoll&lt;br /&gt;
&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;
&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;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 5 : Interrupt Scenarios ==&lt;br /&gt;
Even when user or system interrupts playback you have to make sure that such interrupt will be handles as follows:&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
To indicate pause, stop passing the playhead position to the SDK and call STOP event. 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. ad 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;
  // indicate &amp;lt;stop&amp;gt; inside 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;
== Step 6 : 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&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. 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;
The following paragraph is a template for an opt-out statement (in Czech).&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Tato aplikace obsahuje proprietární měřicí software společnosti Nielsen, který uživatelům umožní přispívat k průzkumu trhu. Chcete-li se dozvědět více o informacích, které může software Nielsen shromažďovat a o Vaší možnosti měření deaktivovat, přečtěte si zásady ochrany osobních údajů Nielsen Digital Measurement na &amp;lt;a href=http://cdn-gl.imrworldwide.com/priv/browser/cz/cs/optout.html&amp;gt;Nielsen Digital Measurement Privacy Policy&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Opt-out status ===&lt;br /&gt;
Optional : to retrieve Opt-Out status call getOptOutStatus() , result is boolean value true (OptOuted = not measuring) or false (not OptOuted = measuring).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.getOptOutStatus();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7 : Test your player by yourself ==&lt;br /&gt;
See how to test the player at https://www.youtube.com/watch?v=t9eUsf9yh8w&lt;br /&gt;
&lt;br /&gt;
=== Test SDK API calls ===&lt;br /&gt;
Use the Chrome and install add-on to verify SDK API calls: &amp;quot;Nielsen SDK Inspector&amp;quot; (https://chrome.google.com/webstore/search/%20Nielsen%20SDK%20Inspector)&lt;br /&gt;
&lt;br /&gt;
=== Test outgoing pings ===&lt;br /&gt;
to verify outgoing pings use Charles Proxy or any other proxy sw capable to sniff your network traffic. Filter URLs to &amp;quot;imrworld&amp;quot;.&lt;br /&gt;
Example of such ping :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-eu-cert.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=de-205177&amp;lt;wbr /&amp;gt;&amp;amp;ch=de-205177_c01_static-123_P&amp;lt;wbr /&amp;gt;&amp;amp;asn=static-123&amp;lt;wbr /&amp;gt;&amp;amp;prv=1&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,c01&amp;lt;wbr /&amp;gt;&amp;amp;ca=NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,T74896328-A13B-4985-8798-0AEBFA228D3E&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,segA%20example&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,segB%20example&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,segC%20example&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,&amp;lt;wbr /&amp;gt;&amp;amp;sup=1&amp;lt;wbr /&amp;gt;&amp;amp;segment2=&amp;lt;wbr /&amp;gt;&amp;amp;segment1=&amp;lt;wbr /&amp;gt;&amp;amp;forward=0&amp;lt;wbr /&amp;gt;&amp;amp;ad=0&amp;lt;wbr /&amp;gt;&amp;amp;cr=V&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,88b7cd07-f83d-45b1-8db1-20b4e2caae55&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,bj.6.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,0&amp;lt;wbr /&amp;gt;&amp;amp;crs=&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,14966485169569829&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,6.0.0.1&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,NA&amp;lt;wbr /&amp;gt;&amp;amp;c26=dmap,1&amp;lt;wbr /&amp;gt;&amp;amp;dd=&amp;lt;wbr /&amp;gt;&amp;amp;hrd=&amp;lt;wbr /&amp;gt;&amp;amp;wkd=&amp;lt;wbr /&amp;gt;&amp;amp;c35=adrsid,&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,&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=&amp;lt;wbr /&amp;gt;&amp;amp;pc=NA&amp;lt;wbr /&amp;gt;&amp;amp;c53=fef,n&amp;lt;wbr /&amp;gt;&amp;amp;c54=oad,&amp;lt;wbr /&amp;gt;&amp;amp;c55=cref3,&amp;lt;wbr /&amp;gt;&amp;amp;c57=adldf,2&amp;lt;wbr /&amp;gt;&amp;amp;ai=static-123&amp;lt;wbr /&amp;gt;&amp;amp;c3=st,c&amp;lt;wbr /&amp;gt;&amp;amp;c64=starttm,1496648518&amp;lt;wbr /&amp;gt;&amp;amp;adid=static-123&amp;lt;wbr /&amp;gt;&amp;amp;c58=isLive,false&amp;lt;wbr /&amp;gt;&amp;amp;c59=sesid,&amp;lt;wbr /&amp;gt;&amp;amp;c61=createtm,1496648517&amp;lt;wbr /&amp;gt;&amp;amp;c63=pipMode,&amp;lt;wbr /&amp;gt;&amp;amp;c68=bndlid,&amp;lt;wbr /&amp;gt;&amp;amp;c73=phtype,&amp;lt;wbr /&amp;gt;&amp;amp;c74=dvcnm,&amp;lt;wbr /&amp;gt;&amp;amp;c76=adbsnid,&amp;lt;wbr /&amp;gt;&amp;amp;df=0&amp;lt;wbr /&amp;gt;&amp;amp;sessionId=14966485169569829&amp;lt;wbr /&amp;gt;&amp;amp;c44=progen,&amp;lt;wbr /&amp;gt;&amp;amp;davty=0&amp;lt;wbr /&amp;gt;&amp;amp;si=http%3A%2F%2Fsdkdemo.admosphere.cz%2FBrowserSdk6static%2Fdemo1cz%2F&amp;lt;wbr /&amp;gt;&amp;amp;c66=mediaurl,&amp;lt;wbr /&amp;gt;&amp;amp;c62=sendTime,1496648517&amp;lt;wbr /&amp;gt;&amp;amp;rnd=496564&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8 : Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for verification - see [[Czech Contacts]].&lt;br /&gt;
&lt;br /&gt;
== Step 9 : Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), users will need to disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call - see Step 2.&lt;br /&gt;
&lt;br /&gt;
== Demos ==&lt;br /&gt;
See live demos with sample implementation available at http://sdkdemo.admosphere.cz/&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Czech_Static_Browser_SDK&amp;diff=6527</id>
		<title>DCR Czech Static Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Czech_Static_Browser_SDK&amp;diff=6527"/>
		<updated>2023-09-25T09:35:33Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Step 1:  Add Static Queue Snippet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable page measurement (aka Static) on your website(s). The Nielsen Tracking Code must be added to each page with different metadata.&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. If not, please contact Nielsen local staff - see [[Czech Contacts]].&amp;lt;br /&amp;gt;&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;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Add Static Queue Snippet ==&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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has the below parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Required !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||Yes	||'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance||Yes	 ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	||No	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&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;
== Step 3: Create Metadata Object ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys.&lt;br /&gt;
See [[Czech Metadata]].&lt;br /&gt;
&amp;lt;br /&amp;gt;&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;
So for example, if your site has 30 sections (e.g. News, Sports, Videos, Music, etc.), we would only measure for the first 25 sections. The same applies to the custom breakout parameters segA/B/C.&lt;br /&gt;
&lt;br /&gt;
== Step 4: Call staticstart Event ==&lt;br /&gt;
Start static measurement :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 5: Call staticend Event ==&lt;br /&gt;
Stop static measurement = to end the current static session and track a new static content:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticend' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticend&amp;quot;, nielsenMetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter. &amp;lt;br /&amp;gt;&lt;br /&gt;
Recommendation : Do not place this call inside onBeforeUnload method, because SDK need some time and resources to deliver data to cloud.&lt;br /&gt;
&lt;br /&gt;
== Step 6 : 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&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. 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;
The following paragraph is a template for an opt-out statement (in Czech).&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Tato aplikace obsahuje proprietární měřicí software společnosti Nielsen, který uživatelům umožní přispívat k průzkumu trhu. Chcete-li se dozvědět více o informacích, které může software Nielsen shromažďovat a o Vaší možnosti měření deaktivovat, přečtěte si zásady ochrany osobních údajů Nielsen Digital Measurement na &amp;lt;a href=https://www.nielsen.com/cz/cs/legal/privacy-statement/digital-measurement/&amp;gt;Nielsen Digital Measurement Privacy Policy&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Opt-out status ===&lt;br /&gt;
Optional : to retrieve Opt-Out status call getOptOutStatus() , result is boolean value true (OptOuted = not measuring) or false (not OptOuted = measuring).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.getOptOutStatus();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7 : Test your player by your self ==&lt;br /&gt;
&lt;br /&gt;
see how to test player at https://www.youtube.com/watch?v=t9eUsf9yh8w&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
=== Test SKD API calls ===&lt;br /&gt;
to verify SDK API calls use Chrome and install add-on called &amp;quot;Nielsen SDK Inspector&amp;quot; (https://chrome.google.com/webstore/search/%20Nielsen%20SDK%20Inspector)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Test outgoing pings ===&lt;br /&gt;
to verify outgoing pings use Charles Proxy or any other proxy sw capable to sniff your network traffic. Filter URLs to &amp;quot;imrworld&amp;quot;.&lt;br /&gt;
Example of such ping :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://secure-eu-cert.imrworldwide.com&amp;lt;/nowiki&amp;gt;/cgi-bin/gn?prd=dcr&amp;lt;wbr /&amp;gt;&amp;amp;ci=de-205177&amp;lt;wbr /&amp;gt;&amp;amp;ch=de-205177_c01_static-123_P&amp;lt;wbr /&amp;gt;&amp;amp;asn=static-123&amp;lt;wbr /&amp;gt;&amp;amp;sessionId=b45a84a8-7847-4b2d-8cec-36baad20ed29&amp;lt;wbr /&amp;gt;&amp;amp;prv=1&amp;lt;wbr /&amp;gt;&amp;amp;c6=vc,c01&amp;lt;wbr /&amp;gt;&amp;amp;ca=NA&amp;lt;wbr /&amp;gt;&amp;amp;c13=asid,T74896328-A13B-4985-8798-0AEBFA228D3E&amp;lt;wbr /&amp;gt;&amp;amp;c32=segA,segA%20example&amp;lt;wbr /&amp;gt;&amp;amp;c33=segB,segB%20example&amp;lt;wbr /&amp;gt;&amp;amp;c34=segC,segC%20example&amp;lt;wbr /&amp;gt;&amp;amp;c15=apn,&amp;lt;wbr /&amp;gt;&amp;amp;sup=1&amp;lt;wbr /&amp;gt;&amp;amp;segment2=&amp;lt;wbr /&amp;gt;&amp;amp;segment1=&amp;lt;wbr /&amp;gt;&amp;amp;forward=0&amp;lt;wbr /&amp;gt;&amp;amp;ad=0&amp;lt;wbr /&amp;gt;&amp;amp;cr=V&amp;lt;wbr /&amp;gt;&amp;amp;c9=devid,&amp;lt;wbr /&amp;gt;&amp;amp;enc=true&amp;lt;wbr /&amp;gt;&amp;amp;c1=nuid,2ccec3b2-36a5-4eeb-a408-4d6eec7e1083&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,bj.6.0.0&amp;lt;wbr /&amp;gt;&amp;amp;c27=cln,0&amp;lt;wbr /&amp;gt;&amp;amp;crs=&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,14991647575861178&amp;lt;wbr /&amp;gt;&amp;amp;c30=bldv,6.0.0.15&amp;lt;wbr /&amp;gt;&amp;amp;st=dcr&amp;lt;wbr /&amp;gt;&amp;amp;c7=osgrp,&amp;lt;wbr /&amp;gt;&amp;amp;c8=devgrp,&amp;lt;wbr /&amp;gt;&amp;amp;c10=plt,&amp;lt;wbr /&amp;gt;&amp;amp;c40=adbid,&amp;lt;wbr /&amp;gt;&amp;amp;c14=osver,NA&amp;lt;wbr /&amp;gt;&amp;amp;c26=dmap,1&amp;lt;wbr /&amp;gt;&amp;amp;dd=&amp;lt;wbr /&amp;gt;&amp;amp;hrd=&amp;lt;wbr /&amp;gt;&amp;amp;wkd=&amp;lt;wbr /&amp;gt;&amp;amp;c35=adrsid,&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,&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=&amp;lt;wbr /&amp;gt;&amp;amp;pc=NA&amp;lt;wbr /&amp;gt;&amp;amp;c53=fef,n&amp;lt;wbr /&amp;gt;&amp;amp;c54=oad,&amp;lt;wbr /&amp;gt;&amp;amp;c55=cref3,&amp;lt;wbr /&amp;gt;&amp;amp;c57=adldf,2&amp;lt;wbr /&amp;gt;&amp;amp;ai=static-123&amp;lt;wbr /&amp;gt;&amp;amp;c3=st,c&amp;lt;wbr /&amp;gt;&amp;amp;c64=starttm,1499164759&amp;lt;wbr /&amp;gt;&amp;amp;adid=static-123&amp;lt;wbr /&amp;gt;&amp;amp;c58=isLive,false&amp;lt;wbr /&amp;gt;&amp;amp;c59=sesid,&amp;lt;wbr /&amp;gt;&amp;amp;c61=createtm,1499164772&amp;lt;wbr /&amp;gt;&amp;amp;c63=pipMode,&amp;lt;wbr /&amp;gt;&amp;amp;c68=bndlid,&amp;lt;wbr /&amp;gt;&amp;amp;nodeTM=&amp;lt;wbr /&amp;gt;&amp;amp;logTM=&amp;lt;wbr /&amp;gt;&amp;amp;c73=phtype,&amp;lt;wbr /&amp;gt;&amp;amp;c74=dvcnm,&amp;lt;wbr /&amp;gt;&amp;amp;c76=adbsnid,&amp;lt;wbr /&amp;gt;&amp;amp;df=0&amp;lt;wbr /&amp;gt;&amp;amp;c44=progen,&amp;lt;wbr /&amp;gt;&amp;amp;davty=0&amp;lt;wbr /&amp;gt;&amp;amp;si=http%3A%2F%2Fsdkdemo.admosphere.cz%2FBrowserSdk6static%2Fdemo1cz%2F&amp;lt;wbr /&amp;gt;&amp;amp;c66=mediaurl,&amp;lt;wbr /&amp;gt;&amp;amp;c62=sendTime,1499164772&amp;lt;wbr /&amp;gt;&amp;amp;rnd=397839&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8 : Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for verification - see [[Czech Contacts]].&lt;br /&gt;
&lt;br /&gt;
== Step 9 : Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), users will need to disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call - see Step 2.&lt;br /&gt;
&lt;br /&gt;
== Demos ==&lt;br /&gt;
see live demos with sample implementation available at at http://sdkdemo.admosphere.cz/&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_AppSDK_Flavors&amp;diff=6477</id>
		<title>DCR AppSDK Flavors</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_AppSDK_Flavors&amp;diff=6477"/>
		<updated>2023-08-02T12:25:05Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}} Category:Digital  __TOC__  ==  Android AppSDK Flavors ==  '''There are 3 ver...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==  Android AppSDK Flavors ==&lt;br /&gt;
&lt;br /&gt;
'''There are 3 versions available starting with the Nielsen AppSDK 8.1.0.0.'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! AppSDK Flavor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''Android Ad Version'''&lt;br /&gt;
| &lt;br /&gt;
* With the Ad Framework&lt;br /&gt;
* Opt-In and Opt-Out functionality managed by Opt out of Ads Personlization setting on device. &lt;br /&gt;
* The Nielsen AppSDK will collect the [https://developer.android.com/training/articles/ad-id Google Advertising ID] unless the user Opts Out.&lt;br /&gt;
* If the Google Play Service is unavailable, (ie: Amazon and Huawei devices) the Nielsen AppSDK will secure the Android ID.&lt;br /&gt;
|-&lt;br /&gt;
| '''Android No Ad Framework'''&lt;br /&gt;
| &lt;br /&gt;
* Without the Ad Framework, the Nielsen AppSDK cannot read the Google Advertising ID, so will retrieve the '''AndroidID'''.&lt;br /&gt;
* The AndroidID is a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user and device.&lt;br /&gt;
* The developer is required to present the User Choice Opt Out page which is described in the Privacy Section.&lt;br /&gt;
|-&lt;br /&gt;
| '''Android AppSDK noID'''&lt;br /&gt;
| &lt;br /&gt;
* This version of the Nielsen AppSDK is perfect for Kid apps, or where no ID is required.&lt;br /&gt;
* Please review the Privacy Section&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==   iOS AppSDK Flavors ==&lt;br /&gt;
'''There are 3 versions available starting with the Nielsen AppSDK 8.0.0.0.'''. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! AppSDK Flavor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS Ad Version'''&lt;br /&gt;
| &lt;br /&gt;
* With the Ad Framework&lt;br /&gt;
* Opt-In and Opt-Out functionality managed by the [https://developer.apple.com/documentation/apptrackingtransparency AppTrackingTransparency framework].&lt;br /&gt;
* The Nielsen AppSDK will attempt to collect the IDFA (Id for Advertisers) on the device.&lt;br /&gt;
* For iOS14+, if the value '''ATTrackingManager.AuthorizationStatus.authorized''' is returned.&lt;br /&gt;
* If the device is running iOS12 or iOS13, the Limit Ad Tracking setting is requested.&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS No Ad Framework'''&lt;br /&gt;
| &lt;br /&gt;
* Without the Ad Framework, the Nielsen AppSDK cannot read the IDFA, so it will attempt to retrieve the '''IDFV'''.&lt;br /&gt;
* The [https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor ID for Vendors (IDFV)], may be used for analytics across apps from the same content provider.&lt;br /&gt;
* The developer is required to present the User Choice Opt Out page which is described in the Privacy Section.&lt;br /&gt;
|-&lt;br /&gt;
| '''iOS AppSDK noID'''&lt;br /&gt;
| &lt;br /&gt;
* This version of the Nielsen AppSDK is perfect for Kid apps, or where no ID is required.&lt;br /&gt;
* Please review the Privacy Section&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6414</id>
		<title>DCR Germany Static Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6414"/>
		<updated>2023-07-14T11:15:20Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{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 Web pages. It supports static content measurement 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;
This guide will show you how to enable page measurement (aka Static) on your website(s). The Nielsen Tracking Code must be added to each page with different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Add Static Queue Snippet ==&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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website i.e. within the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; tag :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
	// Add Static Queue Snippet&lt;br /&gt;
	!function(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has the below parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Required !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||Yes	||'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance||Yes	 ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	||No	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&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;
== Step 3: Create Metadata Object ==&lt;br /&gt;
The full description of the other key/value pairs for Metadata can be found here:&lt;br /&gt;
'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
=== Example Web Page Metadata Object ===&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;
  window.articlemetadata = {&lt;br /&gt;
    type: &amp;quot;static&amp;quot;,&lt;br /&gt;
    assetid: &amp;quot;Unique_page_ID&amp;quot;, &lt;br /&gt;
	section:  &amp;quot;Unique_section_ID&amp;quot;, &lt;br /&gt;
    segA: &amp;quot;Unique_section_segA&amp;quot;, &lt;br /&gt;
    segB: &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
    segC: &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
    subbrand: &amp;quot;subbrand_received_from_Nielsen&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;
== Step 4: Call staticstart Event ==&lt;br /&gt;
Start static measurement :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] When using the same Browser SDK instance to measure different pages, Call &amp;lt;code&amp;gt;&amp;quot;staticend&amp;quot;&amp;lt;/code&amp;gt; to stop the static measurement of the current page before starting a new measurement with &amp;lt;code&amp;gt;&amp;quot;staticstart&amp;quot;&amp;lt;/code&amp;gt; for the next page.''' &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 5: Include the measurement of Advertising Medium (Werbeträger) if applicable  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
A page impression is a user action on the page that leads or could lead to an advertisement being called up. Each user action may only be counted once.&lt;br /&gt;
&lt;br /&gt;
However, a page impression occurs when the content of the viewport of the respective device is completely reloaded/rendered by scrolling/swiping and replaced by new&lt;br /&gt;
content.&lt;br /&gt;
&lt;br /&gt;
When counting views, a distinction is made between content&lt;br /&gt;
views (CPI) and advertising medium views after a user action (WPI). There can be&lt;br /&gt;
only one content view per page. Each additional user action on the same page (click,&lt;br /&gt;
scroll or swipe, e.g. click through an image gallery) will lead to an advertising medium view (WPI) accordingly. The implementation should follow the IVW guidelines for&lt;br /&gt;
defining user actions.&lt;br /&gt;
&lt;br /&gt;
'''Note''':&lt;br /&gt;
The differentiation between the measurement of Content vs. advertising medium is achieved by setting accordingly the &amp;quot;segB&amp;quot; value in the metadata object  , see '''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]''' &lt;br /&gt;
&lt;br /&gt;
=== Implementation Details ===&lt;br /&gt;
How to trigger a page impression for advertising medium?&lt;br /&gt;
In order to trigger a a new view for an advertising medium, you have to stop the measurement of the page and start the measurement of the advertising medium, see example code below:&lt;br /&gt;
&lt;br /&gt;
* Stop static measurement for the page(current metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticend' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticend&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start static measurement for the advertising medium after user interaction(new metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.adMediummetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 6: Implement bfcache detection for mobile devices (i.e. back button) ==&lt;br /&gt;
&lt;br /&gt;
On mobile devices some content can be loaded by the browser from the cache on mobile devices and in this case no Browser SDK measurement will occur.&lt;br /&gt;
Please use the 'Pagehow' event in order to enable the browser SDK measurement by calling browser SDK (BSDK) APIs. Namely end the current measurement(&amp;quot;staticend&amp;quot;) and then start a new measurement for the page loaded from bfcache (&amp;quot;staticstart&amp;quot;): see simple example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function bfcacheHandler() {&lt;br /&gt;
//Use 'pageshow' event in order to control Nielsen Browser SDK&lt;br /&gt;
&lt;br /&gt;
//This is the addEventListener for detecting bfcache.&lt;br /&gt;
&lt;br /&gt;
window.addEventListener(&amp;quot;pageshow&amp;quot;, (event) =&amp;gt; {&lt;br /&gt;
if (event.persisted) {&lt;br /&gt;
console.log(&amp;quot;This page was restored from the bfcache.&amp;quot;);&lt;br /&gt;
// glaobal Browser SDK Instance used to measure all pages&lt;br /&gt;
//## window.nSdkInstance&lt;br /&gt;
// terminate the measurement of the previous page&lt;br /&gt;
window.nSdkInstance.ggPM(&amp;quot;staticend&amp;quot;, previousarticlemetadata);&lt;br /&gt;
// start the measurement of the new page loaded from bfcache&lt;br /&gt;
window.nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, newarticlemetadata);&lt;br /&gt;
} else {&lt;br /&gt;
console.log(&amp;quot;This page was loaded normally.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7: Review Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
==Step 8:  Testing ==&lt;br /&gt;
'''Monitoring Tools'''&lt;br /&gt;
Testing the Browser Implementation&lt;br /&gt;
&lt;br /&gt;
The steps to test the implementation are given below.&lt;br /&gt;
&lt;br /&gt;
'''Step 8.1'''&lt;br /&gt;
&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;nmr&amp;quot; to capture traffic from the SDK. This will capture traffic going to Nielsen servers.&lt;br /&gt;
&lt;br /&gt;
'''Step 8.2'''&lt;br /&gt;
&lt;br /&gt;
Verify that the Nielsen SDK is being downloaded correctly and is the correct version.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://cdn-gl.nmrodam.com/novms/js/2/nlsSDK600.bundle.min.js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 8.3'''&lt;br /&gt;
&lt;br /&gt;
When the page is loaded for the first time, the Browser SDK fires a View ping as soon as content is loaded. Utilizing your HTTP traffic filter tool, you can now validate the metadata that is being sent to the Nielsen collection servers.&lt;br /&gt;
&lt;br /&gt;
Example View Ping Below:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;https://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_Main-GTM_P&amp;amp;asn=Main-GTM&amp;amp;sessionId=8l2XGnAW6IC3Cc2MIMh0RYRTqimuU1553108759&amp;amp;prv=1&amp;amp;c6=vc,c77&amp;amp;ca=NA&amp;amp;c13=asid,P00BEB680-1F1A-47BB-922D-1BD2F1BA79A7&amp;amp;c32=...&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step 8.4'''&lt;br /&gt;
&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed and is indicated by the cr value containing a D. This should fire every 5 minutes but only when the page is in focus.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;st=dcr&amp;amp;rt=text&amp;amp;forward=0&amp;amp;sup=0&lt;br /&gt;
&amp;amp;ad=0&amp;amp;asn=%2Fsdk2%2Findex2.html&amp;amp;ci=us-500270&amp;amp;c6=vc,c77&amp;amp;c9=devid,&amp;amp;c11=agg,1&lt;br /&gt;
&amp;amp;c12=apv,3&amp;amp;c13=asid,PAA3A8EF7-E6D2-4A9E-9787-BDXXXXXXXXXX&amp;amp;c15=apn,Test2&lt;br /&gt;
&amp;amp;c16=sdkv,bj.5.1.5&amp;amp;c26=dmap,1&amp;amp;c29=plid,14767465028039340&amp;amp;c30=bldv,1.0.0.15&amp;amp;c32=segA,USA&lt;br /&gt;
&amp;amp;c33=segB,CA&amp;amp;c34=segC,RSM&amp;amp;at=timer&amp;amp;cr=D&amp;amp;c27=cln,300&amp;amp;rnd=857576&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 9: 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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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;br /&gt;
&lt;br /&gt;
== Step 10: Review the Sample Implementation for your Reference ==&lt;br /&gt;
The Sample Implementation for AGF located [https://nielsenonlinesupport.com/agf/sdkRefImpStaticDE/bsdkstatic.htm here].&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6395</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6395"/>
		<updated>2023-06-30T09:08:21Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Werbung&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6394</id>
		<title>DCR Germany Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6394"/>
		<updated>2023-06-30T09:05:46Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 browser 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) - e.g. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&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;
&lt;br /&gt;
/* NLSQUEUE build v*/&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&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 files 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(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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. Users 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;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Example Content metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  '88675545',&lt;br /&gt;
  program:  'Program Name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '3600',&lt;br /&gt;
  nol_c0:  'p0,1',&lt;br /&gt;
  nol_c2:  'p2,Y',&lt;br /&gt;
  nol_c7:  'p7,videoid123',&lt;br /&gt;
  nol_c8:  'p8,3600',&lt;br /&gt;
  nol_c9:  'p9,VideoTitle123',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c12: 'p12,content',&lt;br /&gt;
  nol_c18: 'p18,N'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &lt;br /&gt;
==== Ad Metadata ====&lt;br /&gt;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Ad metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var ad_metadata_object = {  &lt;br /&gt;
  type:     'preroll',&lt;br /&gt;
  assetid:  'ad345-67483',&lt;br /&gt;
  title:    'ad_title',&lt;br /&gt;
  length:   '25',&lt;br /&gt;
  nol_c8:  'p8,25',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c11: 'p11,2352723141',&lt;br /&gt;
  nol_c12: 'p12,Werbung',&lt;br /&gt;
  nol_c17: 'p17,preroll'&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;
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;
== Livestream ==&lt;br /&gt;
For '''Livestreams'''  please make sure playheadPosition is in UNIX-Timestamp for Content.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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 parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6393</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6393"/>
		<updated>2023-06-30T09:03:09Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* DCR Integration Utilizing Cloud API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: orange&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that you have to use the Staging Cloud API Endpoint until you get the green light from Nielsen to move to Production!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    var timestamp_ms = new Date().getTime();&lt;br /&gt;
    uid += String(timestamp_ms).substring(3);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Werbung&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for AGF by selection Germany in the country dropbox [https://nielsenonlinesupport.com/agf/RefImplCloudAPI/index.htm?debug=true RefImplCloudAPI].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6390</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6390"/>
		<updated>2023-06-19T12:51:27Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: orange&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that you have to use the Staging Cloud API Endpoint until you get the green light from Nielsen to move to Production!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    var timestamp_ms = new Date().getTime();&lt;br /&gt;
    uid += String(timestamp_ms).substring(3);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for AGF by selection Germany in the country dropbox [https://nielsenonlinesupport.com/agf/RefImplCloudAPI/index.htm?debug=true RefImplCloudAPI].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://???.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6365</id>
		<title>Sweden SDK Metadata</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6365"/>
		<updated>2023-05-30T08:39:58Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Content Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= Digital Metadata =&lt;br /&gt;
Digital Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 1''' focuses on the content metadata&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 2''' focuses on the Ad metadata.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Content Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||  || type of asset || &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| userid ||  || the user login ID. Used by MMS reach model. ''The uploaded value needs to be hashed with SHA512''. This is the user login ID on player. We prefer a numeric value. (please '''do not''' use user email address)|| &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa...&amp;quot; || required if login feature&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Content ID, mms_tid || unique ID assigned to an asset within the same media house. (max: 20 characters).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; In addition to this metadata for content needs to be reported to MMS via TitleService. Contact online@mms.se for more information. || &lt;br /&gt;
&amp;lt;small&amp;gt;For VoD use internal format. [https://engineeringportal.nielsen.com/docs/Special_Characters No special characters]&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;For content on simulcast channels, this has a standard format: simulcast_channelnumber ('''Example''' for Channel TV4, the expected value is: simulcast_29).&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;A complete list of channel reference libraries with channel numbers is on the  [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓ &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of content in seconds || Length of content in seconds. &lt;br /&gt;
* &amp;lt;small&amp;gt;for VoD, video length&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for event-Live stream, the planned length.&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for simulcast and 24/7 live stream, 86400&amp;lt;/small&amp;gt;&lt;br /&gt;
 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientpassparam || MMS Values, mms_values || pass-through parameters || For clients that provide DAI (dynamic ad insertion) service, this has a standard format: origcode=channelnumber.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' origcode=29&lt;br /&gt;
See the complete list of channel reference library with the channel number on [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt; &amp;lt;br&amp;gt; &amp;lt;small&amp;gt;Please use string, JSON format is not accepted. &amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Length limit: 250 characters. A longer string may be truncated due to URL length limitation.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| required for clients that have DAI service (Telia, Telenor, Allente, Comhem, Boxer, Sappa, Discovery, Cmore)&lt;br /&gt;
|-&lt;br /&gt;
| program || Program Name, ns_st_pr || program name || '''custom''' '''example:''' leif-och-billy &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode Name, ns_st_ep || episode name || '''custom''' '''example:''' en-ny-tjej-i-byn &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| playlisttitle || Title Playlist, ns_st_pl || playlist reference as a string || string value with playlist name for '''example:''' barn || &lt;br /&gt;
|-&lt;br /&gt;
| ispremiumcontent || MMS Premium, mms_premium || identify premium level via yes or no || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isautoplay || Auto Start, mms_auto || identify if autoplay is enabled on the video || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| plugv || Player Version, ns_st_mv || player version. increment by 1 for each new version. || alphanumeric '''example:''' 1.0.1 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| playerv || Mediaplayer, ns_st_mp || player identifier || alphanumeric '''example:''' HTML5, JW Player, Sonic  || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject = {&lt;br /&gt;
  type: &amp;quot;content&amp;quot;, &lt;br /&gt;
  userid: &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa…&amp;quot;, &lt;br /&gt;
  assetid: &amp;quot;simulcast_29&amp;quot;,&lt;br /&gt;
  length: &amp;quot;3359&amp;quot;, //seconds&lt;br /&gt;
  clientpassparam: &amp;quot;origcode=29&amp;quot;,&lt;br /&gt;
  program: &amp;quot;leif-och-billy&amp;quot;,&lt;br /&gt;
  title: &amp;quot;en-ny-tjej-i-byn&amp;quot;,&lt;br /&gt;
  playlisttitle: &amp;quot;barn&amp;quot;,&lt;br /&gt;
  ispremiumcontent: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isautoplay: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  plugv: &amp;quot;1.0.1&amp;quot;,&lt;br /&gt;
  playerv: &amp;quot;Sonic&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ad Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required &lt;br /&gt;
|-&lt;br /&gt;
| type || Ad Type, ns_st_ad || type of ad || &amp;quot;preroll&amp;quot;, &amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;, &amp;quot;ad&amp;quot; if specific ad type cannot be identified. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Film Code, mms_customadid || custom Ad ID || Film code/Copy code.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Custom examples''': S1MYME202B, 51TRER1001, H1KYLE3032, E1UMBR1001&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;In case of no Film Code is available, use the string &amp;quot;empty&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;For programmatic ads that you are sending &amp;quot;programmatic&amp;quot; as Film Code today, use &amp;quot;programmatic_{current UTC time in epoch form}&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of ad in seconds || Length of ad in seconds. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isprogrammatic || Programmatic, mms_programmatic || identify if the ad is bought prommatic. || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| isthirdpartyad || MMS Thirdparty, mms_thirdparty || identify if the ad is from third party ad server || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| adplatformorigin || MMS Origin, mms_origin || identify where an ad is originated. It is used when isprogrammatic=yes or isthirdpartyad=yes. || custom '''examples:''' Smartclip, YuMe&lt;br /&gt;
 || &lt;br /&gt;
|-&lt;br /&gt;
| adidx || Position in Break, ns_st_an || placement in ad break. It is passed by ad servers. || Custom with the following format:&lt;br /&gt;
&amp;lt;small&amp;gt;{ad placement}/{total number of ads in an ad break}&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' 2/5, the second ad in an ad break with 5 ads.&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| ad_campaign || MMS Ad campaign ID, campaign_id || campaign ID of an Ad || custom string value containing in general letters and digits  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for Ad:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var prerollMetadataObject = {&lt;br /&gt;
  type: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
  assetid: &amp;quot;E1UMBR1001&amp;quot;, &lt;br /&gt;
  length: &amp;quot;30&amp;quot;, //seconds&lt;br /&gt;
  isprogrammatic: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isthirdpartyad: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  adplatformorigin: &amp;quot;YuMe&amp;quot;,&lt;br /&gt;
  adidx: &amp;quot;1/5&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Browser_SDK&amp;diff=6282</id>
		<title>DCR France Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Browser_SDK&amp;diff=6282"/>
		<updated>2023-05-23T06:40:01Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Review the Reference Implementation for VoD and Live Streams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&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 (BSDK) is the framework for browser application developers to integrate Nielsen Measurement into their media players. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings ([[DCR &amp;amp; DTVR|DTVR]]) and Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]). Nielsen SDKs are also equipped to measure static content and can track key life cycle events.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Review SDK Integration Architecture Diagram ===&lt;br /&gt;
&lt;br /&gt;
==== For Content Playback ====&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-fr.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
==== For Ad Playback ====&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-fr.png||SDK Integration Architecture Diagram - Ad]]&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;
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;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website i.e. within the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; tag :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&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;appid&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;
For creating an instance, pass the following values: (&amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; is optional)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| appid	|| Unique ID assigned to player/website ||	&amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&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 if desired. 	|| &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{nol_sdkDebug: &amp;quot;debug&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;appid&amp;gt;.js, will be downloaded based on the appid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK 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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {&lt;br /&gt;
    nol_sdkDebug: &amp;quot;debug&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
=== Create Metadata Objects ===&lt;br /&gt;
Before starting any measurement of an asset(Content or Ad) with the created SDK Instance, you need to create an asset metadata object in order to identify the asset. &lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify a 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 are passed through key-values using the Nielsen reserved keys. You 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;
==== Create 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;
Please see the [[France SDK Metadata#Content Metadata|Mediametrie Content Metadata]] for the complete list of content metadata.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
Note: All metadata values should be passed as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
Please see the [[France SDK Metadata#Ad Metadata|Mediametrie Ad Metadata]] for the complete list of content metadata.&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;
=== Start the Measurement ===&lt;br /&gt;
Nielsen APIs calls are made by calling the function ggPM(&amp;quot;event&amp;quot;, parameter, ...) with &amp;quot;event&amp;quot; Parameter indicating the SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;event&amp;quot;, parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&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;
| &amp;quot;loadMetadata&amp;quot;	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;setPlayheadPosition&amp;quot;	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
* VOD: current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3... &amp;lt;br/&amp;gt;&lt;br /&gt;
* Live: Unix timestamp matching the broadcast time for Content and Ad (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... &amp;lt;br/&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback, the value passed should match the broadcast time for live channel.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;stop&amp;quot; ||	playhead position in seconds	|| Call when content interrupted/paused or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;end&amp;quot;	|| 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;
&lt;br /&gt;
Start the measurement by calling the &amp;quot;event&amp;quot; names &amp;quot;loadMetadata&amp;quot; followed by &amp;quot;setPlayheadPosition&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM  (main content)&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, contentMetadataObject); &lt;br /&gt;
// CONTENT plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
&lt;br /&gt;
=== Handle Video Playback Interruption ===&lt;br /&gt;
The setPlayheadPostion event is used for handling playback interruption. To indicate that the video player is not playing (i.e. paused, buffering), stop passing the playhead position to the SDK. &lt;br /&gt;
Once the Playback resumes , begin sending the playhead position again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== List of video Playback Interruptions ===&lt;br /&gt;
The following possible  video Playback Interruptions must be handled:&lt;br /&gt;
* Player PAUSED&lt;br /&gt;
* Player BUFFERING&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;
* Network Loss&lt;br /&gt;
&lt;br /&gt;
=== Example for handling Playback Interruption: Browser/Tab close/Page Reload ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
window.addEventListener(&amp;quot;beforeunload&amp;quot;, function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside an Ad indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;stop&amp;quot;, playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;end&amp;quot;, playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' additional code may be  needed in order to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Call Sequence ==&lt;br /&gt;
The sample event lifecycles can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
=== Content Playback Call Sequence ===&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(&amp;quot;loadMetadata&amp;quot;, contentMetadataObject); &lt;br /&gt;
// CONTENT plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
//&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;end&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ad Playback Call Sequence ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF Ad&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, adMetadataObject); &lt;br /&gt;
// Ad plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
// END OF Ad&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;stop&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* &amp;quot;setPlayheadPosition&amp;quot; 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 &amp;quot;stop&amp;quot; or &amp;quot;end&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at &amp;quot;0&amp;quot; when an 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. &lt;br /&gt;
* 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;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;br&amp;gt;	&lt;br /&gt;
Make sure the country &amp;quot;France&amp;quot; is selected in the country dropdown list.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for Mediametrie [https://nielsenonlinesupport.com/mediametrie/sdkRefImpl/index.htm sdkRefImpl].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen SDK Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
The Browser SDK video measurement does not set cross-domain cookies, therefore no centralized opt-out functionality is available. The Nielsen Browser SDK does not set cookies associated with the collection domain. The SDK sets specific cookie for the domain where the player is hosted (first party) and this cookie is not used across websites.&lt;br /&gt;
The only personal information collected with the SDK network pings is the IP address, which is  anonymized immediately after collection.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://www.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/ .&lt;br /&gt;
&lt;br /&gt;
== Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Run your player in the Browser, start a video&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Open the Developer Network View in order to monitor network traffic&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Filter the network traffic by &amp;quot;nmr&amp;quot; and confirm presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-fr.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=xknspa6p3viv2medizzvw8tld2smg1682583576&amp;amp;fp_cr_tm=1682583576685&amp;amp;fp_acc_tm=1684322226258&amp;amp;fp_emm_tm=1684322226288&amp;amp;ve_id=&amp;amp;sessionId=c81tzsiqvhqm6zswkeftmjjyip3fe1684322243&amp;amp;tl=Episode%201&amp;amp;prv=1&amp;amp;c6=vc,c77&amp;amp;ca=us-500207_c77_VID5556674-123456&amp;amp;cg=TAMSample%20FR&amp;amp;c13=asid,P1D11AF9D-E3FE-438C-B861-ED47543FF0E2&amp;amp;c32=segA,NA&amp;amp;c33=segB,NA&amp;amp;c34=segC,NA&amp;amp;c15=apn,&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=0&amp;amp;cr=4_00_99_D1_00000&amp;amp;c9=devid,&amp;amp;enc=true&amp;amp;c1=nuid,999&amp;amp;at=timer&amp;amp;rt=video&amp;amp;c16=sdkv,bj.6.0.0&amp;amp;c27=cln,6&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid,16843222430632178&amp;amp;c30=bldv,6.0.0.662&amp;amp;st=dcr&amp;amp;c7=osgrp,&amp;amp;c8=devgrp,&amp;amp;c10=plt,&amp;amp;c40=adbid,&amp;amp;c14=osver,NA&amp;amp;c26=dmap,1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid,&amp;amp;c36=cref1,&amp;amp;c37=cref2,&amp;amp;c11=agg,1&amp;amp;c12=apv,&amp;amp;c51=adl,15&amp;amp;c52=noad,0&amp;amp;sd=170&amp;amp;pc=NA&amp;amp;c53=fef,y&amp;amp;c54=oad,20200713%2010%3A22%3A00&amp;amp;c55=cref3,&amp;amp;c57=adldf,2&amp;amp;ai=VID5556674-123456&amp;amp;c3=st,c&amp;amp;c64=starttm,1684322269&amp;amp;adid=VID5556674-123456&amp;amp;c58=isLive,false&amp;amp;c59=sesid,3dn2br9l4y9rr2iuxycsdnlh3zwvd1684322245&amp;amp;c61=createtm,1684322275&amp;amp;c63=pipMode,&amp;amp;c68=bndlid,&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype,&amp;amp;c74=dvcnm,&amp;amp;c76=adbsnid,&amp;amp;c77=adsuprt,2&amp;amp;uoo=&amp;amp;evdata=&amp;amp;c71=ottflg,0&amp;amp;c72=otttyp,none&amp;amp;c44=progen,&amp;amp;davty=1&amp;amp;si=https%3A%2F%2Fnielsenonlinesupport.com%2Fmichel%2Fmediametrie%2FsdkRefImpl%2Findex.htm&amp;amp;c66=mediaurl,assets%252FRTVOD_C3%252Fprog_index.m3u8&amp;amp;sdd=&amp;amp;c62=sendTime,1684322275&amp;amp;rnd=582363&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), disable debug logging by deleting {nol_sdkDebug: &amp;quot;DEBUG&amp;quot;} from Initialization API Call.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Mediametrie_Implementation_Documentation&amp;diff=6280</id>
		<title>Mediametrie Implementation Documentation</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Mediametrie_Implementation_Documentation&amp;diff=6280"/>
		<updated>2023-05-17T15:03:10Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|Mediametrie Documentation}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The following guides are specific for Mediametrie.&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; | Mediametrie&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
! style=&amp;quot;width: 40%;&amp;quot; | Guide&lt;br /&gt;
!| Links&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|FRFlag.png}}&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| '''[[DCR France Video iOS SDK]]'''&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png}}&lt;br /&gt;
| '''[[DCR France Video Android SDK]]'''&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR France Video Browser SDK]]'''&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=France_SDK_Metadata&amp;diff=6278</id>
		<title>France SDK Metadata</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=France_SDK_Metadata&amp;diff=6278"/>
		<updated>2023-05-17T14:32:37Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}} Category:Digital  = France SDK Metadata = Digital Met...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= France SDK Metadata =&lt;br /&gt;
Digital Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 1''' focuses on the Content metadata&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 2''' focuses on the Ad metadata.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as '''UTF-8 strings'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Content Metadata ==&lt;br /&gt;
==== Create Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
'''Note:''' All metadata values should be passed as '''UTF-8 strings'''.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;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 asset	|| &amp;quot;content&amp;quot; for main content	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset 	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| name of program 	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| episode name	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of content in seconds	|| Length of content in seconds (86400 seconds for live stream (24/7). For Event-Live streams planned length. For VoD video length)||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate	|| the original date (local time with hh:mm:ss as 24h time stamp) content became available. This date does not change if the content is rebroadcasted on linear TV. ||	YYYYMMDD HH:MI:SS (if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;)	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode	|| full episode flag ||	&lt;br /&gt;
* &amp;quot;y&amp;quot; full episode (full content for a program)&lt;br /&gt;
* &amp;quot;n&amp;quot; non full episode (only one part of the entire content for a program , i.e. preview, sub-episodes)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
|adloadtype	|| type of Ad load&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;1&amp;quot; Linear - matches TV ad load &lt;br /&gt;
* &amp;quot;2&amp;quot; Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen &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:           &amp;quot;content&amp;quot;,&lt;br /&gt;
  assetid:        &amp;quot;unique_content_id&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;length in seconds&amp;quot;,&lt;br /&gt;
  airdate:        &amp;quot;20200713 10:22:00&amp;quot;,&lt;br /&gt;
  isfullepisode:  &amp;quot;y&amp;quot;,&lt;br /&gt;
  adloadtype:     &amp;quot;2&amp;quot;,&lt;br /&gt;
  subbrand:       &amp;quot;c05&amp;quot;,&lt;br /&gt;
  islivestn:      &amp;quot;y&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ad Metadata ==&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as '''UTF-8 strings'''.&amp;lt;br&amp;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;quot;preroll&amp;quot;, &amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;. &amp;quot;ad&amp;quot; If specific type can not be identified.||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to Ad	|| custom&amp;lt;br&amp;gt;(no [[Special Characters]])	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| length of the Ad in seconds	|| length of the Ad in seconds||	✓&lt;br /&gt;
|-&lt;br /&gt;
|islivestn	|| Indicates if a stream is playing on a live channel&lt;br /&gt;
||&lt;br /&gt;
:&lt;br /&gt;
* &amp;quot;y&amp;quot; playing on a live channel&lt;br /&gt;
* &amp;quot;n&amp;quot; otherwise i.e. VoD&lt;br /&gt;
||&lt;br /&gt;
✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand/Channel  ID – value is automatically populated through provided AppID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands/Channels in the App) 	|| provided by Nielsen || ✓&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;
  type:           &amp;quot;preroll&amp;quot;,&lt;br /&gt;
  assetid:        &amp;quot;unique_preroll_ad_id&amp;quot;,&lt;br /&gt;
  length:         &amp;quot;length in seconds&amp;quot;,&lt;br /&gt;
  subbrand:       &amp;quot;c05&amp;quot;,&lt;br /&gt;
  islivestn:      &amp;quot;y&amp;quot;&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;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Browser_SDK&amp;diff=6277</id>
		<title>DCR France Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Browser_SDK&amp;diff=6277"/>
		<updated>2023-05-17T14:30:49Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}} Category:Digital  __TOC__  == Overview == The Nielsen...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&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 (BSDK) is the framework for browser application developers to integrate Nielsen Measurement into their media players. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings ([[DCR &amp;amp; DTVR|DTVR]]) and Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]). Nielsen SDKs are also equipped to measure static content and can track key life cycle events.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Review SDK Integration Architecture Diagram ===&lt;br /&gt;
&lt;br /&gt;
==== For Content Playback ====&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-fr.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
==== For Ad Playback ====&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-fr.png||SDK Integration Architecture Diagram - Ad]]&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;
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;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website i.e. within the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; tag :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}&lt;br /&gt;
catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&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;appid&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;
For creating an instance, pass the following values: (&amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; is optional)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Values&lt;br /&gt;
|-&lt;br /&gt;
| appid	|| Unique ID assigned to player/website ||	&amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&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 if desired. 	|| &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{nol_sdkDebug: &amp;quot;debug&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When the initialization call is made, a unique static configuration file, &amp;lt;appid&amp;gt;.js, will be downloaded based on the appid and will be cached on the user’s browser.&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK 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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {&lt;br /&gt;
    nol_sdkDebug: &amp;quot;debug&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
=== Create Metadata Objects ===&lt;br /&gt;
Before starting any measurement of an asset(Content or Ad) with the created SDK Instance, you need to create an asset metadata object in order to identify the asset. &lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify a 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 are passed through key-values using the Nielsen reserved keys. You 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;
==== Create 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;
Please see the [[France SDK Metadata#Content Metadata|Mediametrie Content Metadata]] for the complete list of content metadata.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
Note: All metadata values should be passed as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
Please see the [[France SDK Metadata#Ad Metadata|Mediametrie Ad Metadata]] for the complete list of content metadata.&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;
=== Start the Measurement ===&lt;br /&gt;
Nielsen APIs calls are made by calling the function ggPM(&amp;quot;event&amp;quot;, parameter, ...) with &amp;quot;event&amp;quot; Parameter indicating the SDK API.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;event&amp;quot;, parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&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;
| &amp;quot;loadMetadata&amp;quot;	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;setPlayheadPosition&amp;quot;	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
* VOD: current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3... &amp;lt;br/&amp;gt;&lt;br /&gt;
* Live: Unix timestamp matching the broadcast time for Content and Ad (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... &amp;lt;br/&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback, the value passed should match the broadcast time for live channel.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;stop&amp;quot; ||	playhead position in seconds	|| Call when content interrupted/paused or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;end&amp;quot;	|| 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;
&lt;br /&gt;
Start the measurement by calling the &amp;quot;event&amp;quot; names &amp;quot;loadMetadata&amp;quot; followed by &amp;quot;setPlayheadPosition&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF STREAM  (main content)&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, contentMetadataObject); &lt;br /&gt;
// CONTENT plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
&lt;br /&gt;
=== Handle Video Playback Interruption ===&lt;br /&gt;
The setPlayheadPostion event is used for handling playback interruption. To indicate that the video player is not playing (i.e. paused, buffering), stop passing the playhead position to the SDK. &lt;br /&gt;
Once the Playback resumes , begin sending the playhead position again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== List of video Playback Interruptions ===&lt;br /&gt;
The following possible  video Playback Interruptions must be handled:&lt;br /&gt;
* Player PAUSED&lt;br /&gt;
* Player BUFFERING&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;
* Network Loss&lt;br /&gt;
&lt;br /&gt;
=== Example for handling Playback Interruption: Browser/Tab close/Page Reload ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
window.addEventListener(&amp;quot;beforeunload&amp;quot;, function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside an Ad indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;stop&amp;quot;, playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;end&amp;quot;, playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' additional code may be  needed in order to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Call Sequence ==&lt;br /&gt;
The sample event lifecycles can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
=== Content Playback Call Sequence ===&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(&amp;quot;loadMetadata&amp;quot;, contentMetadataObject); &lt;br /&gt;
// CONTENT plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
//&lt;br /&gt;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;end&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ad Playback Call Sequence ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// START OF Ad&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, adMetadataObject); &lt;br /&gt;
// Ad plays&lt;br /&gt;
// pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;setPlayheadPosition&amp;quot;, playheadPosition);&lt;br /&gt;
// END OF Ad&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;stop&amp;quot;, playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* &amp;quot;setPlayheadPosition&amp;quot; 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 &amp;quot;stop&amp;quot; or &amp;quot;end&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at &amp;quot;0&amp;quot; when an 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. &lt;br /&gt;
* 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;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;br&amp;gt;	&lt;br /&gt;
Make sure the country &amp;quot;France&amp;quot; is selected in the country dropdown list.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for Mediametrie [https://nielsenonlinesupport.com/michel/mediametrie/sdkRefImpl/index.htm sdkRefImpl].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen SDK Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
The Browser SDK video measurement does not set cross-domain cookies, therefore no centralized opt-out functionality is available. The Nielsen Browser SDK does not set cookies associated with the collection domain. The SDK sets specific cookie for the domain where the player is hosted (first party) and this cookie is not used across websites.&lt;br /&gt;
The only personal information collected with the SDK network pings is the IP address, which is  anonymized immediately after collection.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://www.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/ .&lt;br /&gt;
&lt;br /&gt;
== Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Run your player in the Browser, start a video&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Open the Developer Network View in order to monitor network traffic&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Filter the network traffic by &amp;quot;nmr&amp;quot; and confirm presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-fr.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=xknspa6p3viv2medizzvw8tld2smg1682583576&amp;amp;fp_cr_tm=1682583576685&amp;amp;fp_acc_tm=1684322226258&amp;amp;fp_emm_tm=1684322226288&amp;amp;ve_id=&amp;amp;sessionId=c81tzsiqvhqm6zswkeftmjjyip3fe1684322243&amp;amp;tl=Episode%201&amp;amp;prv=1&amp;amp;c6=vc,c77&amp;amp;ca=us-500207_c77_VID5556674-123456&amp;amp;cg=TAMSample%20FR&amp;amp;c13=asid,P1D11AF9D-E3FE-438C-B861-ED47543FF0E2&amp;amp;c32=segA,NA&amp;amp;c33=segB,NA&amp;amp;c34=segC,NA&amp;amp;c15=apn,&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=0&amp;amp;cr=4_00_99_D1_00000&amp;amp;c9=devid,&amp;amp;enc=true&amp;amp;c1=nuid,999&amp;amp;at=timer&amp;amp;rt=video&amp;amp;c16=sdkv,bj.6.0.0&amp;amp;c27=cln,6&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid,16843222430632178&amp;amp;c30=bldv,6.0.0.662&amp;amp;st=dcr&amp;amp;c7=osgrp,&amp;amp;c8=devgrp,&amp;amp;c10=plt,&amp;amp;c40=adbid,&amp;amp;c14=osver,NA&amp;amp;c26=dmap,1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid,&amp;amp;c36=cref1,&amp;amp;c37=cref2,&amp;amp;c11=agg,1&amp;amp;c12=apv,&amp;amp;c51=adl,15&amp;amp;c52=noad,0&amp;amp;sd=170&amp;amp;pc=NA&amp;amp;c53=fef,y&amp;amp;c54=oad,20200713%2010%3A22%3A00&amp;amp;c55=cref3,&amp;amp;c57=adldf,2&amp;amp;ai=VID5556674-123456&amp;amp;c3=st,c&amp;amp;c64=starttm,1684322269&amp;amp;adid=VID5556674-123456&amp;amp;c58=isLive,false&amp;amp;c59=sesid,3dn2br9l4y9rr2iuxycsdnlh3zwvd1684322245&amp;amp;c61=createtm,1684322275&amp;amp;c63=pipMode,&amp;amp;c68=bndlid,&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype,&amp;amp;c74=dvcnm,&amp;amp;c76=adbsnid,&amp;amp;c77=adsuprt,2&amp;amp;uoo=&amp;amp;evdata=&amp;amp;c71=ottflg,0&amp;amp;c72=otttyp,none&amp;amp;c44=progen,&amp;amp;davty=1&amp;amp;si=https%3A%2F%2Fnielsenonlinesupport.com%2Fmichel%2Fmediametrie%2FsdkRefImpl%2Findex.htm&amp;amp;c66=mediaurl,assets%252FRTVOD_C3%252Fprog_index.m3u8&amp;amp;sdd=&amp;amp;c62=sendTime,1684322275&amp;amp;rnd=582363&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), disable debug logging by deleting {nol_sdkDebug: &amp;quot;DEBUG&amp;quot;} from Initialization API Call.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Android_SDK&amp;diff=6276</id>
		<title>DCR France Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_France_Video_Android_SDK&amp;diff=6276"/>
		<updated>2023-05-17T14:29:20Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{CurrentBreadcrumb}} Category:Digital  == Overview == The Nielsen SDK is o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Mediametrie Implementation Documentation}}  {{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  It supports a variety of Nielsen Measurement Products like Digital in TV Ratings ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;App ID (appid)&amp;quot; || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;Nielsen SDK&amp;quot; || Includes SDK frameworks and &amp;quot;sample implementation&amp;quot;; &amp;quot;See [[Android SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 1: Setting up your Android Development Environment  ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
1) Ensure to unzip the Nielsen App SDK zip file and copy the &amp;quot;AppSdk.jar&amp;quot; into the app/libs folder on the App’s project. Add it as dependency.&amp;lt;br /&amp;gt;&lt;br /&gt;
2) Add the following permissions on the project’s &amp;quot;AndroidManifest.xml&amp;quot; file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&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;
3) Add Google Play Services lib into dependencies as Nielsen AppSDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
Libraries:&lt;br /&gt;
* com.google.android.gms:play-services&lt;br /&gt;
Requiered Google Play Service CLasses and Packages :&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;
4) Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;import com.nielsen.app.sdk.*;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The Nielsen App SDK (located in the &amp;quot;com.nielsen.app.sdk&amp;quot; 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;
*Nielsen App SDK is compatible with Android OS versions 2.3+.&lt;br /&gt;
*Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.&lt;br /&gt;
*The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 4.0 and later will support it natively).&lt;br /&gt;
*If the player application uses a 3rd party media player implementing its own HLS/MPEG-DASH stack, 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;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can then be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| 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 || ✓ || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || '''value is automatically populated through App Name included in the App Resource File''' ||  || &amp;quot;Nielsen Sample App&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appversion || Current version of the app used || '''value is automatically populated through App Name included in the App Resource File''' ||  || &amp;quot;1.0.2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified ||  || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) AppSDK() is no longer a singleton object and should be created as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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, this);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e){&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;
2) implement IAppNotifier into your activity like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public class MainActivity extends AppCompatActivity implements IAppNotifier&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
3) implement callback&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;@Override&lt;br /&gt;
public void onAppSdkEvent(long timestamp, int code, String description){&lt;br /&gt;
  Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So whole Activity will look like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package com.example.josefvancura.nlsdemotmp;&lt;br /&gt;
&lt;br /&gt;
import android.content.Context;&lt;br /&gt;
import android.support.v7.app.AppCompatActivity;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
&lt;br /&gt;
import com.nielsen.app.sdk.*;&lt;br /&gt;
&lt;br /&gt;
import org.json.JSONException;&lt;br /&gt;
import org.json.JSONObject;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    private AppSdk mAppSdk = null;&lt;br /&gt;
    private String TAG = &amp;quot;MainActivity&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_main);&lt;br /&gt;
&lt;br /&gt;
        Context context = getApplicationContext();&lt;br /&gt;
&lt;br /&gt;
        try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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(context, appSdkConfig, this ); // Notifier - activity implements IAppNotifier, callback in onAppSdkEvent()&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        catch (JSONException e){&lt;br /&gt;
            Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onAppSdkEvent(long timestamp, int code, String description) {&lt;br /&gt;
        Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
&lt;br /&gt;
==== Life cycle of SDK instance ====&lt;br /&gt;
Life cycle of SDK instance includes four general states:&lt;br /&gt;
# &amp;quot;&amp;quot;Initial state&amp;quot;&amp;quot; – 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 &amp;quot;&amp;quot;Initial state&amp;quot;&amp;quot;.&lt;br /&gt;
# &amp;quot;&amp;quot;Idle state&amp;quot;&amp;quot; – 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;
# &amp;quot;&amp;quot;Processing state&amp;quot;&amp;quot; – The SDK instance is processing playing information. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&lt;br /&gt;
# &amp;quot;&amp;quot;Disabled state&amp;quot;&amp;quot; – 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;
== Step 3: Create Metadata Objects ==&lt;br /&gt;
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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Create 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;
Note: All metadata values should be passed as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
Please see the [[France SDK Metadata#Content Metadata|Mediametrie Content Metadata]] for the complete list of content metadata.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create Ad Metadata ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
Note: All metadata values should be passed as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
Please see the [[France SDK Metadata#Ad Metadata|Mediametrie Ad Metadata]] for the complete list of content metadata.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MetaData Example ===&lt;br /&gt;
&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;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;unique_content_id&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;content&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;episode title&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;length&amp;quot;, &amp;quot;length in seconds&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;airdate&amp;quot;, &amp;quot;20200713 10:22:00&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;subbrand&amp;quot;, &amp;quot;c05&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;islivestn&amp;quot;, &amp;quot;y&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;unique_postroll_ad_id&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;postroll&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;length&amp;quot;, &amp;quot;length in seconds&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;subbrand&amp;quot;, &amp;quot;c05&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;islivestn&amp;quot;, &amp;quot;y&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the &amp;quot;&amp;quot;Play&amp;quot;&amp;quot; button on the player. Call play only when initially starting the video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the begining of playlist - see below API call sequence examples.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background-color:#d0f6f8&amp;quot;&amp;gt;&lt;br /&gt;
Note: &amp;quot;setPlayheadPosition&amp;quot; has to be called every second and the value passed should match the broadcast time for live channel.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* VOD: current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3... &amp;lt;br/&amp;gt;&lt;br /&gt;
* Live: Unix timestamp matching the broadcast time for Content and Ad (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Java&amp;quot;&amp;gt;mAppSdk.setPlayheadPosition(long videoPositon);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.stop();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.end();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Start the Measurement ===&lt;br /&gt;
In order to start the measurement, follow the 3 first steps below for Content without Ads. When terminating the Content playback call &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; to terminate the Content Measurement for the given asset.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Playlist !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1. Start of stream || &amp;lt;code&amp;gt;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;loadMetadata(contentMetadataObject)&amp;lt;/code&amp;gt; || contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| 2. Content is playing || &amp;lt;code&amp;gt;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;
| 3. End of Stream || &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; || Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Step 5: Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Step 6: Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-fr.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-fr.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Step 7 : Disclose Nielsen Privacy Statement ==&lt;br /&gt;
The App SDK uses Mobile Ad IDs (Android ID or IDFA) which are fully hashed on the device before being sent to Nielsen (Nielsen never receives un-hashed values).&lt;br /&gt;
Users retain the possibility to oppose the use of Mobile Ad IDs, or to reset them, by using the functionality provided by the mobile operating system (iOS or Android).&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://www.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/ .&lt;br /&gt;
&lt;br /&gt;
== Step 8 : Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers VoD and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll Ad.&lt;br /&gt;
&lt;br /&gt;
Download the Reference Implementation for Android [https://nielsenonlinesupport.com/dk/android/DKRefPLAYER.zip DKRefPLAYER].&lt;br /&gt;
Unzip and open the project in Android Studio, then run it i.e. in the simulator or on Android device and then filter the Logcat output with &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;quot; in order to see only relevant Nielsen SDK API Calls, as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
2021-04-08 15:11:27.075  D/NielsenInit: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL : class NielsenInit :: Create new AppSdk() Instance.&lt;br /&gt;
2021-04-08 15:11:27.568  D/NielsenInit: ====&amp;gt;&amp;gt;&amp;gt; SDK EVENT - onAppSdkEvent: Description = Nielsen App SDK is initiated. AppSdk.jar aa.8.0.0.0_gsxaon. App SDK was successfully initiatedCode l param : 1617887487Code i param 2000&lt;br /&gt;
2021-04-08 15:11:29.497  D/NielsenInit: ====&amp;gt;&amp;gt;&amp;gt; SDK EVENT - onAppSdkEvent: Description = Nielsen App SDK has started up. AppSdk.jar aa.8.0.0.0_gsxaon. Config file successfully loaded and parsed.Code l param : 1617887489Code i param 2001&lt;br /&gt;
2021-04-08 15:11:42.736  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :  appSdk.play(sdkMethods.loadChannelInfo());&lt;br /&gt;
2021-04-08 15:11:42.738  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL : onPrepared() : appSdk.loadMetadata(data)&lt;br /&gt;
2021-04-08 15:11:43.065  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; Media Player Event : onInfo ();what = 3&lt;br /&gt;
2021-04-08 15:11:43.065  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; Media Player Event :  first video frame pushed for rendering.&lt;br /&gt;
2021-04-08 15:11:43.747  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 0 / 224&lt;br /&gt;
2021-04-08 15:11:44.752  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 1 / 224&lt;br /&gt;
2021-04-08 15:11:45.759  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 2 / 224&lt;br /&gt;
2021-04-08 15:11:46.764  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 3 / 224&lt;br /&gt;
2021-04-08 15:11:47.767  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 4 / 224&lt;br /&gt;
2021-04-08 15:11:48.772  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 5 / 224&lt;br /&gt;
2021-04-08 15:11:49.777  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 6 / 224&lt;br /&gt;
2021-04-08 15:11:50.781  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 7 / 224&lt;br /&gt;
2021-04-08 15:11:51.819  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL :   appSdk.setPlayheadPosition(mCurrentPosition): @ 8 / 224&lt;br /&gt;
2021-04-08 15:11:51.821  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; Activity onPause()&lt;br /&gt;
2021-04-08 15:11:52.668  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt;: Activity onDestroy()&lt;br /&gt;
2021-04-08 15:11:52.668  D/MainActivity: ====&amp;gt;&amp;gt;&amp;gt; SDK CALL : terminateNielsenSDK () :appSdk.end();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 9 :  Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;nmr&amp;quot; and confirm presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-fr.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=&amp;amp;fp_cr_tm=&amp;amp;fp_acc_tm=&amp;amp;fp_emm_tm=&amp;amp;ve_id=&amp;amp;devmodel=&amp;amp;manuf=&amp;amp;sysname=&amp;amp;sysversion=&amp;amp;sessionId=zlmmxkq867zt4bpnumlyz6dpn9hyp1610980356&amp;amp;tl=Episode%201&amp;amp;prv=1&amp;amp;c6=vc%2Cc77&amp;amp;ca=us-500207_c77_VID5556674-123456&amp;amp;cg=TAMSample%20DK&amp;amp;c13=asid%2CP10DF14BA-937E-436D-99DF-ED39A0422387&amp;amp;c32=segA%2CNA&amp;amp;c33=segB%2CNA&amp;amp;c34=segC%2CNA&amp;amp;c15=apn%2C&amp;amp;plugv=&amp;amp;playerv=&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=0&amp;amp;cr=4_00_99_V1_00000&amp;amp;c9=devid%2C&amp;amp;enc=true&amp;amp;c1=nuid%2C999&amp;amp;at=view&amp;amp;rt=video&amp;amp;c16=sdkv%2Cbj.6.0.0&amp;amp;c27=cln%2C0&amp;amp;crs=&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid%2C16109803568088038&amp;amp;c30=bldv%2C6.0.0.563&amp;amp;st=dcr&amp;amp;c7=osgrp%2C&amp;amp;c8=devgrp%2C&amp;amp;c10=plt%2C&amp;amp;c40=adbid%2C&amp;amp;c14=osver%2CNA&amp;amp;c26=dmap%2C1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid%2C&amp;amp;c36=cref1%2C&amp;amp;c37=cref2%2C&amp;amp;c11=agg%2C1&amp;amp;c12=apv%2C&amp;amp;c51=adl%2C0&amp;amp;c52=noad%2C0&amp;amp;sd=170&amp;amp;devtypid=&amp;amp;pc=NA&amp;amp;c53=fef%2Cy&amp;amp;c54=oad%2C20200713%2010%3A22%3A00&amp;amp;c55=cref3%2C&amp;amp;c57=adldf%2C2&amp;amp;ai=VID5556674-123456&amp;amp;c3=st%2Cc&amp;amp;c64=starttm%2C1610980392&amp;amp;adid=VID5556674-123456&amp;amp;c58=isLive%2Cfalse&amp;amp;c59=sesid%2Cgezrb92q4i9b9jg7acxgn783gjw0a1610980365&amp;amp;c61=createtm%2C1610980392&amp;amp;c63=pipMode%2C&amp;amp;c68=bndlid%2C&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype%2C&amp;amp;c74=dvcnm%2C&amp;amp;c76=adbsnid%2C&amp;amp;c77=adsuprt%2C2&amp;amp;uoo=&amp;amp;evdata=&amp;amp;c71=ottflg%2C0&amp;amp;c72=otttyp%2Cnone&amp;amp;c44=progen%2C&amp;amp;davty=0&amp;amp;si=http%3A%2F%2Fnielsenonlinesupport.com%2Fdk%2Findex.htm&amp;amp;c66=mediaurl%2Cassets%252FRTVOD_C3%252Fprog_index.m3u8&amp;amp;c62=sendTime%2C1610980392&amp;amp;rnd=714644&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 10 :  Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Step 11 :  Going Live ==&lt;br /&gt;
After the integration has been certified (but not prior that), disable debug logging by deleting {nol_devDebug: &amp;quot;DEBUG&amp;quot;} from initialization call - see Step 2.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:nlsn-sdk-achitecture-diagram-ad-fr.png&amp;diff=6275</id>
		<title>File:nlsn-sdk-achitecture-diagram-ad-fr.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:nlsn-sdk-achitecture-diagram-ad-fr.png&amp;diff=6275"/>
		<updated>2023-05-17T14:27:02Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: nlsn-sdk-achitecture-diagram-ad-fr.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
nlsn-sdk-achitecture-diagram-ad-fr.png&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:nlsn-sdk-achitecture-diagram-content-fr.png&amp;diff=6274</id>
		<title>File:nlsn-sdk-achitecture-diagram-content-fr.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:nlsn-sdk-achitecture-diagram-content-fr.png&amp;diff=6274"/>
		<updated>2023-05-17T14:25:49Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: nlsn-sdk-achitecture-diagram-content-fr.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
nlsn-sdk-achitecture-diagram-content-fr.png&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6224</id>
		<title>Sweden SDK Metadata</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6224"/>
		<updated>2023-04-26T08:58:24Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= Digital Metadata =&lt;br /&gt;
Digital Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 1''' focuses on the content metadata&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 2''' focuses on the Ad metadata.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Content Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||  || type of asset || &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| userid ||  || the user login ID. Used by MMS reach model. ''The uploaded value needs to be hashed with SHA512''. This is the user login ID on player. We prefer a numeric value. (please '''do not''' use user email address)|| &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa...&amp;quot; || required if login feature&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Content ID, mms_tid || unique ID assigned to an asset within the same media house. (max: 20 characters).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; In addition to this metadata for content needs to be reported to MMS via TitleService. Contact online@mms.se for more information. || &lt;br /&gt;
&amp;lt;small&amp;gt;For VoD use internal format. [https://engineeringportal.nielsen.com/docs/Special_Characters No special characters]&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;For content on simulcast channels, this has a standard format: simulcast_channelnumber ('''Example''' for Channel TV4, the expected value is: simulcast_29).&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;A complete list of channel reference libraries with channel numbers is on the  [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓ &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of content in seconds || Length of content in seconds. &lt;br /&gt;
* &amp;lt;small&amp;gt;for VoD, video length&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for event-Live stream, the planned length. If planned length not available, then put default value 0&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for simulcast and 24/7 live stream, 86400&amp;lt;/small&amp;gt;&lt;br /&gt;
 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientpassparam || MMS Values, mms_values || pass-through parameters || For clients that provide DAI (dynamic ad insertion) service, this has a standard format: origcode=channelnumber.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' origcode=29&lt;br /&gt;
See the complete list of channel reference library with the channel number on [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt; &amp;lt;br&amp;gt; &amp;lt;small&amp;gt;Please use string, JSON format is not accepted. &amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Length limit: 250 characters. A longer string may be truncated due to URL length limitation.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| required for clients that have DAI service (Telia, Telenor, Allente, Comhem, Boxer, Sappa, Discovery, Cmore)&lt;br /&gt;
|-&lt;br /&gt;
| program || Program Name, ns_st_pr || program name || '''custom''' '''example:''' leif-och-billy &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode Name, ns_st_ep || episode name || '''custom''' '''example:''' en-ny-tjej-i-byn &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| playlisttitle || Title Playlist, ns_st_pl || playlist reference as a string || string value with playlist name for '''example:''' barn || &lt;br /&gt;
|-&lt;br /&gt;
| ispremiumcontent || MMS Premium, mms_premium || identify premium level via yes or no || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isautoplay || Auto Start, mms_auto || identify if autoplay is enabled on the video || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| plugv || Player Version, ns_st_mv || player version. increment by 1 for each new version. || alphanumeric '''example:''' 1.0.1 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| playerv || Mediaplayer, ns_st_mp || player identifier || alphanumeric '''example:''' HTML5, JW Player, Sonic  || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject = {&lt;br /&gt;
  type: &amp;quot;content&amp;quot;, &lt;br /&gt;
  userid: &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa…&amp;quot;, &lt;br /&gt;
  assetid: &amp;quot;simulcast_29&amp;quot;,&lt;br /&gt;
  length: &amp;quot;3359&amp;quot;, //seconds&lt;br /&gt;
  clientpassparam: &amp;quot;origcode=29&amp;quot;,&lt;br /&gt;
  program: &amp;quot;leif-och-billy&amp;quot;,&lt;br /&gt;
  title: &amp;quot;en-ny-tjej-i-byn&amp;quot;,&lt;br /&gt;
  playlisttitle: &amp;quot;barn&amp;quot;,&lt;br /&gt;
  ispremiumcontent: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isautoplay: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  plugv: &amp;quot;1.0.1&amp;quot;,&lt;br /&gt;
  playerv: &amp;quot;Sonic&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ad Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required &lt;br /&gt;
|-&lt;br /&gt;
| type || Ad Type, ns_st_ad || type of ad || &amp;quot;preroll&amp;quot;, &amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;, &amp;quot;ad&amp;quot; if specific ad type cannot be identified. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Film Code, mms_customadid || custom Ad ID || Film code/Copy code.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Custom examples''': S1MYME202B, 51TRER1001, H1KYLE3032, E1UMBR1001&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;In case of no Film Code is available, use the string &amp;quot;empty&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;For programmatic ads that you are sending &amp;quot;programmatic&amp;quot; as Film Code today, use &amp;quot;programmatic_{current UTC time in epoch form}&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of ad in seconds || Length of ad in seconds. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isprogrammatic || Programmatic, mms_programmatic || identify if the ad is bought prommatic. || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| isthirdpartyad || MMS Thirdparty, mms_thirdparty || identify if the ad is from third party ad server || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| adplatformorigin || MMS Origin, mms_origin || identify where an ad is originated. It is used when isprogrammatic=yes or isthirdpartyad=yes. || custom '''examples:''' Smartclip, YuMe&lt;br /&gt;
 || &lt;br /&gt;
|-&lt;br /&gt;
| adidx || Position in Break, ns_st_an || placement in ad break. It is passed by ad servers. || Custom with the following format:&lt;br /&gt;
&amp;lt;small&amp;gt;{ad placement}/{total number of ads in an ad break}&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' 2/5, the second ad in an ad break with 5 ads.&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| ad_campaign || MMS Ad campaign ID, campaign_id || campaign ID of an Ad || custom string value containing in general letters and digits  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for Ad:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var prerollMetadataObject = {&lt;br /&gt;
  type: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
  assetid: &amp;quot;E1UMBR1001&amp;quot;, &lt;br /&gt;
  length: &amp;quot;30&amp;quot;, //seconds&lt;br /&gt;
  isprogrammatic: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isthirdpartyad: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  adplatformorigin: &amp;quot;YuMe&amp;quot;,&lt;br /&gt;
  adidx: &amp;quot;1/5&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6178</id>
		<title>DCR Germany Static Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6178"/>
		<updated>2023-03-31T09:43:18Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{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 Web pages. It supports static content measurement 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;
This guide will show you how to enable page measurement (aka Static) on your website(s). The Nielsen Tracking Code must be added to each page with different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Add Static Queue Snippet ==&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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website i.e. within the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; tag :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
	// Add Static Queue Snippet&lt;br /&gt;
	!function(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has the below parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Required !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||Yes	||'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance||Yes	 ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	||No	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&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;
== Step 3: Create Metadata Object ==&lt;br /&gt;
The full description of the other key/value pairs for Metadata can be found here:&lt;br /&gt;
'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
=== Example Web Page Metadata Object ===&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;
  window.articlemetadata = {&lt;br /&gt;
    type: &amp;quot;static&amp;quot;,&lt;br /&gt;
    assetid: &amp;quot;Unique_page_ID&amp;quot;, &lt;br /&gt;
	section:  &amp;quot;Unique_section_ID&amp;quot;, &lt;br /&gt;
    segA: &amp;quot;Unique_section_segA&amp;quot;, &lt;br /&gt;
    segB: &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
    segC: &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
    subbrand: &amp;quot;subbrand_received_from_Nielsen&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;
== Step 4: Call staticstart Event ==&lt;br /&gt;
Start static measurement :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] When using the same Browser SDK instance to measure different pages, Call &amp;lt;code&amp;gt;&amp;quot;staticend&amp;quot;&amp;lt;/code&amp;gt; to stop the static measurement of the current page before starting a new measurement with &amp;lt;code&amp;gt;&amp;quot;staticstart&amp;quot;&amp;lt;/code&amp;gt; for the next page.''' &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 5: Include the measurement of Advertising Medium (Werbeträger) if applicable  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
A page impression is a user action on the page that leads or could lead to an advertisement being called up. Each user action may only be counted once.&lt;br /&gt;
&lt;br /&gt;
However, a page impression occurs when the content of the viewport of the respective device is completely reloaded/rendered by scrolling/swiping and replaced by new&lt;br /&gt;
content.&lt;br /&gt;
&lt;br /&gt;
When counting views, a distinction is made between content&lt;br /&gt;
views (CPI) and advertising medium views after a user action (WPI). There can be&lt;br /&gt;
only one content view per page. Each additional user action on the same page (click,&lt;br /&gt;
scroll or swipe, e.g. click through an image gallery) will lead to an advertising medium view (WPI) accordingly. The implementation should follow the IVW guidelines for&lt;br /&gt;
defining user actions.&lt;br /&gt;
&lt;br /&gt;
'''Note''':&lt;br /&gt;
The differentiation between the measurement of Content vs. advertising medium is achieved by setting accordingly the &amp;quot;segB&amp;quot; value in the metadata object  , see '''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]''' &lt;br /&gt;
&lt;br /&gt;
=== Implementation Details ===&lt;br /&gt;
How to trigger a page impression for advertising medium?&lt;br /&gt;
In order to trigger a a new view for an advertising medium, you have to stop the measurement of the page and start the measurement of the advertising medium, see example code below:&lt;br /&gt;
&lt;br /&gt;
* Stop static measurement for the page(current metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticend' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticend&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start static measurement for the advertising medium after user interaction(new metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.adMediummetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6: Review Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
==Step 7:  Testing ==&lt;br /&gt;
'''Monitoring Tools'''&lt;br /&gt;
Testing the Browser Implementation&lt;br /&gt;
&lt;br /&gt;
The steps to test the implementation are given below.&lt;br /&gt;
&lt;br /&gt;
'''Step 7.1'''&lt;br /&gt;
&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;nmr&amp;quot; to capture traffic from the SDK. This will capture traffic going to Nielsen servers.&lt;br /&gt;
&lt;br /&gt;
'''Step 7.2'''&lt;br /&gt;
&lt;br /&gt;
Verify that the Nielsen SDK is being downloaded correctly and is the correct version.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://cdn-gl.nmrodam.com/novms/js/2/nlsSDK600.bundle.min.js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 7.3'''&lt;br /&gt;
&lt;br /&gt;
When the page is loaded for the first time, the Browser SDK fires a View ping as soon as content is loaded. Utilizing your HTTP traffic filter tool, you can now validate the metadata that is being sent to the Nielsen collection servers.&lt;br /&gt;
&lt;br /&gt;
Example View Ping Below:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;https://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_Main-GTM_P&amp;amp;asn=Main-GTM&amp;amp;sessionId=8l2XGnAW6IC3Cc2MIMh0RYRTqimuU1553108759&amp;amp;prv=1&amp;amp;c6=vc,c77&amp;amp;ca=NA&amp;amp;c13=asid,P00BEB680-1F1A-47BB-922D-1BD2F1BA79A7&amp;amp;c32=...&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step 7.4'''&lt;br /&gt;
&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed and is indicated by the cr value containing a D. This should fire every 5 minutes but only when the page is in focus.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;st=dcr&amp;amp;rt=text&amp;amp;forward=0&amp;amp;sup=0&lt;br /&gt;
&amp;amp;ad=0&amp;amp;asn=%2Fsdk2%2Findex2.html&amp;amp;ci=us-500270&amp;amp;c6=vc,c77&amp;amp;c9=devid,&amp;amp;c11=agg,1&lt;br /&gt;
&amp;amp;c12=apv,3&amp;amp;c13=asid,PAA3A8EF7-E6D2-4A9E-9787-BDXXXXXXXXXX&amp;amp;c15=apn,Test2&lt;br /&gt;
&amp;amp;c16=sdkv,bj.5.1.5&amp;amp;c26=dmap,1&amp;amp;c29=plid,14767465028039340&amp;amp;c30=bldv,1.0.0.15&amp;amp;c32=segA,USA&lt;br /&gt;
&amp;amp;c33=segB,CA&amp;amp;c34=segC,RSM&amp;amp;at=timer&amp;amp;cr=D&amp;amp;c27=cln,300&amp;amp;rnd=857576&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 8: 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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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;br /&gt;
&lt;br /&gt;
== Step 9: Review the Sample Implementation for your Reference ==&lt;br /&gt;
The Sample Implementation for AGF located [https://nielsenonlinesupport.com/agf/sdkRefImpStaticDE/bsdkstatic.htm here].&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6177</id>
		<title>AGF Metadata Convention</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6177"/>
		<updated>2023-03-31T09:40:37Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= AGF Metadata Convention =&lt;br /&gt;
&lt;br /&gt;
The  Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static Measurement ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''AppSDK version &amp;gt;= 9.1.0.0 is required''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt; &lt;br /&gt;
The newly introduced AppSDK API staticEnd() is required for the Static Measurement. &lt;br /&gt;
The staticEnd() API is available only for AppSDK version 9.1.0.0 or higher &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required (Obligatory) !! AGF Convention	!! Example data - RTL&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; || ✓ || hardcoded string required by Nielsen  || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to each article/page; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]]) || ✓ || Content Article ID. If it is not an article page and therefore no ID is available, the page path is used. || &amp;quot;999452&amp;quot;&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)	|| custom (no [[Special Characters]])	|| ✓ || Section of Website or App || &amp;quot;_rtl_portal_news&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segA 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || AGOF code or comparable unit code. If the AGOF code is not available, set &amp;quot;Unknown&amp;quot; || &amp;quot;dbrsowf_rtlnews&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segB 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || Value to define content view count vs. 'Werbetraeger' view count. For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger': &amp;quot;WPI&amp;quot; || For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger' after user interaction with the site and newly loaded Content:  &amp;quot;WPI&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| segC 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom ||  || Program name || &amp;quot;IBES&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subbrand 	||  vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen || ✓ || Same as video measurement, provided by Nielsen || &amp;quot;c01&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Video Measurement ==&lt;br /&gt;
&lt;br /&gt;
Please refer to this AGF PDF Document: '''[https://nielsendownloads.digitalengsdk.com/digital/220907_AGF+Custom+Variables+and+Metadata+DCR+SDK++v1.8_english.pdf Metadata Document for Video]'''&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_App_SDK&amp;diff=6176</id>
		<title>DCR Germany Static App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_App_SDK&amp;diff=6176"/>
		<updated>2023-03-31T09:39:56Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen App 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 iOS and Android Apps developers to integrate Nielsen Measurement into their App for the Static Content Measurement. &lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable Static measurement in your App. The Nielsen App Static Measurement of each different page/section requires different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* To get started, an AppID is needed. The AppID is a unique ID assigned to the App. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''AppSDK version &amp;gt;= 9.1.0.0 is required''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt; The newly introduced AppSDK API staticEnd() is available only for AppSDK version 9.1.0.0 or higher &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Set up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
For setting up your  iOS Development Environment, refer to [[DCR Germany Video App SDK#iOS]]&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
For setting up your  Android Development Environment, refer to  [[DCR Germany Video App SDK#Android]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create and Initialize SDK Instance ==&lt;br /&gt;
&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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&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;
&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;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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;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;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 file AppSdk.jar is  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;
== Step 3: Review the 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;
&lt;br /&gt;
&lt;br /&gt;
== Step 4: Create Metadata Object for your page section ==&lt;br /&gt;
&lt;br /&gt;
The full description of the other key/value pairs for Metadata can be found here:&lt;br /&gt;
'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
=== Example Web Page Metadata Object ===&lt;br /&gt;
&lt;br /&gt;
==== iOS ==== &lt;br /&gt;
&lt;br /&gt;
===== Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 class SDKMethods : NSObject{ &lt;br /&gt;
    func loadStaticMaster() -&amp;gt; [String : Any] {      &lt;br /&gt;
        //Loading Static Main data      &lt;br /&gt;
        let staticData =&lt;br /&gt;
            [&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
        &amp;quot;assetid&amp;quot;: &amp;quot;Unique_asset_ID&amp;quot;,&lt;br /&gt;
        &amp;quot;section&amp;quot;: &amp;quot;Unique_section_ID&amp;quot;,&lt;br /&gt;
        &amp;quot;segA&amp;quot;: &amp;quot;Unique_section_segA&amp;quot;,&lt;br /&gt;
        &amp;quot;segB&amp;quot;: &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
        &amp;quot;segC&amp;quot;: &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot;: &amp;quot;subbrand_received_from_Nielsen&amp;quot;&lt;br /&gt;
        ]       &lt;br /&gt;
        return staticData    &lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
===== Objective-C =====   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * staticMetadata = @ {&lt;br /&gt;
    @ &amp;quot;type&amp;quot;: @ &amp;quot;static&amp;quot;,&lt;br /&gt;
        @ &amp;quot;assetid&amp;quot;: @ &amp;quot;Unique_asset_ID&amp;quot;,&lt;br /&gt;
        @ &amp;quot;section&amp;quot;: @ &amp;quot;Unique_section_ID&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segA&amp;quot;: @ &amp;quot;Unique_section_segA&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segB&amp;quot;: @ &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segC&amp;quot;: @ &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
        @ &amp;quot;subbrand&amp;quot;: @ &amp;quot;subbrand_received_from_Nielsen&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Android ==== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;   staticMetadata = new JSONObject()&lt;br /&gt;
        .put(&amp;quot;type&amp;quot;, &amp;quot;static&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;section&amp;quot;, &amp;quot;Unique_section_ID&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;assetid&amp;quot;, &amp;quot;Unique_asset_ID&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segA&amp;quot;, &amp;quot;Unique_section_segA&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segB&amp;quot;, &amp;quot;Mandatory_section_segB&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segC&amp;quot;,&amp;quot;Optional_section_segC&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;subbrand&amp;quot;,&amp;quot;subbrand_received_from_Nielsen&amp;quot;);&lt;br /&gt;
    &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 5: Start the Measurement by calling the loadMetadata AppSDK API ==&lt;br /&gt;
&lt;br /&gt;
Use the metadata object created in the previous step in the loadMetadata AppSDK API Call.&lt;br /&gt;
&lt;br /&gt;
{{ExampleCode|&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;
|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;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] Call &amp;lt;code&amp;gt;staticEnd()&amp;lt;/code&amp;gt; to stop the static measurement of the current page before starting a new measurement with &amp;lt;code&amp;gt;loadMetadata()&amp;lt;/code&amp;gt; for the next page.''' &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6: Include the measurement of Advertising Medium (Werbeträger) if applicable  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
A page impression is a user action on the page that leads or could lead to an advertisement being called up. Each user action may only be counted once.&lt;br /&gt;
&lt;br /&gt;
However, a page impression occurs when the content of the viewport of the respective device is completely reloaded/rendered by scrolling/swiping and replaced by new&lt;br /&gt;
content.&lt;br /&gt;
&lt;br /&gt;
When counting views, a distinction is made between content&lt;br /&gt;
views (CPI) and advertising medium views after a user action (WPI). There can be&lt;br /&gt;
only one content view per page. Each additional user action on the same page (click,&lt;br /&gt;
scroll or swipe, e.g. click through an image gallery) will lead to an advertising medium view (WPI) accordingly. The implementation should follow the IVW guidelines for&lt;br /&gt;
defining user actions.&lt;br /&gt;
&lt;br /&gt;
'''Note''':&lt;br /&gt;
The differentiation between the measurement of Content vs. advertising medium is achieved by setting accordingly the &amp;quot;segB&amp;quot; value in the metadata object  , see '''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]''' &lt;br /&gt;
&lt;br /&gt;
=== Implementation Details ===&lt;br /&gt;
How to trigger a page impression for advertising medium?&lt;br /&gt;
In order to trigger a new view for an advertising medium, you have to stop the measurement of the page and start the measurement of the advertising medium, see example code below:&lt;br /&gt;
&lt;br /&gt;
==== Stop static measurement for the page(current metadata): ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; public void staticEnd(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;- (void)staticEnd; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Start static measurement for the advertising medium after user interaction(new metadata): ====&lt;br /&gt;
{{ExampleCode|&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;
|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;
}}&lt;br /&gt;
&lt;br /&gt;
== Step 7: Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Step 8: Going Live ==&lt;br /&gt;
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:&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;
            // 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;
'''&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;
            // 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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live you have to inform Nielsen team - 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>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=AGF_Implementation_Documentation&amp;diff=6175</id>
		<title>AGF Implementation Documentation</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=AGF_Implementation_Documentation&amp;diff=6175"/>
		<updated>2023-03-31T07:41:55Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|AGF Documentation &amp;amp; Downloads}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The following guides are specific for AGF.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Video Measurement&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;text-align: center;&amp;quot; |'''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | AGF&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;
!| Download&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|DEFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{OSIcon|VideoIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | '''[[DCR Germany Video App SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |'''[[Special:Downloads|Download - NO ID AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Video Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| {{SmallIcon|CloudAPIIcon.png}}&lt;br /&gt;
| {{OSIcon|APIIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Video Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Static Measurement&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; style=&amp;quot;background-color:white;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;text-align: center;&amp;quot; |'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | AGF&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;
!| Download&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{SmallIcon|DEFlagIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{SmallIcon|SDKIcon.png}}&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | {{OSIcon|StaticIcon.png}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png}} &lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | '''[[DCR Germany Static App SDK]]''' &amp;lt;br&amp;gt; '''[[DCR Germany Static Hybrid App SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |'''[[Special:Downloads|Download - NO ID AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|{{OSIcon|AndroidIcon.png}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |{{OSIcon|BrowserIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Germany Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{SmallIcon|CloudAPIIcon.png}}&lt;br /&gt;
| '''[[DCR Germany Static Google AMP Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Hybrid_App_SDK&amp;diff=6174</id>
		<title>DCR Germany Static Hybrid App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Hybrid_App_SDK&amp;diff=6174"/>
		<updated>2023-03-31T07:26:00Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen App 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 iOS and Android Apps developers to integrate Nielsen Measurement into their App for the Static Content Measurement. &lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable Static measurement in the WebView of your Hybrid App. The Nielsen App Static Measurement of each different page/section requires different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* To get started, an AppID is needed. The AppID is a unique ID assigned to the App. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''WebView page is tagged with Browser SDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;Make sure that the content loaded in the WebView of your App is already tagged with Nielsen Browser SDK!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Set up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
For setting up your  iOS Development Environment, refer to [[DCR Germany Video App SDK#iOS]]&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
NielsenAppSDKJSHandler in Android only supports Android X. Hence only get Android x enabled Appsdk.jar from Nielsen.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
For setting up your  Android Development Environment, refer to  [[DCR Germany Video App SDK#Android]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 2:  Implement the Nielsen AppSDK JS Handler  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
Tag every page with BSDK, BSDK will check for availability of AppSDK handler in the page before loading itself. On the native side, inject the webview with JS handler which listens the call from BSDK and relay it to AppSDK and vice versa&lt;br /&gt;
On the native side, embed AppSDK in the App project, so that JS handler in webview can relay the calls from JS to native SDK interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
&lt;br /&gt;
===== Add  NielsenAppSDKJSHandler instance =====&lt;br /&gt;
Add  NielsenAppSDKJSHandler instance as web view message handler object conforming to WKScriptMessageHandler protocol with name: &amp;quot;NielsenSDKMsg&amp;quot;. That starts the listening to Browser SDK api calls in AppSDK.&lt;br /&gt;
&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.jsAppSDK = NielsenAppSDKJSHandler(apiType: &amp;quot;ggPM&amp;quot;) //  or apiType:&amp;quot;any string&amp;quot; or apiType:nil&lt;br /&gt;
if let jsAppSDK = self.jsAppSDK {&lt;br /&gt;
    self.webView?.configuration.userContentController.add(jsAppSDK, name: &amp;quot;NielsenSDKMsg&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======  Objective-C ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
self.jsAppSDK = [[NielsenAppSDKJSHandler alloc] initWithApiType:@&amp;quot;ggPM&amp;quot;]; // or initWithApiType:@&amp;quot;any string&amp;quot; or initWithApiType:nil&lt;br /&gt;
[self.webView.configuration.userContentController addScriptMessageHandler:self.jsAppSDK name:@&amp;quot;NielsenSDKMsg&amp;quot;];&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Please make sure that you don't use any other name than “NielsenSDKMsg” for  adding WKScriptMessageHandler instance as javascript listener otherwise you won't receive BSDK api calls in APPSDK.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== remove  NielsenAppSDKJSHandler instance when WebView is being unloaded =====&lt;br /&gt;
To delete NielsenAppSDKJSHandler instance it should be detached from web view and pointer to it should be set to nil.&lt;br /&gt;
&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.webView?.configuration.userContentController.removeScriptMessageHandler(forName: &amp;quot;NielsenSDKMsg&amp;quot;)&lt;br /&gt;
self.jsAppSDK = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======  Objective-C ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
[self.webView.configuration.userContentController removeScriptMessageHandlerForName:@&amp;quot;NielsenSDKMsg&amp;quot;];&lt;br /&gt;
self.jsAppSDK = nil;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
&lt;br /&gt;
===== Enable the javascript on webview using below lines =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WebSettings webSetting = webView.getSettings();&lt;br /&gt;
webSetting.setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Add  NielsenAppSDKJSHandler instance as javascript interface to webview with name “NielsenAppSDK” ===== &lt;br /&gt;
&lt;br /&gt;
That starts the listening to Browser SDK api calls in AppSDK.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
webView.addJavascriptInterface(new NielsenAppSDKJSHandler(getApplicationContext()), &amp;quot;NielsenAppSDK&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Hybrid_App_SDK&amp;diff=6157</id>
		<title>DCR Germany Static Hybrid App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Hybrid_App_SDK&amp;diff=6157"/>
		<updated>2023-03-30T16:07:48Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}} Category:Digital  &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt; PLease note that t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that this Hybrid App SDK Integration Guide is not yet released for AGF/Germany!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen App 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 iOS and Android Apps developers to integrate Nielsen Measurement into their App for the Static Content Measurement. &lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable Static measurement in the WebView of your Hybrid App. The Nielsen App Static Measurement of each different page/section requires different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* To get started, an AppID is needed. The AppID is a unique ID assigned to the App. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''WebView page is tagged with Browser SDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;Make sure that the content loaded in the WebView of your App is already tagged with Nielsen Browser SDK!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Set up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
For setting up your  iOS Development Environment, refer to [[DCR Germany Video App SDK#iOS]]&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
NielsenAppSDKJSHandler in Android only supports Android X. Hence only get Android x enabled Appsdk.jar from Nielsen.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
For setting up your  Android Development Environment, refer to  [[DCR Germany Video App SDK#Android]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 2:  Implement the Nielsen AppSDK JS Handler  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
Tag every page with BSDK, BSDK will check for availability of AppSDK handler in the page before loading itself. On the native side, inject the webview with JS handler which listens the call from BSDK and relay it to AppSDK and vice versa&lt;br /&gt;
On the native side, embed AppSDK in the App project, so that JS handler in webview can relay the calls from JS to native SDK interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
&lt;br /&gt;
===== Add  NielsenAppSDKJSHandler instance =====&lt;br /&gt;
Add  NielsenAppSDKJSHandler instance as web view message handler object conforming to WKScriptMessageHandler protocol with name: &amp;quot;NielsenSDKMsg&amp;quot;. That starts the listening to Browser SDK api calls in AppSDK.&lt;br /&gt;
&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.jsAppSDK = NielsenAppSDKJSHandler(apiType: &amp;quot;ggPM&amp;quot;) //  or apiType:&amp;quot;any string&amp;quot; or apiType:nil&lt;br /&gt;
if let jsAppSDK = self.jsAppSDK {&lt;br /&gt;
    self.webView?.configuration.userContentController.add(jsAppSDK, name: &amp;quot;NielsenSDKMsg&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======  Objective-C ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
self.jsAppSDK = [[NielsenAppSDKJSHandler alloc] initWithApiType:@&amp;quot;ggPM&amp;quot;]; // or initWithApiType:@&amp;quot;any string&amp;quot; or initWithApiType:nil&lt;br /&gt;
[self.webView.configuration.userContentController addScriptMessageHandler:self.jsAppSDK name:@&amp;quot;NielsenSDKMsg&amp;quot;];&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Please make sure that you don't use any other name than “NielsenSDKMsg” for  adding WKScriptMessageHandler instance as javascript listener otherwise you won't receive BSDK api calls in APPSDK.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== remove  NielsenAppSDKJSHandler instance when WebView is being unloaded =====&lt;br /&gt;
To delete NielsenAppSDKJSHandler instance it should be detached from web view and pointer to it should be set to nil.&lt;br /&gt;
&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
self.webView?.configuration.userContentController.removeScriptMessageHandler(forName: &amp;quot;NielsenSDKMsg&amp;quot;)&lt;br /&gt;
self.jsAppSDK = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======  Objective-C ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
[self.webView.configuration.userContentController removeScriptMessageHandlerForName:@&amp;quot;NielsenSDKMsg&amp;quot;];&lt;br /&gt;
self.jsAppSDK = nil;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
&lt;br /&gt;
===== Enable the javascript on webview using below lines =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WebSettings webSetting = webView.getSettings();&lt;br /&gt;
webSetting.setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Add  NielsenAppSDKJSHandler instance as javascript interface to webview with name “NielsenAppSDK” ===== &lt;br /&gt;
&lt;br /&gt;
That starts the listening to Browser SDK api calls in AppSDK.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
webView.addJavascriptInterface(new NielsenAppSDKJSHandler(getApplicationContext()), &amp;quot;NielsenAppSDK&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6124</id>
		<title>Sweden SDK Metadata</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Sweden_SDK_Metadata&amp;diff=6124"/>
		<updated>2023-02-21T08:19:22Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Content Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= Digital Metadata =&lt;br /&gt;
Digital Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 1''' focuses on the content metadata&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Section 2''' focuses on the Ad metadata.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Content Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||  || type of asset || &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| userid ||  || the user login ID. Used by MMS reach model. ''The uploaded value needs to be hashed with SHA512''. This is the user login ID on player. We prefer a numeric value. (please '''do not''' use user email address)|| &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa...&amp;quot; || required if login feature&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Content ID, mms_tid || unique ID assigned to an asset within the same media house. (max: 20 characters).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; In addition to this metadata for content needs to be reported to MMS via TitleService. Contact online@mms.se for more information. || &lt;br /&gt;
&amp;lt;small&amp;gt;For VoD use internal format. [https://engineeringportal.nielsen.com/docs/Special_Characters No special characters]&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;For content on simulcast channels, this has a standard format: simulcast_channelnumber ('''Example''' for Channel TV4, the expected value is: simulcast_29).&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;A complete list of channel reference libraries with channel numbers is on the  [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓ &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of content in seconds || Length of content in seconds. &lt;br /&gt;
* &amp;lt;small&amp;gt;for VoD, video length&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for event-Live stream, the planned length. If planned length not available, then put default value 0&amp;lt;/small&amp;gt;&lt;br /&gt;
* &amp;lt;small&amp;gt;for simulcast and 24/7 live stream, 86400&amp;lt;/small&amp;gt;&lt;br /&gt;
 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| clientpassparam || MMS Values, mms_values || pass-through parameters || For clients that provide DAI (dynamic ad insertion) service, this has a standard format: origcode=channelnumber.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' origcode=29&lt;br /&gt;
See the complete list of channel reference library with the channel number on [https://mms.se/for-vara-kunder/teknisk-dokumentation-tv/referensbandade-kanaler/ MMS homepage] tab &amp;quot;referensbandade kanaler&amp;quot;.&amp;lt;/small&amp;gt; &amp;lt;br&amp;gt; &amp;lt;small&amp;gt;Please use string, JSON format is not accepted. &amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Length limit: 250 characters. A longer string may be truncated due to URL length limitation.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| required for clients that have DAI service (Telia, Telenor, Allente, Comhem, Boxer, Sappa, Discovery, Cmore)&lt;br /&gt;
|-&lt;br /&gt;
| program || Program Name, ns_st_pr || program name || '''custom''' '''example:''' leif-och-billy &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode Name, ns_st_ep || episode name || '''custom''' '''example:''' en-ny-tjej-i-byn &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;Leave blank for simulcast. &amp;lt;br&amp;gt;'''Please restrain from using special characters like &amp;quot;/&amp;quot; or &amp;quot;;&amp;quot;'''&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| playlisttitle || Title Playlist, ns_st_pl || playlist reference as a string || string value with playlist name for '''example:''' barn || &lt;br /&gt;
|-&lt;br /&gt;
| ispremiumcontent || MMS Premium, mms_premium || identify premium level via yes or no || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isautoplay || Auto Start, mms_auto || identify if autoplay is enabled on the video || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| plugv || Player Version, ns_st_mv || player version. increment by 1 for each new version. || alphanumeric '''example:''' 1.0.1 || ✓&lt;br /&gt;
|-&lt;br /&gt;
| playerv || Mediaplayer, ns_st_mp || player identifier || alphanumeric '''example:''' HTML5, JW Player, Sonic  || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject = {&lt;br /&gt;
  type: &amp;quot;content&amp;quot;, &lt;br /&gt;
  userid: &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa…&amp;quot;, &lt;br /&gt;
  assetid: &amp;quot;simulcast_29&amp;quot;,&lt;br /&gt;
  length: &amp;quot;3359&amp;quot;, //seconds&lt;br /&gt;
  clientpassparam: &amp;quot;origcode=29&amp;quot;,&lt;br /&gt;
  program: &amp;quot;leif-och-billy&amp;quot;,&lt;br /&gt;
  title: &amp;quot;en-ny-tjej-i-byn&amp;quot;,&lt;br /&gt;
  playlisttitle: &amp;quot;barn&amp;quot;,&lt;br /&gt;
  ispremiumcontent: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isautoplay: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  plugv: &amp;quot;1.0.1&amp;quot;,&lt;br /&gt;
  playerv: &amp;quot;Sonic&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ad Metadata==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nielsen Key !! MMS Attribute Name, MMS Field Name !! Description !! Values !! Required &lt;br /&gt;
|-&lt;br /&gt;
| type || Ad Type, ns_st_ad || type of ad || &amp;quot;preroll&amp;quot;, &amp;quot;midroll&amp;quot;, &amp;quot;postroll&amp;quot;, &amp;quot;ad&amp;quot; if specific ad type cannot be identified. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Film Code, mms_customadid || custom Ad ID || Film code/Copy code.&lt;br /&gt;
&amp;lt;small&amp;gt;'''Custom examples''': S1MYME202B, 51TRER1001, H1KYLE3032, E1UMBR1001&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;In case of no Film Code is available, use the string &amp;quot;empty&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;For programmatic ads that you are sending &amp;quot;programmatic&amp;quot; as Film Code today, use &amp;quot;programmatic_{current UTC time in epoch form}&amp;quot;.&amp;lt;/small&amp;gt;&lt;br /&gt;
|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| length || Clip Length, ns_st_cl || length of ad in seconds || Length of ad in seconds. || ✓&lt;br /&gt;
|-&lt;br /&gt;
| isprogrammatic || Programmatic, mms_programmatic || identify if the ad is bought prommatic. || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| isthirdpartyad || MMS Thirdparty, mms_thirdparty || identify if the ad is from third party ad server || &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;  || &lt;br /&gt;
|-&lt;br /&gt;
| adplatformorigin || MMS Origin, mms_origin || identify where an ad is originated. It is used when isprogrammatic=yes or isthirdpartyad=yes. || custom '''examples:''' Smartclip, YuMe&lt;br /&gt;
 || &lt;br /&gt;
|-&lt;br /&gt;
| adidx || Position in Break, ns_st_an || placement in ad break. It is passed by ad servers. || Custom with the following format:&lt;br /&gt;
&amp;lt;small&amp;gt;{ad placement}/{total number of ads in an ad break}&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;'''Example:''' 2/5, the second ad in an ad break with 5 ads.&amp;lt;/small&amp;gt; &lt;br /&gt;
|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example of metadata object for Ad:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var prerollMetadataObject = {&lt;br /&gt;
  type: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
  assetid: &amp;quot;E1UMBR1001&amp;quot;, &lt;br /&gt;
  length: &amp;quot;30&amp;quot;, //seconds&lt;br /&gt;
  isprogrammatic: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  isthirdpartyad: &amp;quot;yes&amp;quot;,&lt;br /&gt;
  adplatformorigin: &amp;quot;YuMe&amp;quot;,&lt;br /&gt;
  adidx: &amp;quot;1/5&amp;quot;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6123</id>
		<title>DCR Germany Static Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_Browser_SDK&amp;diff=6123"/>
		<updated>2023-02-17T14:39:14Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{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 Web pages. It supports static content measurement 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;
This guide will show you how to enable page measurement (aka Static) on your website(s). The Nielsen Tracking Code must be added to each page with different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Add Static Queue Snippet ==&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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following script tag to the website i.e. within the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; tag :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
	// Add Static Queue Snippet&lt;br /&gt;
	!function(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create SDK Instance ==&lt;br /&gt;
While creating an SDK instance, initialize the SDK by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initialization call has the below parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter	!! Description	!! Required !! Values&lt;br /&gt;
|-&lt;br /&gt;
| apid	|| Unique ID assigned to player/site ||Yes	||'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'&lt;br /&gt;
|-&lt;br /&gt;
|instanceName ||	Name of SDK instance||Yes	 ||	&amp;quot;any string value&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug	|| Enables Nielsen console logging. Only required for testing	||No	|| &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;})&amp;quot;&lt;br /&gt;
|}&lt;br /&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;
== Step 3: Create Metadata Object ==&lt;br /&gt;
The full description of the other key/value pairs for Metadata can be found here:&lt;br /&gt;
'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
=== Example Web Page Metadata Object ===&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;
  window.articlemetadata = {&lt;br /&gt;
    type: &amp;quot;static&amp;quot;,&lt;br /&gt;
    assetid: &amp;quot;Unique_page_ID&amp;quot;, &lt;br /&gt;
	section:  &amp;quot;Unique_section_ID&amp;quot;, &lt;br /&gt;
    segA: &amp;quot;Unique_section_segA&amp;quot;, &lt;br /&gt;
    segB: &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
    segC: &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
    subbrand: &amp;quot;subbrand_received_from_Nielsen&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;
== Step 4: Call staticstart Event ==&lt;br /&gt;
Start static measurement :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The content metadata object is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Include the measurement of Advertising Medium (Werbeträger) if applicable  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
A page impression is a user action on the page that leads or could lead to an advertisement being called up. Each user action may only be counted once.&lt;br /&gt;
&lt;br /&gt;
However, a page impression occurs when the content of the viewport of the respective device is completely reloaded/rendered by scrolling/swiping and replaced by new&lt;br /&gt;
content.&lt;br /&gt;
&lt;br /&gt;
When counting views, a distinction is made between content&lt;br /&gt;
views (CPI) and advertising medium views after a user action (WPI). There can be&lt;br /&gt;
only one content view per page. Each additional user action on the same page (click,&lt;br /&gt;
scroll or swipe, e.g. click through an image gallery) will lead to an advertising medium view (WPI) accordingly. The implementation should follow the IVW guidelines for&lt;br /&gt;
defining user actions.&lt;br /&gt;
&lt;br /&gt;
'''Note''':&lt;br /&gt;
The differentiation between the measurement of Content vs. advertising medium is achieved by setting accordingly the &amp;quot;segB&amp;quot; value in the metadata object  , see '''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]''' &lt;br /&gt;
&lt;br /&gt;
=== Implementation Details ===&lt;br /&gt;
How to trigger a page impression for advertising medium?&lt;br /&gt;
In order to trigger a a new view for an advertising medium, you have to stop the measurement of the page and start the measurement of the advertising medium, see example code below:&lt;br /&gt;
&lt;br /&gt;
* Stop static measurement for the page(current metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticend' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticend&amp;quot;, window.articlemetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start static measurement for the advertising medium after user interaction(new metadata):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  // Event 'staticstart' Call&lt;br /&gt;
  nSdkInstance.ggPM(&amp;quot;staticstart&amp;quot;, window.adMediummetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6: Review Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
==Step 7:  Testing ==&lt;br /&gt;
'''Monitoring Tools'''&lt;br /&gt;
Testing the Browser Implementation&lt;br /&gt;
&lt;br /&gt;
The steps to test the implementation are given below.&lt;br /&gt;
&lt;br /&gt;
'''Step 7.1'''&lt;br /&gt;
&lt;br /&gt;
Filter HTTP traffic with the string &amp;quot;nmr&amp;quot; to capture traffic from the SDK. This will capture traffic going to Nielsen servers.&lt;br /&gt;
&lt;br /&gt;
'''Step 7.2'''&lt;br /&gt;
&lt;br /&gt;
Verify that the Nielsen SDK is being downloaded correctly and is the correct version.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://cdn-gl.nmrodam.com/novms/js/2/nlsSDK600.bundle.min.js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 7.3'''&lt;br /&gt;
&lt;br /&gt;
When the page is loaded for the first time, the Browser SDK fires a View ping as soon as content is loaded. Utilizing your HTTP traffic filter tool, you can now validate the metadata that is being sent to the Nielsen collection servers.&lt;br /&gt;
&lt;br /&gt;
Example View Ping Below:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;https://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;ci=us-500207&amp;amp;ch=us-500207_c77_Main-GTM_P&amp;amp;asn=Main-GTM&amp;amp;sessionId=8l2XGnAW6IC3Cc2MIMh0RYRTqimuU1553108759&amp;amp;prv=1&amp;amp;c6=vc,c77&amp;amp;ca=NA&amp;amp;c13=asid,P00BEB680-1F1A-47BB-922D-1BD2F1BA79A7&amp;amp;c32=...&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step 7.4'''&lt;br /&gt;
&lt;br /&gt;
The first duration ping is fired after 5 minutes of content is viewed and is indicated by the cr value containing a D. This should fire every 5 minutes but only when the page is in focus.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;http://secure-eu.nmrodam.com/cgi-bin/gn?prd=dcr&amp;amp;st=dcr&amp;amp;rt=text&amp;amp;forward=0&amp;amp;sup=0&lt;br /&gt;
&amp;amp;ad=0&amp;amp;asn=%2Fsdk2%2Findex2.html&amp;amp;ci=us-500270&amp;amp;c6=vc,c77&amp;amp;c9=devid,&amp;amp;c11=agg,1&lt;br /&gt;
&amp;amp;c12=apv,3&amp;amp;c13=asid,PAA3A8EF7-E6D2-4A9E-9787-BDXXXXXXXXXX&amp;amp;c15=apn,Test2&lt;br /&gt;
&amp;amp;c16=sdkv,bj.5.1.5&amp;amp;c26=dmap,1&amp;amp;c29=plid,14767465028039340&amp;amp;c30=bldv,1.0.0.15&amp;amp;c32=segA,USA&lt;br /&gt;
&amp;amp;c33=segB,CA&amp;amp;c34=segC,RSM&amp;amp;at=timer&amp;amp;cr=D&amp;amp;c27=cln,300&amp;amp;rnd=857576&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 8: 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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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;br /&gt;
&lt;br /&gt;
== Step 9: Review the Sample Implementation for your Reference ==&lt;br /&gt;
The Sample Implementation for AGF located [https://nielsenonlinesupport.com/agf/sdkRefImpStaticDE/bsdkstatic.htm here].&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_App_SDK&amp;diff=6122</id>
		<title>DCR Germany Static App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Static_App_SDK&amp;diff=6122"/>
		<updated>2023-02-17T14:37:09Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen App 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 iOS and Android Apps developers to integrate Nielsen Measurement into their App for the Static Content Measurement. &lt;br /&gt;
&lt;br /&gt;
This guide will show you how to enable Static measurement in your App. The Nielsen App Static Measurement of each different page/section requires different metadata.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* To get started, an AppID is needed. The AppID is a unique ID assigned to the App. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 1:  Set up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
For setting up your  iOS Development Environment, refer to [[DCR Germany Video App SDK#iOS]]&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
For setting up your  Android Development Environment, refer to  [[DCR Germany Video App SDK#Android]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 2: Create and Initialize SDK Instance ==&lt;br /&gt;
&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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&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;
&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;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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;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;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 file AppSdk.jar is  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;
== Step 3: Review the 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;
&lt;br /&gt;
&lt;br /&gt;
== Step 4: Create Metadata Object for your page section ==&lt;br /&gt;
&lt;br /&gt;
The full description of the other key/value pairs for Metadata can be found here:&lt;br /&gt;
'''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
=== Example Web Page Metadata Object ===&lt;br /&gt;
&lt;br /&gt;
==== iOS ==== &lt;br /&gt;
&lt;br /&gt;
===== Swift =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 class SDKMethods : NSObject{ &lt;br /&gt;
    func loadStaticMaster() -&amp;gt; [String : Any] {      &lt;br /&gt;
        //Loading Static Main data      &lt;br /&gt;
        let staticData =&lt;br /&gt;
            [&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
        &amp;quot;assetid&amp;quot;: &amp;quot;Unique_asset_ID&amp;quot;,&lt;br /&gt;
        &amp;quot;section&amp;quot;: &amp;quot;Unique_section_ID&amp;quot;,&lt;br /&gt;
        &amp;quot;segA&amp;quot;: &amp;quot;Unique_section_segA&amp;quot;,&lt;br /&gt;
        &amp;quot;segB&amp;quot;: &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
        &amp;quot;segC&amp;quot;: &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
        &amp;quot;subbrand&amp;quot;: &amp;quot;subbrand_received_from_Nielsen&amp;quot;&lt;br /&gt;
        ]       &lt;br /&gt;
        return staticData    &lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
===== Objective-C =====   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * staticMetadata = @ {&lt;br /&gt;
    @ &amp;quot;type&amp;quot;: @ &amp;quot;static&amp;quot;,&lt;br /&gt;
        @ &amp;quot;assetid&amp;quot;: @ &amp;quot;Unique_asset_ID&amp;quot;,&lt;br /&gt;
        @ &amp;quot;section&amp;quot;: @ &amp;quot;Unique_section_ID&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segA&amp;quot;: @ &amp;quot;Unique_section_segA&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segB&amp;quot;: @ &amp;quot;Mandatory_section_segB&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segC&amp;quot;: @ &amp;quot;Optional_section_segC&amp;quot;,&lt;br /&gt;
        @ &amp;quot;subbrand&amp;quot;: @ &amp;quot;subbrand_received_from_Nielsen&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Android ==== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;   staticMetadata = new JSONObject()&lt;br /&gt;
        .put(&amp;quot;type&amp;quot;, &amp;quot;static&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;section&amp;quot;, &amp;quot;Unique_section_ID&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;assetid&amp;quot;, &amp;quot;Unique_asset_ID&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segA&amp;quot;, &amp;quot;Unique_section_segA&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segB&amp;quot;, &amp;quot;Mandatory_section_segB&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;segC&amp;quot;,&amp;quot;Optional_section_segC&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;subbrand&amp;quot;,&amp;quot;subbrand_received_from_Nielsen&amp;quot;);&lt;br /&gt;
    &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 5: Start the Measurement by calling the loadMetadata AppSDK API ==&lt;br /&gt;
&lt;br /&gt;
Use the metadata object created in the previous step in the loadMetadata AppSDK API Call.&lt;br /&gt;
&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;
== Step 6: Include the measurement of Advertising Medium (Werbeträger) if applicable  ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
A page impression is a user action on the page that leads or could lead to an advertisement being called up. Each user action may only be counted once.&lt;br /&gt;
&lt;br /&gt;
However, a page impression occurs when the content of the viewport of the respective device is completely reloaded/rendered by scrolling/swiping and replaced by new&lt;br /&gt;
content.&lt;br /&gt;
&lt;br /&gt;
When counting views, a distinction is made between content&lt;br /&gt;
views (CPI) and advertising medium views after a user action (WPI). There can be&lt;br /&gt;
only one content view per page. Each additional user action on the same page (click,&lt;br /&gt;
scroll or swipe, e.g. click through an image gallery) will lead to an advertising medium view (WPI) accordingly. The implementation should follow the IVW guidelines for&lt;br /&gt;
defining user actions.&lt;br /&gt;
&lt;br /&gt;
'''Note''':&lt;br /&gt;
The differentiation between the measurement of Content vs. advertising medium is achieved by setting accordingly the &amp;quot;segB&amp;quot; value in the metadata object  , see '''[[AGF Metadata Convention#Static Measurement|AGF Metadata Convention for Static Measurement]]''' &lt;br /&gt;
&lt;br /&gt;
=== Implementation Details ===&lt;br /&gt;
How to trigger a page impression for advertising medium?&lt;br /&gt;
In order to trigger a a new view for an advertising medium, you have to set the segB metadata value including the timestamp (i.e. &amp;quot;WPI_1674049210&amp;quot;) and then call loadMetadata, see example code below:&lt;br /&gt;
&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;
&lt;br /&gt;
== Step 7: Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Step 8: Going Live ==&lt;br /&gt;
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:&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;
            // 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;
'''&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;
            // 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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live you have to inform Nielsen team - 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>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6121</id>
		<title>AGF Metadata Convention</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6121"/>
		<updated>2023-02-17T10:47:07Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Static Measurement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= AGF Metadata Convention =&lt;br /&gt;
&lt;br /&gt;
The  Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static Measurement ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required (Obligatory) !! AGF Convention	!! Example data - RTL&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; || ✓ || hardcoded string required by Nielsen  || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to each article/page; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]]) || ✓ || Content Article ID. If it is not an article page and therefore no ID is available, the page path is used. || &amp;quot;999452&amp;quot;&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)	|| custom (no [[Special Characters]])	|| ✓ || Section of Website or App || &amp;quot;_rtl_portal_news&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segA 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || AGOF code or comparable unit code. If the AGOF code is not available, set &amp;quot;Unknown&amp;quot; || &amp;quot;dbrsowf_rtlnews&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segB 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || Value to define content view count vs. 'Werbetraeger' view count. For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger': &amp;quot;WPI_timestamp&amp;quot; (Timestamp in whole seconds, not milliseconds)	|| For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger' after user interaction with the site and newly loaded Content:  &amp;quot;WPI_1657634473&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| segC 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom ||  || Program name || &amp;quot;IBES&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subbrand 	||  vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen || ✓ || Same as video measurement, provided by Nielsen || &amp;quot;c01&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Video Measurement ==&lt;br /&gt;
&lt;br /&gt;
Please refer to this AGF PDF Document: '''[https://nielsendownloads.digitalengsdk.com/digital/220907_AGF+Custom+Variables+and+Metadata+DCR+SDK++v1.8_english.pdf Metadata Document for Video]'''&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6120</id>
		<title>AGF Metadata Convention</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6120"/>
		<updated>2023-02-15T09:01:40Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Static Measurement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= AGF Metadata Convention =&lt;br /&gt;
&lt;br /&gt;
The  Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static Measurement ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required (Obligatory) !! AGF Convention	!! Example data - RTL&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; || ✓ || hardcoded string required by Nielsen  || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to each article/page; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]]) || ✓ || Content Article ID. If it is not an article page and therefore no ID is available, the page path is used. || &amp;quot;999452&amp;quot;&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)	|| custom (no [[Special Characters]])	|| ✓ || Section of Website or App || &amp;quot;_rtl_portal_news&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segA 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || AGOF code or comparable unit code || &amp;quot;dbrsowf_rtlnews&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segB 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || Value to define content view count vs. 'Werbetraeger' view count. For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger': &amp;quot;WPI_timestamp&amp;quot; (Timestamp in whole seconds, not milliseconds)	|| For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger' after user interaction with the site and newly loaded Content:  &amp;quot;WPI_1657634473&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| segC 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom ||  || Program name || &amp;quot;IBES&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subbrand 	||  vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen || ✓ || Same as video measurement, provided by Nielsen || &amp;quot;c01&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Video Measurement ==&lt;br /&gt;
&lt;br /&gt;
Please refer to this AGF PDF Document: '''[https://nielsendownloads.digitalengsdk.com/digital/220907_AGF+Custom+Variables+and+Metadata+DCR+SDK++v1.8_english.pdf Metadata Document for Video]'''&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6119</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6119"/>
		<updated>2023-02-13T08:05:13Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Review the Reference Implementation for VoD and Live Streams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that the Cloud API Product is not yet rolled out in Germany!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    var timestamp_ms = new Date().getTime();&lt;br /&gt;
    uid += String(timestamp_ms).substring(3);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for AGF by selection Germany in the country dropbox [https://nielsenonlinesupport.com/agf/RefImplCloudAPI/index.htm?debug=true RefImplCloudAPI].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Android_SDK&amp;diff=6118</id>
		<title>DCR Sweden Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Android_SDK&amp;diff=6118"/>
		<updated>2023-02-10T12:34:47Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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  It supports a variety of Nielsen Measurement Products like Digital in TV Ratings ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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 subsection/page in the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This ''SDK Android integration guide'' is applicable for '''Android TV''' as well.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;App ID (appid)&amp;quot; || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;Nielsen SDK&amp;quot; || Includes SDK frameworks and &amp;quot;sample implementation&amp;quot;; &amp;quot;See [[Android SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
The Nielsen Android SDK comes in three flavors.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! SDK Flavor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''Android Ad Version'''&lt;br /&gt;
|&lt;br /&gt;
* Opt-In and Opt-Out functionality managed by Opt out of Ads Personalization setting on the device.&lt;br /&gt;
* The Nielsen SDK will collect the [https://developer.android.com/training/articles/ad-id Google Advertising ID] unless the user Opts out.&lt;br /&gt;
* If the Google Play Service is unavailable (ie, Amazon and Huawei devices), the Nielsen SDK will secure the Android ID.&lt;br /&gt;
|-&lt;br /&gt;
| '''Android No Ad Framework'''&lt;br /&gt;
|&lt;br /&gt;
* Without the Google Play Services SDK, the Nielsen SDK cannot read the Google Advertising ID, so it will retrieve the Android ID.&lt;br /&gt;
* The Android ID is a 64-bit number (expressed as a hexadecimal string) unique to each combination of the app-signing key, user and device.&lt;br /&gt;
* The developer is required to present the User Choice Opt-Out page, which is described in the [[#Global_Android_SDK_No_Ad_Framework_Opt-out|Global Android SDK No Ad Framework Opt-out]].&lt;br /&gt;
|-&lt;br /&gt;
| '''Android SDK noID'''&lt;br /&gt;
|&lt;br /&gt;
* This version of the Nielsen SDK is perfect for Kid apps, or where no ID is required.&lt;br /&gt;
* For the requirement, please review the [[#Global_Android_SDK_No_ID_Opt-out|Global Android SDK No ID Opt-out]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to obtain the NielsenAppApi ===&lt;br /&gt;
The Nielsen AppSDK can either be downloaded directly or can be integrated directly within an application through the use of Gradle. We recommend using the Gradle-based integration whenever possible to ensure you maintain the most recent changes and enhancements to the Nielsen libraries.&lt;br /&gt;
* [[Digital_Measurement_Android_Artifactory_Guide|Select to obtain Gradle implementation guide]]&lt;br /&gt;
* [[Special:Downloads|Select to Download Directly]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Setting up your Android Development Environment  ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
1) Ensure to unzip the Nielsen App SDK zip file and copy the &amp;quot;AppSdk.jar&amp;quot; into the app/libs folder on the App’s project. Add it as dependency.&amp;lt;br /&amp;gt;&lt;br /&gt;
2) Add the following permissions to the project’s &amp;quot;AndroidManifest.xml&amp;quot; file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&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;
3) Add Google Play Services lib into dependencies as Nielsen AppSDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
Libraries:&lt;br /&gt;
* com.google.android.gms:play-services&lt;br /&gt;
Required Google Play Service Classes and Packages :&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;
4) Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;import com.nielsen.app.sdk.*;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The Nielsen App SDK (located in the &amp;quot;com.nielsen.app.sdk&amp;quot; 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;
*Nielsen App SDK is compatible with Android OS versions 2.3+.&lt;br /&gt;
*Clients can control/configure the protocol to be used – HTTPS or HTTP to suit their needs.&lt;br /&gt;
*The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 4.0 will later support it natively).&lt;br /&gt;
*If the player application uses a 3rd party media player implementing its own HLS/MPEG-DASH stack, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work correctly.&lt;br /&gt;
&lt;br /&gt;
== Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || YES || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || NO || &amp;quot;Nielsen Sample App&amp;quot;&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;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || NO || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| hem_unknown ||  Hashed email using SHA512. This email is used by MMS reach model.&lt;br /&gt;
|| Client-defined || Required if login feature || &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| enableFpid || true/false value is required to set collection of first-party ID.&lt;br /&gt;
|| Nielsen-specified || NO || &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{enableFpid: &amp;quot;true&amp;quot;} //alternative: false&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;
1) AppSDK() is no longer a singleton object and should be created as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;) // only for debug builds&lt;br /&gt;
          .put(&amp;quot;hem_unknown&amp;quot;, &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;enableFpid&amp;quot;, &amp;quot;true&amp;quot;); // alternative is false; &lt;br /&gt;
&lt;br /&gt;
         // Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
         mAppSdk = new AppSdk(appContext, appSdkConfig, this);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e){&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;
2) implement IAppNotifier into your activity like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public class MainActivity extends AppCompatActivity implements IAppNotifier&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
3) implement callback&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;@Override&lt;br /&gt;
public void onAppSdkEvent(long timestamp, int code, String description){&lt;br /&gt;
  Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the whole Activity will look like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package com.example.josefvancura.nlsdemotmp;&lt;br /&gt;
&lt;br /&gt;
import android.content.Context;&lt;br /&gt;
import android.support.v7.app.AppCompatActivity;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
&lt;br /&gt;
import com.nielsen.app.sdk.*;&lt;br /&gt;
&lt;br /&gt;
import org.json.JSONException;&lt;br /&gt;
import org.json.JSONObject;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    private AppSdk mAppSdk = null;&lt;br /&gt;
    private String TAG = &amp;quot;MainActivity&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_main);&lt;br /&gt;
&lt;br /&gt;
        Context context = getApplicationContext();&lt;br /&gt;
&lt;br /&gt;
        try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;) // only for debug builds&lt;br /&gt;
                    .put(&amp;quot;hem_unknown&amp;quot;, &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;enableFpid&amp;quot;, &amp;quot;true&amp;quot;); // alternative is false; &lt;br /&gt;
&lt;br /&gt;
            // Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
            mAppSdk = new AppSdk(context, appSdkConfig, this ); // Notifier - activity implements IAppNotifier, callback in onAppSdkEvent()&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        catch (JSONException e){&lt;br /&gt;
            Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onAppSdkEvent(long timestamp, int code, String description) {&lt;br /&gt;
        Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
&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 &amp;quot;&amp;quot;Initial state&amp;quot;&amp;quot;.&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 processes playing information. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&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;
== Create Metadata Objects ==&lt;br /&gt;
The parameters passed must be either a JSON formatted string. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
&lt;br /&gt;
* JSON value must be a 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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Create Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip, including when ads play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of content metadata.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:'''  Program and title metadata values should be passed to SDK as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of ad metadata.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&lt;br /&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;
=== MetaData Example ===&lt;br /&gt;
&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;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;uniqueassetid&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;content&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;episode title&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;length&amp;quot;, &amp;quot;2600&amp;quot;);&lt;br /&gt;
   //please see metadata link above for all content parameters&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;uniquepostrolladid&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;postroll&amp;quot;);&lt;br /&gt;
    //please see metadata link above for all ad parameters&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the &amp;quot;&amp;quot;Play&amp;quot;&amp;quot; button on the player. Call play only when initially starting the video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
It needs to be called at the beginning of each asset and pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the beginning of the playlist - see below API call sequence examples.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
Pass playhead position every second during playback. for VOD: pass the current position in seconds. for Live: current Unix timestamp (seconds since Jan-1-1970 UTC) - if it is possible to seek back in Live content, then pass related Unix time (not current). Pass the whole number that increments only by 1 like 1,2,3..&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Java&amp;quot;&amp;gt;mAppSdk.setPlayheadPosition(long videoPositon);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* When a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see below chapter Interruption scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.stop();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.end();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== API Call Sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Ads ====&lt;br /&gt;
Call [[play()]] at start of stream&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
  &amp;quot;assetid&amp;quot;: &amp;quot;vid345-67483&amp;quot;,&lt;br /&gt;
  &amp;quot;program&amp;quot;: &amp;quot;ProgramName&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&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;
Call [[setPlayheadPosition()]] every one second until a pause.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.play(); &amp;lt;/code&amp;gt; || // Call at start of each new stream&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| Interruption || &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // call stop when content playback is interrupted&lt;br /&gt;
|-&lt;br /&gt;
| Resume Content || &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // continue pasing playhead position every second starting from position where content is resumed&lt;br /&gt;
|- &lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Ads ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
   &amp;quot;assetid&amp;quot;: &amp;quot;ad-123&amp;quot;&lt;br /&gt;
   ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until a pause / another [[loadMetadata()]] is called. Playhead should be passed for the entire duration of the ad pod if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.play(channelInfo); &amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content (End of stream) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start. When content has resumed following an ad break, playhead position must continue from where the previous content segment was left off.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states ==&lt;br /&gt;
There are a few approaches to managing the Foreground and Background states of an app available to use for state measurement.&lt;br /&gt;
&lt;br /&gt;
*Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
*Utilizing the SdkBgFgDetectionUtility class&lt;br /&gt;
*Adding a tag to the Manifest XML&lt;br /&gt;
*Manual Management&lt;br /&gt;
=== The LifeCycleObserver ===&lt;br /&gt;
AndroidX replaces the original support library APIs with packages in the androidx namespace, and Android Studio 3.2 and higher provide an automated migration tool. (Select '''Refactor&amp;gt; Migrate to AndroidX''' from the menu bar.)&lt;br /&gt;
&lt;br /&gt;
Starting with version 7.1.0, with AndroidX support, an additional utility is provided in the AppSDK - application background/foreground state detection by the AppSdk leveraging the Android Architecture component &amp;quot;LifeCycleObserver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The AppSdk is now capable of detecting the application UI visibility state transitions between background and foreground without forcing the applications to register for AppSdk's AppSdkApplication class, which is responsible for handling the detection of application background/foreground state transitions at present.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Please note that if you already have an app designed that utilizes the depreciated SdkBgFgDetectionUtility Class, the AppSDK will ignore any calls to these methods if it can utilize the LifeCycleObserver. LifeCycleObserver based auto-detection will take precedence.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Adding the AndroidX dependency ====&lt;br /&gt;
In order to make use of the app background/foreground state transition auto detection feature of AndroidX AppSdk, the app gradle file needs the androidx dependency. The AppSdk API calls - &amp;lt;code&amp;gt;appInForeground()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;appInBackground()&amp;lt;/code&amp;gt; will still be respected by AppSdk by executing the old AppSdk flow of handling &amp;quot;app in foreground&amp;quot; and &amp;quot;app in background&amp;quot; states as is.&lt;br /&gt;
&lt;br /&gt;
==== Using the LifeCycle Extension ====&lt;br /&gt;
The following androidx dependency is required in the app gradle file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If you would like to take advantage of this auto-detection feature of AppSdk at the very initial stage (e.g. splash screen or at of app launch time), before the AppSdk is initialized, you can do so by calling the following newly introduced AppSdk public API, passing the application context :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public static void registerLifeCycleObserver(Context applicationContext)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Log messages for the new auto detection ====&lt;br /&gt;
&lt;br /&gt;
*When the AppSdk app successfully registers for the LifeCycleObserver : &amp;lt;code&amp;gt;Registered LifeCycleObserver for App Background/Foreground auto-detection&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the app enters the foreground state :&amp;lt;code&amp;gt;App is in foreground, auto-detected by AppSDK&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the app enters the background state :&amp;lt;code&amp;gt;App is in background, auto-detected by AppSDK&amp;lt;/code&amp;gt;&lt;br /&gt;
*If the client app doesn't have the &amp;quot;androidx&amp;quot; gradle dependency and AppSdk fails to register LifeCycleObserver :&amp;lt;code&amp;gt;AndroidX LifecycleObserver can not be observed. Please use androidx dependency to activate SDK auto-detection of app background/foreground state.&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the appInForeground() is explicitly called while LifeCycleObserver auto detection is active :&amp;lt;code&amp;gt;Ignoring the appInBackground() call, as the App Background/Foreground auto-detection is active. The current state is - foreground&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the appInBackground() is explicitly called while LifeCycleObserver auto detection is active :&amp;lt;code&amp;gt;Ignoring the appInBackground() call, as the App Background/Foreground auto-detection is active. The current state is - background&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The SdkBgFgDetectionUtility class ===&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement. It may be implemented in multiple ways for Android. This includes&lt;br /&gt;
&lt;br /&gt;
*Enable the Nielsen SDK to measure background/foreground state by making the relevant update to the AndroidManifest.&lt;br /&gt;
*Integrate Nielsen’s SdkBgFgDetectionUtility class within your Custom Application Class.&lt;br /&gt;
*Custom implementation of the required methods within your application.&lt;br /&gt;
&lt;br /&gt;
==== ForeGround/Background Measurement via AndroidManifest ====&lt;br /&gt;
The simplest way to measure the app background/foreground state is to add the following application tag to the Manifest XML. Integrating this into the Manifest XML will enable the SDK to measure app state directly. This approach is supported for Android 4.0 and up only; it requires that the application class is not in use for some other purpose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using the Android SdkBgFbDetectionUtility Class ====&lt;br /&gt;
For developers who are already using the application class, it is recommended that the background/foreground state is implemented using the [[Android Background Foreground|SdkBgFgDetectionUtility class.]] The [[Android Background Foreground|SdkBgFgDetectionUtility class.]] is compatible with Android 4+ and has been made available to Nielsen clients. (You will need to copy/paste the code provided into a file).&lt;br /&gt;
&lt;br /&gt;
==== Manual Background/ForeGround State Management ====&lt;br /&gt;
In cases where the developer is not able to use the AndroidManifest.xml solution nor the Nielsen provided [[Android Background Foreground|SdkBgFgDetectionUtility class.]], the developer will need to manually identify the change of state through the application and call the respective API (appInForeground() or appInBackground()) to inform the SDK regarding the change of state from background to foreground or foreground to background.&lt;br /&gt;
&lt;br /&gt;
The SDK is informed about app state using the below methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;AppLaunchMeasurementManager.appInForeground(getApplicationContext());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;AppLaunchMeasurementManager.appInBackground(getApplicationContext());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to provide an indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct foreground/background state measurement is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-v1.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-v1.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are currently three flavors of the Nielsen SDK:&lt;br /&gt;
# '''[[#Global_Android_SDK_Opt-out|Global Android SDK Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device.&lt;br /&gt;
# '''[[#Global_Android_SDK_No_Ad_Framework_Opt-out|Global Android SDK No Ad Framework Opt-out]]''' - Direct call to SDK. It can be used without Google Play Services or when using the No Ad version of the SDK.&lt;br /&gt;
# '''[[#Global_Android_SDK_No_ID_Opt-out|Global Android SDK No ID Opt-out]]''' - Direct call to SDK. It should be used for Kids Category.&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android when the [https://developers.google.com/android/guides/setup Google Play services APIs] have been setup in your project.&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 '''Opt out of Ads Personalization''' setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
==== Webview Element ====&lt;br /&gt;
It is a requirement to display a WebView element whose loadUrl is set to the value obtained from optOutURL.&lt;br /&gt;
If using the Global Android SDK, this optOutURL informs the user how to deactivate/activate “Out of Ads Personalization”.&lt;br /&gt;
&lt;br /&gt;
==== Retrieve current Opt-Out preference ====&lt;br /&gt;
Whether the user is opted out via OS-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. &amp;lt;code&amp;gt;appSdk.getOptOutStatus()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span id=&amp;quot;Global OptOut Example&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Global OptOut Example ===&lt;br /&gt;
The below code is an AndroidX example of displaying the Nielsen Privacy page to the user.  Please see the next section if using the No Ad Framework build&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;
        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;
        String url = appSdk.userOptOutURLString();   // Request Optout URL from NielsenSDK&lt;br /&gt;
        webView.loadUrl(url);                         //Display to the user in a Webview&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onBackPressed() {&lt;br /&gt;
        super.onBackPressed();&lt;br /&gt;
        mSdkInterface.getSDK(appSdk);&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onDestroy() {&lt;br /&gt;
        super.onDestroy();&lt;br /&gt;
        if (appSdk != null)&lt;br /&gt;
        {&lt;br /&gt;
            appSdk.close();&lt;br /&gt;
            appSdk = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK No Ad Framework Opt-out ===&lt;br /&gt;
The ''No Ad Framework Opt-out'' can be used when the host application does not leverage Google Play Services, such as when using the No Ad or No ID versions.&lt;br /&gt;
&lt;br /&gt;
==== The No Ad Framework 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 closes 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;
===&amp;lt;span id=&amp;quot;No Ad Framework Optout Sample Code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;No Ad Framework Optout Sample Code ===&lt;br /&gt;
The below code is an AndroidX example of displaying the Nielsen Privacy page to the user with the No Ad Framework SDK Build.&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;
        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;
            @Override&lt;br /&gt;
            public boolean shouldOverrideUrlLoading(WebView view, String url) {&lt;br /&gt;
&lt;br /&gt;
                if(url.contains(&amp;quot;nielsen&amp;quot;)){&lt;br /&gt;
                    // If url value = &amp;quot;nielsenappsdk://1&amp;quot; it means the user selected Opt-out&lt;br /&gt;
                    // If url value = &amp;quot;nielsenappsdk://0&amp;quot; it means the user selected Opt-in&lt;br /&gt;
                    appSdk.userOptOut(url);&lt;br /&gt;
                }&lt;br /&gt;
                return true;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
        });&lt;br /&gt;
        String url = appSdk.userOptOutURLString();   // Request Optout URL from NielsenSDK&lt;br /&gt;
        webView.loadUrl(url);                         //Display to the user in a Webview&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onBackPressed() {&lt;br /&gt;
        super.onBackPressed();&lt;br /&gt;
        mSdkInterface.getSDK(appSdk);&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onDestroy() {&lt;br /&gt;
        super.onDestroy();&lt;br /&gt;
        if (appSdk != null)&lt;br /&gt;
        {&lt;br /&gt;
            appSdk.close();&lt;br /&gt;
            appSdk = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK No ID Opt-out ===&lt;br /&gt;
If you are building an app that will be listed in the Kids Category:&lt;br /&gt;
#  Ensure that you are using the No ID version of the Nielsen SDK Framework.&lt;br /&gt;
#  Immediately following the initialization of the Nielsen SDK ensure you call the userOptOut API with Opt-out selection: &lt;br /&gt;
&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;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page or have the similar text available within the native app. Include the &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 https://www.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=sv for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== First Party ID (FPID)===&lt;br /&gt;
- The broadcaster must enableFPID in the initialization settings which is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; depending on user consent. This is to be set by the broadcaster when initializing our SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The &amp;lt;code&amp;gt;enableFpid&amp;lt;/code&amp;gt; flag is needed to enable/disable FPID usage for the AppID. The default value for this flag is true. If this flag is changed from true to false, then the AppSDK should wipe out the stored FPID and use a blank value for FPID parameter in all the pings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Generated FPID value is stored in the persistent memory until the application is uninstalled from a device, when FPID is wiped out, or when it is expired.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The default value for this parameter is 180 days. Once this timeout is reached, the FPID should be regenerated.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Optional Step for DCR Chromecast Android SDK ==&lt;br /&gt;
For the implementation of Chromecast SDK architecture. Please refer to this guide: [https://engineeringportal.nielsen.com/docs/DCR_Chromecast_Android_SDK DCR Chromecast Android SDK]&lt;br /&gt;
&lt;br /&gt;
== Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via the same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;imr&amp;quot; and confirm the presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-sw.imrworldwide.com/cgi-bin/gn?prd=dcr&amp;amp;ci=se-910684&amp;amp;ch=se-910684_c01_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=096ohdsc0jqkmct81qpxhmn19qx041630053963&amp;amp;fp_cr_tm=1630053963&amp;amp;fp_acc_tm=1630053963&amp;amp;fp_emm_tm=1630053963&amp;amp;ve_id=afc5d61a88b62672&amp;amp;sessionId=zc6gh3uhka7d2mtobb2b2m7sixygy1630053963&amp;amp;tl=Djuren%20p%C3%A5%20Djuris&amp;amp;prv=1&amp;amp;c6=vc,c01&amp;amp;ca=se-910684_c01_218531&amp;amp;cg=Hemligheter&amp;amp;c13=asid,T1194003B-797F-4896-A5C0-05914236146E&amp;amp;c32=segA,NA&amp;amp;c33=segB,NA&amp;amp;c34=segC,NA&amp;amp;c15=apn,&amp;amp;plugv=4.4.1&amp;amp;playerv=ExoPlayer&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=1&amp;amp;cr=4_00_99_D1_10000&amp;amp;c9=devid,c041ec5e50722cdf8cc5b4826c24ae54c5747a6570e900006c826b37ca01ce17&amp;amp;enc=true&amp;amp;c1=nuid,c041ec5e50722cdf8cc5b4826c24ae54c5747a6570e900006c826b37ca01ce17&amp;amp;at=timer&amp;amp;rt=video&amp;amp;c16=sdkv,aa.8.1.0&amp;amp;c27=cln,34&amp;amp;crs=0&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid,16300539624283525&amp;amp;c30=bldv,aa.8.1.0.0_gaxnons&amp;amp;st=dcr&amp;amp;c7=osgrp,&amp;amp;c8=devgrp,&amp;amp;c10=plt,&amp;amp;c40=adbid,&amp;amp;c14=osver,ANDROID.11&amp;amp;c26=dmap,1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid,&amp;amp;c36=cref1,&amp;amp;c37=cref2,&amp;amp;c11=agg,1&amp;amp;c12=apv,4.4.1.4004001&amp;amp;c51=adl,0&amp;amp;c52=noad,0&amp;amp;sd=578&amp;amp;pc=NA&amp;amp;c53=fef,n&amp;amp;c54=oad,&amp;amp;c55=cref3,&amp;amp;c57=adldf,2&amp;amp;ai=218531&amp;amp;c3=st,c&amp;amp;c64=starttm,1630053962&amp;amp;adid=218531&amp;amp;c58=isLive,false&amp;amp;c59=sesid,257f8bz854wmqa31gk3icyi7cmj131630053964&amp;amp;c61=createtm,1630053997&amp;amp;c63=pipMode,&amp;amp;ci_userid=&amp;amp;is_auto_play=no&amp;amp;pl_title=&amp;amp;is_prem=no&amp;amp;is_prog=&amp;amp;ad_origin=&amp;amp;adidx=&amp;amp;is_tpad=&amp;amp;ci_passthr=&amp;amp;c62=sendTime,1630053997&amp;amp;c68=bndlid,air.se.urplay.android_player.debug&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype,&amp;amp;c74=dvcnm,&amp;amp;c76=adbsnid,&amp;amp;c77=adsuprt,2&amp;amp;uoo=&amp;amp;evdata=PL%3A1630053964727%3A0&amp;amp;c71=ottflg,0&amp;amp;c72=otttyp,&amp;amp;c44=progen,&amp;amp;davty=1&amp;amp;si=&amp;amp;c66=mediaurl,&amp;amp;sdd=retry,0~~retryreason,~~devmodel,SM-G981B~~devtypid,samsung-SM-G981B~~sysname,Android~~sysversion,11~~manuf,samsung&amp;amp;cat_id=3398d8e4-e613-42c1-92aa-1a6fc52dcf5c&amp;amp;vtoff=0&amp;amp;rnd=1630053997971&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 9 :  Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Step 10 :  Going Live ==&lt;br /&gt;
After the integration has been certified by Nielsen (but not prior to that), do the following:&lt;br /&gt;
&lt;br /&gt;
# '''Disable 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;
# '''Notify Nielsen''': Once you are ready to go live, let us know so we can enable you for reporting. We will not be able to collect or report data prior to receiving notification from you.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Android_SDK&amp;diff=6117</id>
		<title>DCR Sweden Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Android_SDK&amp;diff=6117"/>
		<updated>2023-02-10T12:31:48Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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  It supports a variety of Nielsen Measurement Products like Digital in TV Ratings ([[DCR &amp;amp; DTVR|DTVR]]), Digital Content Ratings ([[DCR &amp;amp; DTVR|DCR]]), and [[Digital Ad Ratings]] (DAR). 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 subsection/page in the application.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This ''SDK Android integration guide'' is applicable for '''Android TV''' as well.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you start the integration, you will need:&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;App ID (appid)&amp;quot; || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
|| ☑ || &amp;quot;Nielsen SDK&amp;quot; || Includes SDK frameworks and &amp;quot;sample implementation&amp;quot;; &amp;quot;See [[Android SDK Release Notes]]&amp;quot; || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
The Nielsen Android SDK comes in three flavors.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! SDK Flavor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''Android Ad Version'''&lt;br /&gt;
|* Opt-In and Opt-Out functionality managed by Opt out of Ads Personalization setting on the device. &amp;lt;br /&amp;gt;* The Nielsen SDK will collect the [https://developer.android.com/training/articles/ad-id Google Advertising ID] unless the user Opts out.&amp;lt;br&amp;gt;* If the Google Play Service is unavailable (ie, Amazon and Huawei devices), the Nielsen SDK will secure the Android ID.&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Android No Ad Framework'''&lt;br /&gt;
|* Without the Google Play Services SDK, the Nielsen SDK cannot read the Google Advertising ID, so it will retrieve the Android ID.&amp;lt;br /&amp;gt;* The Android ID is a 64-bit number (expressed as a hexadecimal string) unique to each combination of the app-signing key, user and device.&amp;lt;br /&amp;gt;* The developer is required to present the User Choice Opt-Out page, which is described in the [[#Global_Android_SDK_No_Ad_Framework_Opt-out|Global Android SDK No Ad Framework Opt-out]].&lt;br /&gt;
|-&lt;br /&gt;
| '''Android SDK noID'''&lt;br /&gt;
|* This version of the Nielsen SDK is perfect for Kid apps, or where no ID is required.&amp;lt;br&amp;gt;* For the requirement, please review the [[#Global_Android_SDK_No_ID_Opt-out|Global Android SDK No ID Opt-out]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== How to obtain the NielsenAppApi ===&lt;br /&gt;
The Nielsen AppSDK can either be downloaded directly or can be integrated directly within an application through the use of Gradle. We recommend using the Gradle-based integration whenever possible to ensure you maintain the most recent changes and enhancements to the Nielsen libraries.&lt;br /&gt;
* [[Digital_Measurement_Android_Artifactory_Guide|Select to obtain Gradle implementation guide]]&lt;br /&gt;
* [[Special:Downloads|Select to Download Directly]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Setting up your Android Development Environment  ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
1) Ensure to unzip the Nielsen App SDK zip file and copy the &amp;quot;AppSdk.jar&amp;quot; into the app/libs folder on the App’s project. Add it as dependency.&amp;lt;br /&amp;gt;&lt;br /&gt;
2) Add the following permissions to the project’s &amp;quot;AndroidManifest.xml&amp;quot; file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&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;
3) Add Google Play Services lib into dependencies as Nielsen AppSDK uses the following packages/classes from the Google Play service.&lt;br /&gt;
Libraries:&lt;br /&gt;
* com.google.android.gms:play-services&lt;br /&gt;
Required Google Play Service Classes and Packages :&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;
4) Once the files are in place, import com.nielsen.app.sdk to the java source code and start accessing the public interface.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;import com.nielsen.app.sdk.*;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The Nielsen App SDK (located in the &amp;quot;com.nielsen.app.sdk&amp;quot; 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;
*Nielsen App SDK is compatible with Android OS versions 2.3+.&lt;br /&gt;
*Clients can control/configure the protocol to be used – HTTPS or HTTP to suit their needs.&lt;br /&gt;
*The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 4.0 will later support it natively).&lt;br /&gt;
*If the player application uses a 3rd party media player implementing its own HLS/MPEG-DASH stack, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work correctly.&lt;br /&gt;
&lt;br /&gt;
== Create SDK Instance ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object when needed, which can be used simultaneously. '''For the general use case where only one video is played at the same time in the App, a single instance of SDK object can then be used to play back and measure all watched streams one after another.'''&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || YES || &amp;quot;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || NO || &amp;quot;Nielsen Sample App&amp;quot;&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;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || NO || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| hem_unknown ||  Hashed email using SHA512. This email is used by MMS reach model.&lt;br /&gt;
|| Client-defined || Required if login feature || &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| enableFpid || true/false value is required to set collection of first-party ID.&lt;br /&gt;
|| Nielsen-specified || NO || &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{enableFpid: &amp;quot;true&amp;quot;} //alternative: false&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;
1) AppSDK() is no longer a singleton object and should be created as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;) // only for debug builds&lt;br /&gt;
          .put(&amp;quot;hem_unknown&amp;quot;, &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;enableFpid&amp;quot;, &amp;quot;true&amp;quot;); // alternative is false; &lt;br /&gt;
&lt;br /&gt;
         // Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
         mAppSdk = new AppSdk(appContext, appSdkConfig, this);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e){&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;
2) implement IAppNotifier into your activity like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public class MainActivity extends AppCompatActivity implements IAppNotifier&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
3) implement callback&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;@Override&lt;br /&gt;
public void onAppSdkEvent(long timestamp, int code, String description){&lt;br /&gt;
  Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the whole Activity will look like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package com.example.josefvancura.nlsdemotmp;&lt;br /&gt;
&lt;br /&gt;
import android.content.Context;&lt;br /&gt;
import android.support.v7.app.AppCompatActivity;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
&lt;br /&gt;
import com.nielsen.app.sdk.*;&lt;br /&gt;
&lt;br /&gt;
import org.json.JSONException;&lt;br /&gt;
import org.json.JSONObject;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    private AppSdk mAppSdk = null;&lt;br /&gt;
    private String TAG = &amp;quot;MainActivity&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_main);&lt;br /&gt;
&lt;br /&gt;
        Context context = getApplicationContext();&lt;br /&gt;
&lt;br /&gt;
        try{&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;PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&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;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;) // only for debug builds&lt;br /&gt;
                    .put(&amp;quot;hem_unknown&amp;quot;, &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;enableFpid&amp;quot;, &amp;quot;true&amp;quot;); // alternative is false; &lt;br /&gt;
&lt;br /&gt;
            // Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
            mAppSdk = new AppSdk(context, appSdkConfig, this ); // Notifier - activity implements IAppNotifier, callback in onAppSdkEvent()&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        catch (JSONException e){&lt;br /&gt;
            Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onAppSdkEvent(long timestamp, int code, String description) {&lt;br /&gt;
        Log.d(TAG, &amp;quot;SDK callback onAppSdkEvent &amp;quot; + description);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
&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 &amp;quot;&amp;quot;Initial state&amp;quot;&amp;quot;.&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 processes playing information. API calls &amp;quot;play&amp;quot; and &amp;quot;loadMetadata&amp;quot; move the SDK instance into this state. In this state, the SDK instance will be able to process the API calls (see below)&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;
== Create Metadata Objects ==&lt;br /&gt;
The parameters passed must be either a JSON formatted string. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
&lt;br /&gt;
* JSON value must be a 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, 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.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create channelName Metadata ===&lt;br /&gt;
channelName 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;
| channelName	|| Any string representing the channel/stream	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Create Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip, including when ads play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of content metadata.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:'''  Program and title metadata values should be passed to SDK as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
==== Create Ad Metadata ====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of ad metadata.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&lt;br /&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;
=== MetaData Example ===&lt;br /&gt;
&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;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;uniqueassetid&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;content&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;episode title&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;length&amp;quot;, &amp;quot;2600&amp;quot;);&lt;br /&gt;
   //please see metadata link above for all content parameters&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
   .put(&amp;quot;assetid&amp;quot;, &amp;quot;uniquepostrolladid&amp;quot;)&lt;br /&gt;
   .put(&amp;quot;type&amp;quot;, &amp;quot;postroll&amp;quot;);&lt;br /&gt;
    //please see metadata link above for all ad parameters&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start the Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Overview of SDK API Calls ===&lt;br /&gt;
&lt;br /&gt;
==== play ====&lt;br /&gt;
The play method prepares the SDK for reporting once an asset has loaded and playback has begun. Use play to pass the channel descriptor information through channelName parameter when the user taps the &amp;quot;&amp;quot;Play&amp;quot;&amp;quot; button on the player. Call play only when initially starting the video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadMetadata ====&lt;br /&gt;
It needs to be called at the beginning of each asset and pass JSON object for relevant content or ad. Make sure to pass as 1st loadMetadata for content at the beginning of the playlist - see below API call sequence examples.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== playheadPosition ====&lt;br /&gt;
Pass playhead position every second during playback. for VOD: pass the current position in seconds. for Live: current Unix timestamp (seconds since Jan-1-1970 UTC) - if it is possible to seek back in Live content, then pass related Unix time (not current). Pass the whole number that increments only by 1 like 1,2,3..&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Java&amp;quot;&amp;gt;mAppSdk.setPlayheadPosition(long videoPositon);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== stop ====&lt;br /&gt;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* When a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see below chapter Interruption scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.stop();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== end ====&lt;br /&gt;
Call when the content asset completes playback.  Stops measurement progress.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;mAppSdk.end();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== API Call Sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Ads ====&lt;br /&gt;
Call [[play()]] at start of stream&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
  &amp;quot;assetid&amp;quot;: &amp;quot;vid345-67483&amp;quot;,&lt;br /&gt;
  &amp;quot;program&amp;quot;: &amp;quot;ProgramName&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;: &amp;quot;Program S3, EP1&amp;quot;,&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;
Call [[setPlayheadPosition()]] every one second until a pause.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.play(); &amp;lt;/code&amp;gt; || // Call at start of each new stream&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| Interruption || &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // call stop when content playback is interrupted&lt;br /&gt;
|-&lt;br /&gt;
| Resume Content || &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // continue pasing playhead position every second starting from position where content is resumed&lt;br /&gt;
|- &lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Ads ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
   &amp;quot;assetid&amp;quot;: &amp;quot;ad-123&amp;quot;&lt;br /&gt;
   ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until a pause / another [[loadMetadata()]] is called. Playhead should be passed for the entire duration of the ad pod if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.play(channelInfo); &amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content (End of stream) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start. When content has resumed following an ad break, playhead position must continue from where the previous content segment was left off.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states ==&lt;br /&gt;
There are a few approaches to managing the Foreground and Background states of an app available to use for state measurement.&lt;br /&gt;
&lt;br /&gt;
*Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
*Utilizing the SdkBgFgDetectionUtility class&lt;br /&gt;
*Adding a tag to the Manifest XML&lt;br /&gt;
*Manual Management&lt;br /&gt;
=== The LifeCycleObserver ===&lt;br /&gt;
AndroidX replaces the original support library APIs with packages in the androidx namespace, and Android Studio 3.2 and higher provide an automated migration tool. (Select '''Refactor&amp;gt; Migrate to AndroidX''' from the menu bar.)&lt;br /&gt;
&lt;br /&gt;
Starting with version 7.1.0, with AndroidX support, an additional utility is provided in the AppSDK - application background/foreground state detection by the AppSdk leveraging the Android Architecture component &amp;quot;LifeCycleObserver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The AppSdk is now capable of detecting the application UI visibility state transitions between background and foreground without forcing the applications to register for AppSdk's AppSdkApplication class, which is responsible for handling the detection of application background/foreground state transitions at present.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Please note that if you already have an app designed that utilizes the depreciated SdkBgFgDetectionUtility Class, the AppSDK will ignore any calls to these methods if it can utilize the LifeCycleObserver. LifeCycleObserver based auto-detection will take precedence.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Adding the AndroidX dependency ====&lt;br /&gt;
In order to make use of the app background/foreground state transition auto detection feature of AndroidX AppSdk, the app gradle file needs the androidx dependency. The AppSdk API calls - &amp;lt;code&amp;gt;appInForeground()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;appInBackground()&amp;lt;/code&amp;gt; will still be respected by AppSdk by executing the old AppSdk flow of handling &amp;quot;app in foreground&amp;quot; and &amp;quot;app in background&amp;quot; states as is.&lt;br /&gt;
&lt;br /&gt;
==== Using the LifeCycle Extension ====&lt;br /&gt;
The following androidx dependency is required in the app gradle file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If you would like to take advantage of this auto-detection feature of AppSdk at the very initial stage (e.g. splash screen or at of app launch time), before the AppSdk is initialized, you can do so by calling the following newly introduced AppSdk public API, passing the application context :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public static void registerLifeCycleObserver(Context applicationContext)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Log messages for the new auto detection ====&lt;br /&gt;
&lt;br /&gt;
*When the AppSdk app successfully registers for the LifeCycleObserver : &amp;lt;code&amp;gt;Registered LifeCycleObserver for App Background/Foreground auto-detection&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the app enters the foreground state :&amp;lt;code&amp;gt;App is in foreground, auto-detected by AppSDK&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the app enters the background state :&amp;lt;code&amp;gt;App is in background, auto-detected by AppSDK&amp;lt;/code&amp;gt;&lt;br /&gt;
*If the client app doesn't have the &amp;quot;androidx&amp;quot; gradle dependency and AppSdk fails to register LifeCycleObserver :&amp;lt;code&amp;gt;AndroidX LifecycleObserver can not be observed. Please use androidx dependency to activate SDK auto-detection of app background/foreground state.&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the appInForeground() is explicitly called while LifeCycleObserver auto detection is active :&amp;lt;code&amp;gt;Ignoring the appInBackground() call, as the App Background/Foreground auto-detection is active. The current state is - foreground&amp;lt;/code&amp;gt;&lt;br /&gt;
*When the appInBackground() is explicitly called while LifeCycleObserver auto detection is active :&amp;lt;code&amp;gt;Ignoring the appInBackground() call, as the App Background/Foreground auto-detection is active. The current state is - background&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The SdkBgFgDetectionUtility class ===&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement. It may be implemented in multiple ways for Android. This includes&lt;br /&gt;
&lt;br /&gt;
*Enable the Nielsen SDK to measure background/foreground state by making the relevant update to the AndroidManifest.&lt;br /&gt;
*Integrate Nielsen’s SdkBgFgDetectionUtility class within your Custom Application Class.&lt;br /&gt;
*Custom implementation of the required methods within your application.&lt;br /&gt;
&lt;br /&gt;
==== ForeGround/Background Measurement via AndroidManifest ====&lt;br /&gt;
The simplest way to measure the app background/foreground state is to add the following application tag to the Manifest XML. Integrating this into the Manifest XML will enable the SDK to measure app state directly. This approach is supported for Android 4.0 and up only; it requires that the application class is not in use for some other purpose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using the Android SdkBgFbDetectionUtility Class ====&lt;br /&gt;
For developers who are already using the application class, it is recommended that the background/foreground state is implemented using the [[Android Background Foreground|SdkBgFgDetectionUtility class.]] The [[Android Background Foreground|SdkBgFgDetectionUtility class.]] is compatible with Android 4+ and has been made available to Nielsen clients. (You will need to copy/paste the code provided into a file).&lt;br /&gt;
&lt;br /&gt;
==== Manual Background/ForeGround State Management ====&lt;br /&gt;
In cases where the developer is not able to use the AndroidManifest.xml solution nor the Nielsen provided [[Android Background Foreground|SdkBgFgDetectionUtility class.]], the developer will need to manually identify the change of state through the application and call the respective API (appInForeground() or appInBackground()) to inform the SDK regarding the change of state from background to foreground or foreground to background.&lt;br /&gt;
&lt;br /&gt;
The SDK is informed about app state using the below methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;AppLaunchMeasurementManager.appInForeground(getApplicationContext());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;AppLaunchMeasurementManager.appInBackground(getApplicationContext());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to provide an indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct foreground/background state measurement is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stop/Resume the Measurement for video Playback Interruptions ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; immediately (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Once the playback resumes, start sending pings &amp;lt;code&amp;gt;playheadPosition&amp;lt;/code&amp;gt; for the new viewing session.&lt;br /&gt;
Please see the [[Digital Measurement FAQ]] for more details&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-v1.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-ad-v1.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are currently three flavors of the Nielsen SDK:&lt;br /&gt;
# '''[[#Global_Android_SDK_Opt-out|Global Android SDK Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device.&lt;br /&gt;
# '''[[#Global_Android_SDK_No_Ad_Framework_Opt-out|Global Android SDK No Ad Framework Opt-out]]''' - Direct call to SDK. It can be used without Google Play Services or when using the No Ad version of the SDK.&lt;br /&gt;
# '''[[#Global_Android_SDK_No_ID_Opt-out|Global Android SDK No ID Opt-out]]''' - Direct call to SDK. It should be used for Kids Category.&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android when the [https://developers.google.com/android/guides/setup Google Play services APIs] have been setup in your project.&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 '''Opt out of Ads Personalization''' setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
==== Webview Element ====&lt;br /&gt;
It is a requirement to display a WebView element whose loadUrl is set to the value obtained from optOutURL.&lt;br /&gt;
If using the Global Android SDK, this optOutURL informs the user how to deactivate/activate “Out of Ads Personalization”.&lt;br /&gt;
&lt;br /&gt;
==== Retrieve current Opt-Out preference ====&lt;br /&gt;
Whether the user is opted out via OS-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. &amp;lt;code&amp;gt;appSdk.getOptOutStatus()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span id=&amp;quot;Global OptOut Example&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Global OptOut Example ===&lt;br /&gt;
The below code is an AndroidX example of displaying the Nielsen Privacy page to the user.  Please see the next section if using the No Ad Framework build&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;
        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;
        String url = appSdk.userOptOutURLString();   // Request Optout URL from NielsenSDK&lt;br /&gt;
        webView.loadUrl(url);                         //Display to the user in a Webview&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onBackPressed() {&lt;br /&gt;
        super.onBackPressed();&lt;br /&gt;
        mSdkInterface.getSDK(appSdk);&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onDestroy() {&lt;br /&gt;
        super.onDestroy();&lt;br /&gt;
        if (appSdk != null)&lt;br /&gt;
        {&lt;br /&gt;
            appSdk.close();&lt;br /&gt;
            appSdk = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK No Ad Framework Opt-out ===&lt;br /&gt;
The ''No Ad Framework Opt-out'' can be used when the host application does not leverage Google Play Services, such as when using the No Ad or No ID versions.&lt;br /&gt;
&lt;br /&gt;
==== The No Ad Framework 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 closes 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;
===&amp;lt;span id=&amp;quot;No Ad Framework Optout Sample Code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;No Ad Framework Optout Sample Code ===&lt;br /&gt;
The below code is an AndroidX example of displaying the Nielsen Privacy page to the user with the No Ad Framework SDK Build.&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;
        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;
            @Override&lt;br /&gt;
            public boolean shouldOverrideUrlLoading(WebView view, String url) {&lt;br /&gt;
&lt;br /&gt;
                if(url.contains(&amp;quot;nielsen&amp;quot;)){&lt;br /&gt;
                    // If url value = &amp;quot;nielsenappsdk://1&amp;quot; it means the user selected Opt-out&lt;br /&gt;
                    // If url value = &amp;quot;nielsenappsdk://0&amp;quot; it means the user selected Opt-in&lt;br /&gt;
                    appSdk.userOptOut(url);&lt;br /&gt;
                }&lt;br /&gt;
                return true;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
        });&lt;br /&gt;
        String url = appSdk.userOptOutURLString();   // Request Optout URL from NielsenSDK&lt;br /&gt;
        webView.loadUrl(url);                         //Display to the user in a Webview&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onBackPressed() {&lt;br /&gt;
        super.onBackPressed();&lt;br /&gt;
        mSdkInterface.getSDK(appSdk);&lt;br /&gt;
    }&lt;br /&gt;
    @Override&lt;br /&gt;
    protected void onDestroy() {&lt;br /&gt;
        super.onDestroy();&lt;br /&gt;
        if (appSdk != null)&lt;br /&gt;
        {&lt;br /&gt;
            appSdk.close();&lt;br /&gt;
            appSdk = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global Android SDK No ID Opt-out ===&lt;br /&gt;
If you are building an app that will be listed in the Kids Category:&lt;br /&gt;
#  Ensure that you are using the No ID version of the Nielsen SDK Framework.&lt;br /&gt;
#  Immediately following the initialization of the Nielsen SDK ensure you call the userOptOut API with Opt-out selection: &lt;br /&gt;
&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;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page or have the similar text available within the native app. Include the &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 https://www.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=sv for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== First Party ID (FPID)===&lt;br /&gt;
- The broadcaster must enableFPID in the initialization settings which is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; depending on user consent. This is to be set by the broadcaster when initializing our SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The &amp;lt;code&amp;gt;enableFpid&amp;lt;/code&amp;gt; flag is needed to enable/disable FPID usage for the AppID. The default value for this flag is true. If this flag is changed from true to false, then the AppSDK should wipe out the stored FPID and use a blank value for FPID parameter in all the pings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Generated FPID value is stored in the persistent memory until the application is uninstalled from a device, when FPID is wiped out, or when it is expired.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- The default value for this parameter is 180 days. Once this timeout is reached, the FPID should be regenerated.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Optional Step for DCR Chromecast Android SDK ==&lt;br /&gt;
For the implementation of Chromecast SDK architecture. Please refer to this guide: [https://engineeringportal.nielsen.com/docs/DCR_Chromecast_Android_SDK DCR Chromecast Android SDK]&lt;br /&gt;
&lt;br /&gt;
== Test your player by yourself ==&lt;br /&gt;
=== Guide ===&lt;br /&gt;
1. Connect your PC and test device (tablet or phone) via the same router.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. PC side: run Proxy sw (like Charles) and get local IP&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Test device: modify Wifi setting to pass through Proxy IP from step 2.&amp;lt;br /&amp;gt;&lt;br /&gt;
4. Test device: run your player, launch video&amp;lt;br /&amp;gt;&lt;br /&gt;
5. PC side: filter traffic by &amp;quot;imr&amp;quot; and confirm the presence of GN pings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of GN ping ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://secure-sw.imrworldwide.com/cgi-bin/gn?prd=dcr&amp;amp;ci=se-910684&amp;amp;ch=se-910684_c01_P&amp;amp;asn=defChnAsset&amp;amp;fp_id=096ohdsc0jqkmct81qpxhmn19qx041630053963&amp;amp;fp_cr_tm=1630053963&amp;amp;fp_acc_tm=1630053963&amp;amp;fp_emm_tm=1630053963&amp;amp;ve_id=afc5d61a88b62672&amp;amp;sessionId=zc6gh3uhka7d2mtobb2b2m7sixygy1630053963&amp;amp;tl=Djuren%20p%C3%A5%20Djuris&amp;amp;prv=1&amp;amp;c6=vc,c01&amp;amp;ca=se-910684_c01_218531&amp;amp;cg=Hemligheter&amp;amp;c13=asid,T1194003B-797F-4896-A5C0-05914236146E&amp;amp;c32=segA,NA&amp;amp;c33=segB,NA&amp;amp;c34=segC,NA&amp;amp;c15=apn,&amp;amp;plugv=4.4.1&amp;amp;playerv=ExoPlayer&amp;amp;sup=1&amp;amp;segment2=&amp;amp;segment1=&amp;amp;forward=0&amp;amp;ad=1&amp;amp;cr=4_00_99_D1_10000&amp;amp;c9=devid,c041ec5e50722cdf8cc5b4826c24ae54c5747a6570e900006c826b37ca01ce17&amp;amp;enc=true&amp;amp;c1=nuid,c041ec5e50722cdf8cc5b4826c24ae54c5747a6570e900006c826b37ca01ce17&amp;amp;at=timer&amp;amp;rt=video&amp;amp;c16=sdkv,aa.8.1.0&amp;amp;c27=cln,34&amp;amp;crs=0&amp;amp;lat=&amp;amp;lon=&amp;amp;c29=plid,16300539624283525&amp;amp;c30=bldv,aa.8.1.0.0_gaxnons&amp;amp;st=dcr&amp;amp;c7=osgrp,&amp;amp;c8=devgrp,&amp;amp;c10=plt,&amp;amp;c40=adbid,&amp;amp;c14=osver,ANDROID.11&amp;amp;c26=dmap,1&amp;amp;dd=&amp;amp;hrd=&amp;amp;wkd=&amp;amp;c35=adrsid,&amp;amp;c36=cref1,&amp;amp;c37=cref2,&amp;amp;c11=agg,1&amp;amp;c12=apv,4.4.1.4004001&amp;amp;c51=adl,0&amp;amp;c52=noad,0&amp;amp;sd=578&amp;amp;pc=NA&amp;amp;c53=fef,n&amp;amp;c54=oad,&amp;amp;c55=cref3,&amp;amp;c57=adldf,2&amp;amp;ai=218531&amp;amp;c3=st,c&amp;amp;c64=starttm,1630053962&amp;amp;adid=218531&amp;amp;c58=isLive,false&amp;amp;c59=sesid,257f8bz854wmqa31gk3icyi7cmj131630053964&amp;amp;c61=createtm,1630053997&amp;amp;c63=pipMode,&amp;amp;ci_userid=&amp;amp;is_auto_play=no&amp;amp;pl_title=&amp;amp;is_prem=no&amp;amp;is_prog=&amp;amp;ad_origin=&amp;amp;adidx=&amp;amp;is_tpad=&amp;amp;ci_passthr=&amp;amp;c62=sendTime,1630053997&amp;amp;c68=bndlid,air.se.urplay.android_player.debug&amp;amp;nodeTM=&amp;amp;logTM=&amp;amp;c73=phtype,&amp;amp;c74=dvcnm,&amp;amp;c76=adbsnid,&amp;amp;c77=adsuprt,2&amp;amp;uoo=&amp;amp;evdata=PL%3A1630053964727%3A0&amp;amp;c71=ottflg,0&amp;amp;c72=otttyp,&amp;amp;c44=progen,&amp;amp;davty=1&amp;amp;si=&amp;amp;c66=mediaurl,&amp;amp;sdd=retry,0~~retryreason,~~devmodel,SM-G981B~~devtypid,samsung-SM-G981B~~sysname,Android~~sysversion,11~~manuf,samsung&amp;amp;cat_id=3398d8e4-e613-42c1-92aa-1a6fc52dcf5c&amp;amp;vtoff=0&amp;amp;rnd=1630053997971&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 9 :  Provide your app for certification ==&lt;br /&gt;
Once ready please send your application to Nielsen local staff for certification.&lt;br /&gt;
&lt;br /&gt;
== Step 10 :  Going Live ==&lt;br /&gt;
After the integration has been certified by Nielsen (but not prior to that), do the following:&lt;br /&gt;
&lt;br /&gt;
# '''Disable 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;
# '''Notify Nielsen''': Once you are ready to go live, let us know so we can enable you for reporting. We will not be able to collect or report data prior to receiving notification from you.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6110</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6110"/>
		<updated>2023-02-03T11:44:43Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Create Session ID */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that the Cloud API Product is not yet rolled out in Germany!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    var timestamp_ms = new Date().getTime();&lt;br /&gt;
    uid += String(timestamp_ms).substring(3);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for DK [https://nielsenonlinesupport.com/dk/cloudapi/index.htm?debug=true RefImplCloudAPIDK].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Cloud_API&amp;diff=6107</id>
		<title>DCR Sweden Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Sweden_Video_Cloud_API&amp;diff=6107"/>
		<updated>2023-01-31T08:35:54Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Configure Payload: devInfo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International DCR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &lt;br /&gt;
** '''Note: P prefix must be removed before adding it to the URL'''&lt;br /&gt;
** Example App ID with P prefix: &amp;quot;PDF20695-XXXX-XXXX-XXXX-3E334133D917&amp;quot;&lt;br /&gt;
** &amp;lt;code&amp;gt;https://sc-eucert.imrworldwide.com/nmapi/v2/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://capi-sw.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that our Endpoints use TLS 1.2 and above, older devices using TLS 1.0 OR 1.1 is not compatible with the endpoints above. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.imrworldwide.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    uid += Math.floor(new Date().getTime() / 1000);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.imrworldwide.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create First Party ID===&lt;br /&gt;
* An First Party ID  &amp;lt;code&amp;gt;[fpid]&amp;lt;/code&amp;gt; must be created and stored on the device. It is re-used until the expiration date or if the user has deleted it from the device storage.&lt;br /&gt;
The default expiration date should be set to the equivalent of 180 days. &lt;br /&gt;
* Additionally the Creation Time &amp;lt;code&amp;gt;[fpcrtm]&amp;lt;/code&amp;gt; of the First Party ID should be stored as well. The same value should be used as long as the First Party ID is available on the device. This Unix timestamp is in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.imrworldwide.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
'''Payload Example'''&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
    &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
        &amp;quot;devId&amp;quot;: &amp;quot;AD-ID&amp;quot;, &lt;br /&gt;
        &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
        &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
        &amp;quot;uoo&amp;quot;: &amp;quot;false&amp;quot;,&lt;br /&gt;
        &amp;quot;fpid&amp;quot;: &amp;quot;First Party ID&amp;quot;,&lt;br /&gt;
        &amp;quot;fpcrtm&amp;quot;: &amp;quot;Creation Time (UTC) of the First Party ID (Unix Timestamp in milliseconds)&amp;quot;&lt;br /&gt;
        &amp;quot;hem_unknown&amp;quot; : &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &lt;br /&gt;
    // 3.2 Configure Payload: metadata&lt;br /&gt;
    &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
        &amp;quot;content&amp;quot;: { // object for measuring video content&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, // &amp;quot;content&amp;quot; for video&lt;br /&gt;
            &amp;quot;assetid&amp;quot;: &amp;quot;uniqueassetid_simulcast&amp;quot;, // unique ID for video&lt;br /&gt;
            &amp;quot;userid&amp;quot;: &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa…&amp;quot;, // SHA512 hashed userid&lt;br /&gt;
            &amp;quot;clientpassparam&amp;quot;: &amp;quot;origcode=29&amp;quot;, // Custom parameters passed&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;Program Name leif-och-billy&amp;quot;, // program name&lt;br /&gt;
            &amp;quot;title&amp;quot;: &amp;quot;Episode Title S3 - EP1 en-ny-tjej-i-byn&amp;quot;, // episode name&lt;br /&gt;
            &amp;quot;length&amp;quot;: &amp;quot;3359&amp;quot;, // content duration in seconds&lt;br /&gt;
            &amp;quot;playlisttitle&amp;quot;: &amp;quot;barn&amp;quot;, //playlist title&lt;br /&gt;
            &amp;quot;ispremiumcontent&amp;quot;: &amp;quot;yes&amp;quot;, //identify premium level content&lt;br /&gt;
            &amp;quot;isautoplay&amp;quot;: &amp;quot;yes&amp;quot;, //identify if autoplay is enabled&lt;br /&gt;
            &amp;quot;plugv&amp;quot;: &amp;quot;1.0.1&amp;quot;, //player version&lt;br /&gt;
            &amp;quot;playerv&amp;quot;: &amp;quot;Sonic&amp;quot; // player identifier&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;ad&amp;quot;: {&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;, // type of ad&lt;br /&gt;
            &amp;quot;assetid&amp;quot;: &amp;quot;E1UMBR1001&amp;quot;, // unique ID for ad&lt;br /&gt;
            &amp;quot;length&amp;quot;: &amp;quot;30&amp;quot;, // ad duration in seconds&lt;br /&gt;
            &amp;quot;isprogrammatic&amp;quot;: &amp;quot;yes&amp;quot;,//identify if the ad is bought prommatic&lt;br /&gt;
            &amp;quot;isthirdpartyad&amp;quot;: &amp;quot;yes&amp;quot;,//identify if the ad is from third party ad server&lt;br /&gt;
            &amp;quot;adplatformorigin&amp;quot;: &amp;quot;YuMe&amp;quot;,//identity of ad origin &lt;br /&gt;
            &amp;quot;adidx&amp;quot;: &amp;quot;1/5&amp;quot; //placement in ad break&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    &lt;br /&gt;
    // 3.3 Configure Payload: events&lt;br /&gt;
    &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
    &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
    &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot; //unix timestamp in milliseconds &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Configure Payload: devInfo=====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| devId || unique Device ID of a user device (e.g. SHA-256 hashed value of i.e. Advertising ID, Roku Device ID). Please verify your implemented  SHA-256 by passing &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot; which should return &amp;quot;12b9377cbe7e5c94e8a70d9d23929523d14afa954793130f8a3959c7b849aca8&amp;quot;  || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| uoo || device opt-out status || &amp;lt;code&amp;gt;&amp;quot;true&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;false&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| hem_unknown || Hashed email using SHA512. This email is used by MMS reach model. (required if login feature) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| fpid || First Party ID || custom || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| fpcrtm || Creation Time (UTC) of the First Party ID (Unix Timestamp in milliseconds) || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;AD-ID&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
  &amp;quot;uoo&amp;quot;: &amp;quot;false&amp;quot;,&lt;br /&gt;
  &amp;quot;fpid&amp;quot;: &amp;quot;First Party ID&amp;quot;,&lt;br /&gt;
  &amp;quot;fpcrtm&amp;quot;: &amp;quot;Creation Time (UTC) of the First Party ID (Unix Timestamp in milliseconds)&amp;quot;&lt;br /&gt;
  &amp;quot;hem_unknown&amp;quot; : &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot; //SHA512 hashed value&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
===== Create Content Metadata =====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of content and ad metadata.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Note:''' program and title metadata values should be passed as UTF-8 strings.&lt;br /&gt;
&lt;br /&gt;
===== Example Content Object =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&lt;br /&gt;
 &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
  &amp;quot;assetid&amp;quot;: &amp;quot;uniqueassetid&amp;quot;,&lt;br /&gt;
  &amp;quot;length&amp;quot;:  &amp;quot;2600&amp;quot;,&lt;br /&gt;
  &amp;quot;program&amp;quot;: &amp;quot;program name&amp;quot;,&lt;br /&gt;
  &amp;quot;title&amp;quot;:   &amp;quot;episode title&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Create Ad Metadata =====&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please see the [[Sweden_SDK_Metadata|Metadata link]] for the full list of content and ad metadata.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&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;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
  &amp;quot;assetid&amp;quot;: &amp;quot;unique_preroll_ad_id&amp;quot;&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;
=== Configure Payload: Events ===&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
==== Event Types ====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when full playback of the content has completed . Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot; //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID created using a UUID Generator&lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.imrworldwide.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;AD-ID&amp;quot;, &lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
   &amp;quot;uoo&amp;quot;: &amp;quot;false&amp;quot;,&lt;br /&gt;
   &amp;quot;fpid&amp;quot;: &amp;quot;U4EDwDcpvWIbguYVyjlhzS1v0eaov1631180980&amp;quot;,&lt;br /&gt;
   &amp;quot;fpcrtm&amp;quot;: &amp;quot;1631098029000&amp;quot;&lt;br /&gt;
   &amp;quot;hem_unknown&amp;quot; : &amp;quot;924899b875ea6767ab790bd2f4852345fcfec5d203c49be8e8...&amp;quot; //SHA512 hashed value&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, // &amp;quot;content&amp;quot; for video&lt;br /&gt;
            &amp;quot;assetid&amp;quot;: &amp;quot;uniqueassetid_simulcast&amp;quot;, // unique ID for video&lt;br /&gt;
            &amp;quot;userid&amp;quot;: &amp;quot;fbd1a7a7d672a5fcf5cf5c55d8d9d0abbe3a4e0fa…&amp;quot;, // SHA512 hashed userid&lt;br /&gt;
            &amp;quot;clientpassparam&amp;quot;: &amp;quot;origcode=29&amp;quot;, // Custom parameters passed&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;Program Name leif-och-billy&amp;quot;, // program name&lt;br /&gt;
            &amp;quot;title&amp;quot;: &amp;quot;Episode Title S3 - EP1 en-ny-tjej-i-byn&amp;quot;, // episode name&lt;br /&gt;
            &amp;quot;length&amp;quot;: &amp;quot;3359&amp;quot;, // content duration in seconds&lt;br /&gt;
            &amp;quot;playlisttitle&amp;quot;: &amp;quot;barn&amp;quot;, //playlist title&lt;br /&gt;
            &amp;quot;ispremiumcontent&amp;quot;: &amp;quot;yes&amp;quot;, //identify premium level content&lt;br /&gt;
            &amp;quot;isautoplay&amp;quot;: &amp;quot;yes&amp;quot;, //identify if autoplay is enabled&lt;br /&gt;
            &amp;quot;plugv&amp;quot;: &amp;quot;1.0.1&amp;quot;, //player version&lt;br /&gt;
            &amp;quot;playerv&amp;quot;: &amp;quot;Sonic&amp;quot; // player identifier&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;, // type of ad&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;AD-ID123&amp;quot;, // unique ID for ad&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3359&amp;quot;, // ad duration in seconds&lt;br /&gt;
      &amp;quot;isprogrammatic&amp;quot;: &amp;quot;yes&amp;quot;,//identify if the ad is bought prommatic&lt;br /&gt;
      &amp;quot;isthirdpartyad&amp;quot;: &amp;quot;yes&amp;quot;,//identify if the ad is from third party ad server&lt;br /&gt;
      &amp;quot;adplatformorigin&amp;quot;: &amp;quot;YuMe&amp;quot;,//identity of ad origin &lt;br /&gt;
      &amp;quot;adidx&amp;quot;: &amp;quot;1/5&amp;quot; //placement in ad break&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot; //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Enable Debug Logging ====&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Opt-Out ==&lt;br /&gt;
Your app must provide a means for the user to Opt-Out, or Opt-In to Nielsen Measurement. This requirement can be fulfilled by checking the device OS for the user's setting of &amp;quot;Limit Ad Tracking&amp;quot; or similar option. If the device offers &amp;quot;Limit Ad Tracking&amp;quot; settings, you should set &amp;lt;code&amp;gt;uoo=true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;uoo=false&amp;lt;/code&amp;gt; depending on the user's privacy setting. Also, ensure that the &amp;lt;code&amp;gt;devId&amp;lt;/code&amp;gt; is set to a blank value if the user elects to opt-out.&lt;br /&gt;
&lt;br /&gt;
If the device does not have OS-level &amp;quot;Do Not Track&amp;quot; settings, you can implement opt-out by creating an Opt-Out/Opt-In button, toggle switch, or slider within the app &amp;quot;Settings&amp;quot;, or &amp;quot;About&amp;quot; section to allow the user selection.&lt;br /&gt;
&lt;br /&gt;
[[File:Nielsen Opt-Out.png|link=]]&lt;br /&gt;
&lt;br /&gt;
You will need to store the User Opt-Out (uoo) status, so that it can be retrieved and populated in the &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; metadata which will be sent in every Cloud API event (playhead, complete, &amp;amp; delete). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! uoo Key !! Description !! Values&lt;br /&gt;
|-&lt;br /&gt;
| uoo || Device is Opted-In to Nielsen Measurement (Recommended Default Setting) || &amp;lt;code&amp;gt;&amp;quot;false&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| uoo || Device is Opted-Out of Nielsen Measurement || &amp;lt;code&amp;gt;&amp;quot;true&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== devInfo Opt-In JSON Payload Example =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
    &amp;quot;apn&amp;quot;: &amp;quot;Cloud API Sample App&amp;quot;,&lt;br /&gt;
    &amp;quot;apv&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt;
    &amp;quot;devId&amp;quot;: &amp;quot;7be25cf9-8c40-5cc2-871e-19bf41940288&amp;quot;,&lt;br /&gt;
    &amp;quot;uoo&amp;quot;: &amp;quot;false&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== devInfo Opt-Out JSON Payload Example =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
    &amp;quot;apn&amp;quot;: &amp;quot;Cloud API Sample App&amp;quot;,&lt;br /&gt;
    &amp;quot;apv&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt;
    &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;, //devId must be blank when a user elects to Opt-Out.&lt;br /&gt;
    &amp;quot;uoo&amp;quot;: &amp;quot;true&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Privacy Information Template To Include In Opt-Out Screen =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, all applications must display the Nielsen privacy policy within their application, typically in the Settings/About screen of your application. The Nielsen privacy policy text is listed below in English and Swedish.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;ENGLISH&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''''ABOUT NIELSEN MEASUREMENT'''''&lt;br /&gt;
&lt;br /&gt;
Television and the way we watch it have come a long way since Nielsen began measuring TV audiences in 1950. Today, the ability to watch our favorite shows at any time and on multiple devices amplifies the need for exceptionally adept and flexible audience measurement capabilities.&lt;br /&gt;
&lt;br /&gt;
Consumers are changing with the times, and the same goes for us. As technology continues to evolve and media companies try new ways to attract viewers, understanding what consumers are watching — and what they're watching on — is more important than ever. Today, viewing video is a personal and mobile experience — anytime and anywhere. Our capabilities provide relevant metrics that are necessary to inform successful marketing and programming and drive continued growth. As a global information and measurement leader, we are committed to protecting the privacy and security of the data we collect, process, and use. While our digital measurement products are not used to identify you in any way, they help us and our client's measure and analyze how consumers engage with media across online, mobile, and emerging technologies, and offer insights into consumer behavior.&lt;br /&gt;
&lt;br /&gt;
'''''YOUR CHOICES'''''&lt;br /&gt;
&lt;br /&gt;
Nielsen believes that you should have a choice about whether to contribute to our research and insights. To opt-out or opt into Nielsen measurement, please toggle your &amp;quot;Limit Ad Tracking&amp;quot; (or similar setting) on your device, or make the appropriate selection within the application's settings. If you have this app on more than one device, you will need to opt-out of this app on each device. To learn more about our digital measurement products and your choices in regard to them, please visit https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=en-se &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;SWEDISH&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''''OM NIELSEN-MÄTNINGEN'''''&lt;br /&gt;
&lt;br /&gt;
Television och våra tittarvanor har utvecklats mycket sedan Nielsen började mäta tv-publiken på 1950-talet. Dagens möjlighet att titta på program när som helst och på flera olika enheter ökar behovet av exceptionellt kompetenta och flexibla produkter för publikmätning.&lt;br /&gt;
&lt;br /&gt;
Konsumenterna ändras med tiden och likaså Nielsen. I takt med att tekniken fortsätter att utvecklas och medieföretagen försöker hitta nya sätt att tilltala tittare, är det viktigare än någonsin att förstå vad konsumenterna tittar på och med vilken typ av enhet. I dag är det en personlig och obunden upplevelse att se på en video – du kan se när som helst och var som helst. Våra produkter ger relevanta mätvärden som är nödvändiga för att informera om framgångsrik marknadsföring och programmering samt för att gynna en fortsatt tillväxt.&lt;br /&gt;
&lt;br /&gt;
Som global ledare inom information och mätning strävar vi efter att skydda integriteten och säkerheten för de personuppgifter som vi samlar in, behandlar och använder..Även om våra digitala mätningsprodukter inte används för att identifiera dig på något sätt, hjälper de oss och våra klienter att mäta och analysera konsumenters medievanor online, på mobila enheter och via annan ny teknik som kan komma att utvecklas.&lt;br /&gt;
&lt;br /&gt;
'''''DINA VAL'''''&lt;br /&gt;
&lt;br /&gt;
Nielsen anser att du alltid ska ha ett val kring huruvida du vill bidra till vår forskning och insikter. För att avböja till Nielsens mätningar på en specifik enhet behöver du därför endast avaktivera/aktivera mätningen genom ”App Tracking/Limit Ad Tracking” (för iOS-enheter) eller ”Opt out of Ads Personalization” (för Android-enheter) som finns i din enhets inställningar. Om du har applikationer på flera mobila enheter måste du ändra inställningarna på varje enhet.&lt;br /&gt;
&lt;br /&gt;
Om du ändrar dig efter att du har avböjt och vill medverka på nytt, kan du aktivera/avaktivera mätningen genom &amp;quot;App Tracking/ Limit Ad Tracking” (för iOS-enheter) eller &amp;quot;Opt out of Ads Personalization” (för Android-enheter) i enhetens inställningar.&lt;br /&gt;
&lt;br /&gt;
Mer information om våra digitala mätprodukter och programvara samt om dina val när det gäller dessa finns på vår sida https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=sv &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''''Disclosure Template'''''&lt;br /&gt;
&lt;br /&gt;
Additionally, you must update the App description information from the App Distribution Store with the Nielsen Measurement disclosure below:&lt;br /&gt;
&lt;br /&gt;
This app features Nielsen's proprietary measurement software which will allow you to contribute to market research, like Nielsen's TV Ratings. Please see https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=sv for more information.&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with preroll and post-roll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for Sweden [http://nielsenonlinesupport.com/michel/sdkRefImplCloudDK/index.htm RefImplCloudAPISE].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
In order to disclose the Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third-party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=en-se&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
==== Opt-Out ====&lt;br /&gt;
*Test the &amp;quot;uoo&amp;quot; key gets populated accurately for both Opt-In and Opt-Out selections by validating the Cloud API events called after the user Opt-Out/Opt-In selection.&lt;br /&gt;
*Test that the devId field is populated with a blank value if a user has elected to Opt-Out. For example: &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
*If the device supports &amp;quot;Limit Ad Tracking&amp;quot; or has device &amp;quot;Opt-Out&amp;quot; settings, test that uoo=true, and that devId is set to a blank value if enabled in the device settings.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change the Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://capi-sw.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://capi-sw.imrworldwide.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6103</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6103"/>
		<updated>2023-01-27T10:32:28Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Ad metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that the Cloud API Product is not yet rolled out in Germany!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    uid += Math.floor(new Date().getTime() / 1000);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for DK [https://nielsenonlinesupport.com/dk/cloudapi/index.htm?debug=true RefImplCloudAPIDK].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6102</id>
		<title>DCR Germany Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6102"/>
		<updated>2023-01-27T10:24:59Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Ad metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 browser 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) - e.g. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&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;
&lt;br /&gt;
/* NLSQUEUE build v*/&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&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 files 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(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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. Users 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;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Example Content metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  '88675545',&lt;br /&gt;
  program:  'Program Name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '3600',&lt;br /&gt;
  nol_c0:  'p0,1',&lt;br /&gt;
  nol_c2:  'p2,Y',&lt;br /&gt;
  nol_c7:  'p7,videoid123',&lt;br /&gt;
  nol_c8:  'p8,3600',&lt;br /&gt;
  nol_c9:  'p9,VideoTitle123',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c12: 'p12,content',&lt;br /&gt;
  nol_c18: 'p18,N'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &lt;br /&gt;
==== Ad Metadata ====&lt;br /&gt;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Ad metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var ad_metadata_object = {  &lt;br /&gt;
  type:     'preroll',&lt;br /&gt;
  assetid:  'ad345-67483',&lt;br /&gt;
  title:    'ad_title',&lt;br /&gt;
  length:   '25',&lt;br /&gt;
  nol_c8:  'p8,25',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c11: 'p11,2352723141',&lt;br /&gt;
  nol_c12: 'p12,Ad',&lt;br /&gt;
  nol_c17: 'p17,preroll'&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;
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;
== Livestream ==&lt;br /&gt;
For '''Livestreams'''  please make sure playheadPosition is in UNIX-Timestamp for Content.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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 parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6101</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6101"/>
		<updated>2023-01-27T10:23:16Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Ad metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Ad' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'other' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Ad&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6100</id>
		<title>AGF Metadata Convention</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=AGF_Metadata_Convention&amp;diff=6100"/>
		<updated>2023-01-27T08:43:32Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Static Measurement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= AGF Metadata Convention =&lt;br /&gt;
&lt;br /&gt;
The  Metadata can pass through key values using the Nielsen reserved keys. The keys and values are listed by the product below. &lt;br /&gt;
&lt;br /&gt;
'''Note:''' All metadata values should be passed as UTF-8 strings.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static Measurement ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required (Obligatory) !! AGF Convention	!! Example data - RTL&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; || ✓ || hardcoded string required by Nielsen  || &amp;lt;code&amp;gt;&amp;quot;static&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to each article/page; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]]) || ✓ || Content Article ID. If it is not an article page and therefore no ID is available, the page path is used. || &amp;quot;999452&amp;quot;&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)	|| custom	|| ✓ || Section of Website or App || &amp;quot;/rtl_portal/news&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segA 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || AGOF code or comparable unit code || &amp;quot;dbrsowf_rtlnews&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| segB 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom || ✓ || Value to define content view count vs. 'Werbetraeger' view count. For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger': &amp;quot;WPI_timestamp&amp;quot; (Timestamp in whole seconds, not milliseconds)	|| For Content: &amp;quot;CPI&amp;quot; . For 'Werbetraeger' after user interaction with the site and newly loaded Content:  &amp;quot;WPI_1657634473&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| segC 	||  custom segment for reporting: unique values across custom segments (segA + segB + segC)	|| custom ||  || Program name || &amp;quot;IBES&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subbrand 	||  vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen || ✓ || Same as video measurement, provided by Nielsen || &amp;quot;c01&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Video Measurement ==&lt;br /&gt;
&lt;br /&gt;
Please refer to this AGF PDF Document: '''[https://nielsendownloads.digitalengsdk.com/digital/220907_AGF+Custom+Variables+and+Metadata+DCR+SDK++v1.8_english.pdf Metadata Document for Video]'''&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6099</id>
		<title>DCR Germany Video Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Cloud_API&amp;diff=6099"/>
		<updated>2023-01-25T16:10:18Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= DCR Integration Utilizing Cloud API =&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR), and fuel other measurement products on your over-the-top (OTT) Apps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
PLease note that the Cloud API Product is not yet rolled out in Germany!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
To get started, you will need a Nielsen App ID. The App ID is a unique ID assigned to your app. This will be provided to you by your assigned Technical Account Manager upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
We will cover the steps for constructing the Cloud API Calls.&lt;br /&gt;
&lt;br /&gt;
====URL Structure====&lt;br /&gt;
&lt;br /&gt;
The Cloud API Calls are HTTP GET Requests with the URL structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;[endpoint]/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The URL includes the following components:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;[endpoint]&amp;lt;/code&amp;gt;: location of data collection environment&lt;br /&gt;
*&amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt;: provided App ID. &amp;lt;br&amp;gt;'''Note:'''The &amp;quot;P&amp;quot; prefix must be removed from the App ID received before adding it to the URL, i.e. if you received PDF20695-XXXX-XXXX-XXXX-3E334133D917 from Nielsen , your url will then be : &amp;lt;code&amp;gt;[endpoint]/DF20695-XXXX-XXXX-XXXX-3E334133D917/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;: unique value for each user session&lt;br /&gt;
*&amp;lt;code&amp;gt;[payload]&amp;lt;/code&amp;gt;: metadata and events&lt;br /&gt;
&lt;br /&gt;
====Endpoint====&lt;br /&gt;
&lt;br /&gt;
There are endpoints for testing and production:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During testing, all calls should be pointed to the testing endpoint. We will review the update to the production endpoint during the Go Live section of this guide.&lt;br /&gt;
&lt;br /&gt;
====URL Example====&lt;br /&gt;
As you move through the integration steps, you can reference the below URL structure with the expanded payload:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content_metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event],&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playhead_position],&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type],&lt;br /&gt;
  &amp;quot;utc&amp;quot;: [Unix time in ms],&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: [unique view session ID for each video play]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID and send EMM Ping===&lt;br /&gt;
&lt;br /&gt;
====Create Session ID====&lt;br /&gt;
&lt;br /&gt;
A unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; must be created upon app launch and provided in the URL. This will allow the measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use our generation method example provided below to create unique alpha-numerical 29 characters + 10 characters UTC timestamp, to guarantee there are no repeats, also see [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference and use.&lt;br /&gt;
&lt;br /&gt;
Session ID example: '''LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
'''// Create random GUID'''&lt;br /&gt;
function buildGUID() {&lt;br /&gt;
    var UAIDbase62Characters = &amp;quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;quot;;&lt;br /&gt;
    var UAIDpayloadLength = 29;&lt;br /&gt;
&lt;br /&gt;
    function UAIDgetRandom62() {&lt;br /&gt;
        var r1;&lt;br /&gt;
        do {&lt;br /&gt;
            r1 = Math.floor(Math.random() * (16 * 62));&lt;br /&gt;
        } while (r1 &amp;gt; 61); &lt;br /&gt;
        return r1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var uid = '';&lt;br /&gt;
    for (var a = 0; a &amp;lt; UAIDpayloadLength; a++) {&lt;br /&gt;
        uid += UAIDbase62Characters.charAt(UAIDgetRandom62());&lt;br /&gt;
    }&lt;br /&gt;
    uid += Math.floor(new Date().getTime() / 1000);&lt;br /&gt;
    return uid;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. &amp;lt;br&amp;gt;&lt;br /&gt;
Sessions will automatically expire after 30 minutes of cloud inactivity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Send EMM Ping (only for Mobile (iOS and Android) and Browser)====&lt;br /&gt;
An EMM Ping must be sent using the created unique Session ID &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt; upon start of the first stream playback.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
https://[sessionID].uaid.nmrodam.com/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Also see  [[#Review the Reference Implementation for VoD and Live Streams|Reference Implementation for VoD and Live Streams]] for your reference.&lt;br /&gt;
&lt;br /&gt;
===Create View Session ID for each Video Start===&lt;br /&gt;
An View Session ID &amp;lt;code&amp;gt;[sessid]&amp;lt;/code&amp;gt; must be created upon start of each stream playback, sessid is unique per video play.&lt;br /&gt;
&lt;br /&gt;
===Define URL Structure===&lt;br /&gt;
Define the URL structure using your provided &amp;lt;code&amp;gt;[appid]&amp;lt;/code&amp;gt; and a unique &amp;lt;code&amp;gt;[sessionID]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Payload===&lt;br /&gt;
&lt;br /&gt;
====Description Payload====&lt;br /&gt;
&lt;br /&gt;
All Cloud API requests must contain the following payload data:&lt;br /&gt;
&lt;br /&gt;
*''devInfo'': device and app info&lt;br /&gt;
*''metadata'': asset metadata&lt;br /&gt;
*''event metadata'': type of event&lt;br /&gt;
&lt;br /&gt;
The payload can be passed through key-values using the Nielsen reserved keys. The specific keys and descriptions are highlighted in the tables included in this section.&lt;br /&gt;
&lt;br /&gt;
==== Payload Example ====&lt;br /&gt;
&lt;br /&gt;
The example below should be referenced when following the steps for configuring the request payload.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID using the UUID Generator code provided&lt;br /&gt;
sessionID = LsTYTmZQPwdchsNZkdtJp9lErjgAp1632729088  // Example sessionID &lt;br /&gt;
&lt;br /&gt;
// 2. Define URL Structure with App ID and Session ID&lt;br /&gt;
sessionURL = https://sc-eucert.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=&lt;br /&gt;
&lt;br /&gt;
// 3. Configure Payload&lt;br /&gt;
// 3.1 Configure Payload: devInfo &lt;br /&gt;
payload = {&lt;br /&gt;
 &amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
   &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
   &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: { // object for measuring video content&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
    &lt;br /&gt;
  // 3.3 Configure Payload: events&lt;br /&gt;
  &amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, //event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, // position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, //&amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1456448742000&amp;quot;, //unix timestamp in milliseconds &lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot; // create and pass a unique sessid for each video play using UUID Generator code provided&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configure Payload: devInfo====&lt;br /&gt;
An object &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; will need to be created to capture App and Device information.&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;
| devId || unique ID to identify user (e.g. Advertising ID, Roku Device ID) - Not required for AGF || custom || &lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example devInfo Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create devInfo object&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: {&lt;br /&gt;
  &amp;quot;devId&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
  &amp;quot;apv&amp;quot;: &amp;quot;1.0&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Configure Payload: metadata ====&lt;br /&gt;
Asset metadata can be passed through &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt;. There are two asset types: &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; for video and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; for ads. The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
You will need to set up &amp;lt;code&amp;gt;&amp;quot;metadata&amp;quot;&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; 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;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Example Content metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang='json'&amp;gt;// create content object&lt;br /&gt;
&amp;quot;content&amp;quot;: {&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
  	  // custom metadata&lt;br /&gt;
      &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata (optional for public broadcasters) =====&lt;br /&gt;
====== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'sonstiges' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
====== Example Ad metadata ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// create ad object&lt;br /&gt;
&amp;quot;ad&amp;quot;: {&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
      &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
      &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;      &lt;br /&gt;
}&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure Payload: Events ====&lt;br /&gt;
&lt;br /&gt;
The last part of the payload is for enabling events so content is measured correctly when viewed. The events and required parameters are included below.&lt;br /&gt;
&lt;br /&gt;
===== Event Types =====&lt;br /&gt;
&lt;br /&gt;
The available events are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; || &lt;br /&gt;
&lt;br /&gt;
===== Handling Playhead =====&lt;br /&gt;
&lt;br /&gt;
Calling &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt; is critical for accurate duration crediting. You can reference the below guidance to determine the correct playhead position to pass depending on the playback scenario.&lt;br /&gt;
&lt;br /&gt;
'''General'''&lt;br /&gt;
* Playhead position in seconds, must be passed as a whole number every 10 seconds. &lt;br /&gt;
* The final playhead position should be sent before before sending &amp;quot;complete&amp;quot; event when content playback is complete. &lt;br /&gt;
&lt;br /&gt;
'''Live Stream'''&lt;br /&gt;
* For Live streams, use Unix Time (in seconds) matching the broadcast time as the playhead position. Note that ad playheads must also use Unix Time for each single Ad in an Ad Pod.&lt;br /&gt;
&lt;br /&gt;
'''VoD Stream'''&lt;br /&gt;
* For VoD stream use the player position for Content and Ad at playback start of a content or single Ad in an Ad Pod, playheads will then be 0, 10, 20, ....&lt;br /&gt;
&lt;br /&gt;
'''End of an Asset'''&lt;br /&gt;
* Final postion must be sent at the end of Content or Ad playback&lt;br /&gt;
&lt;br /&gt;
'''Ads'''&lt;br /&gt;
* The final playhead position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* For Ad Pods, playhead must be called for each individual ad.&lt;br /&gt;
* When content has resumed following a mid-roll ad break, the next playhead position must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''User Actions'''&lt;br /&gt;
* SCRUBBING: Upon user scrubbing, the current position must be sent before a user scrubs, and the new position should be sent where the user lands, and begin sending in the 10 second updates thereafter.&lt;br /&gt;
* PAUSE: When content is paused, send current playhead position and stop passing playhead position until content is resumed.&lt;br /&gt;
* EXIT Stream: If a user exits a stream early, the last current position must be sent in a playhead update to receive accurate duration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt; || The complete event must be sent when the content has completed full playback. Before calling the complete event, a final playhead update with the final position is required to be sent to receive full duration credit. For Live streams, a complete event must be sent at program boundaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || The delete event is optional and can be sent when the viewing session is terminated (typically on App close). A new session ID must be generated after sending a delete event. Delete should not be sent on app interruptions or foreground/background events. All creditable duration will be summarized for all asset types when delete occurs (content and ads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Event Parameters =====&lt;br /&gt;
&lt;br /&gt;
The following parameters need to be passed when calling events:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description !! Value !! Required&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;event&amp;quot;&amp;lt;/code&amp;gt; || event type || &amp;lt;code&amp;gt;&amp;quot;playhead&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;complete&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;delete&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || playhead position in seconds or Unix time in seconds || &amp;lt;code&amp;gt;&amp;quot;300&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;&amp;lt;/code&amp;gt; || asset type || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ad&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp in milliseconds. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|-style=&amp;quot;background-color:#d0f6f8;&amp;quot;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;sessid&amp;quot;&amp;lt;/code&amp;gt; || Unique View Session ID must be created upon start of each stream playback, sessid is unique per video play. || &amp;lt;code&amp;gt;&amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;&amp;lt;/code&amp;gt; || ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Event =====&lt;br /&gt;
You can call events by passing values in the required parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;devInfo&amp;quot;: [deviceInfo],&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;content&amp;quot;: [content metadata],&lt;br /&gt;
    &amp;quot;ad&amp;quot;: [ad metadata]&lt;br /&gt;
  },&lt;br /&gt;
  // Event Parameters&lt;br /&gt;
  &amp;quot;event&amp;quot;: [event], // event name&lt;br /&gt;
  &amp;quot;position&amp;quot;: [playheadPosition], //position in seconds&lt;br /&gt;
  &amp;quot;type&amp;quot;: [asset type], // values are &amp;quot;content&amp;quot; or &amp;quot;ad&amp;quot;&lt;br /&gt;
  &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;, //unix timestamp in milliseconds&lt;br /&gt;
  &amp;quot;sessid&amp;quot;: &amp;quot;xxxjavd6wzirm93xb95uxjy1ac5wu1627638609&amp;quot;, // unique for each video play&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The full payload including &amp;quot;devInfo&amp;quot; and &amp;quot;metadata&amp;quot; must be populated in each event request.&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle for VoD Stream =====&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events and values to pass.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// Preroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Content&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content resumes at 15 minutes&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;900&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 30 minutes&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;1800&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
 &lt;br /&gt;
// Postroll&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sample Event Lifecycle for VoD Stream - Detailed Storyline'''&lt;br /&gt;
This detailed event sequence provides additional insight for the correct events to call when handling certain playback scenarios.&lt;br /&gt;
&amp;lt;syntaxhighlight lang='javascript'&amp;gt;// SESSION STARTS&lt;br /&gt;
// Start of Session: session ID created when App is opened&lt;br /&gt;
&lt;br /&gt;
// PREROLL&lt;br /&gt;
// Preroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472760000000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Preroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;15&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;}&lt;br /&gt;
 &lt;br /&gt;
// CONTENT &lt;br /&gt;
// Content Start - Start new content streams with a position of &amp;quot;0&amp;quot; incrementing the position every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472761500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content Stop Before Ad Break - Send a playhead update including the current content positon before an Ad break.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;299&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787400000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
// Midroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Midroll Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472787500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Midroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;60&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472793500000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// CONTENT&lt;br /&gt;
// Content resumes at 5 minutes - Send playhead update with the current resumed position, and begin incrimenting the positon every 10 seconds.&lt;br /&gt;
Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;300&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472799500000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Content completes at 10:12 - Make sure to send in the playhead event with the final content position before sending the complete event.&lt;br /&gt;
Final Content Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830700000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
Complete {&amp;quot;event&amp;quot;: &amp;quot;complete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;612&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830800000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// POSTROLL&lt;br /&gt;
// Postroll Start - Start each Ad with a position of &amp;quot;0&amp;quot;, resetting to '0' for each Ad, and Ad break.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472830900000&amp;quot;} &lt;br /&gt;
&lt;br /&gt;
// Postroll Stop - End each Ad with the final position of the Ad.&lt;br /&gt;
Ad Playhead {&amp;quot;event&amp;quot;: &amp;quot;playhead&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;45&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;ad&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835300000&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
// SESSION ENDS&lt;br /&gt;
&lt;br /&gt;
//End of Session: The delete event should be called when the App is exited. The values for position and type not required to be passed.&lt;br /&gt;
Delete { &amp;quot;event&amp;quot;: &amp;quot;delete&amp;quot;, &amp;quot;position&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;type&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;utc&amp;quot;: &amp;quot;1472835400000&amp;quot;} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Interruption Scenarios =====&lt;br /&gt;
&lt;br /&gt;
As part of configuring events, you will need to handle all possible interruption scenarios such as:&lt;br /&gt;
&lt;br /&gt;
*Wi-Fi OFF / ON&lt;br /&gt;
*App going Background / Foreground (Video players only, not for Audio players)&lt;br /&gt;
*App Crash or Exit&lt;br /&gt;
&lt;br /&gt;
When playback is interrupted, the app needs to send delete immediately.&lt;br /&gt;
&lt;br /&gt;
Once playback resumes, a new session will need to be created with a unique session ID. All of the required metadata and events will need to be sent.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The session will automatically timeout after 30 minutes of inactivity.&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
Now that we walked through the Cloud API integration steps, your requests should have the following components: Session ID, App ID, and Payload. You can reference the example below when your reviewing your integration.&lt;br /&gt;
&lt;br /&gt;
see '''[[#Payload Example|Payload Example]]'''&lt;br /&gt;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
function sendPayloadToNielsen() {&lt;br /&gt;
  var payloadStr  = JSON.stringify(payload); // payload as string&lt;br /&gt;
  var imgPing = new Image();&lt;br /&gt;
  imgPing.onload = function() {&lt;br /&gt;
    // onload event, payload succesfull sent&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.onerror = function() {&lt;br /&gt;
    // handle error i.e. wait and send again&lt;br /&gt;
  };&lt;br /&gt;
  imgPing.src = sessionURL+encodeURIComponent(payloadStr);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Debug Logging ===&lt;br /&gt;
&lt;br /&gt;
Now that you have set up the Cloud API requests, you can enable debug logging to validate your integration. Enabling debug logging is required for Nielsen certification.&lt;br /&gt;
&lt;br /&gt;
==== GET Request ====&lt;br /&gt;
&lt;br /&gt;
Display GET Request to console using a name to identify each event (e.g. playhead).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event&amp;quot;, image); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Payload ====&lt;br /&gt;
&lt;br /&gt;
Output payload to identify required metadata and events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
console.log(&amp;quot;Event Payload&amp;quot;, payload); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response Code ====&lt;br /&gt;
&lt;br /&gt;
Confirm request was completed by viewing HTTP response code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
code = msg.GetResponseCode();&lt;br /&gt;
console.log(&amp;quot;Response Code&amp;quot;, code);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can reference the HTTP Response Code table when reviewing your requests:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Status Code !! Status Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt; || OK || request received&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;403&amp;lt;/code&amp;gt; || Forbidden || invalid App ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;404&amp;lt;/code&amp;gt; || Not Found || JSON issue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Review the Reference Implementation for VoD and Live Streams ==&lt;br /&gt;
&lt;br /&gt;
The Reference Implementation covers vod and Live use cases. &lt;br /&gt;
It also covers DAI (Dynamic Ad Insertion) with  preroll and postroll Ads.&lt;br /&gt;
&lt;br /&gt;
In order to start live stream select the checkbox &amp;quot;isLive&amp;quot; in the &amp;lt;code&amp;gt;Playback Settings&amp;lt;/code&amp;gt; below the video player.&lt;br /&gt;
&lt;br /&gt;
Start the Reference Implementation for DK [https://nielsenonlinesupport.com/dk/cloudapi/index.htm?debug=true RefImplCloudAPIDK].&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Review the Nielsen CloudAPI Call Sequence below the Video Player.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disclose Nielsen Privacy Statement ==&lt;br /&gt;
&lt;br /&gt;
The Nielsen Cloud API measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Cloud API measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
&lt;br /&gt;
A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Before providing an app build to Nielsen for testing, it is important to run validation checks once you have enabled debug logging.&lt;br /&gt;
&lt;br /&gt;
=== Payload Validation ===&lt;br /&gt;
&lt;br /&gt;
Ensure that all of the required payload data is populating while testing several videos. The following areas are critical to measurement:&lt;br /&gt;
*devInfo&lt;br /&gt;
*Asset metadata for both content, and ads&lt;br /&gt;
*Events&lt;br /&gt;
&lt;br /&gt;
=== Player Events ===&lt;br /&gt;
Review event calls:&lt;br /&gt;
&lt;br /&gt;
==== playhead ====&lt;br /&gt;
*Playhead position updates every 10 seconds starting at position '0' for each new asset for VoD stream and UTC Unix Time in seconds for Live stream.&lt;br /&gt;
*Final playhead position is sent on content, or ad before switching between assets.&lt;br /&gt;
*Content metadata remains constant throughout an episode, or clip play.&lt;br /&gt;
*Ad metadata is populated appropriately for each individual ad.&lt;br /&gt;
*Playhead position update resumes for content after an ad break, and resets to 0 for each individual ad.&lt;br /&gt;
*For scrubbing, last current position should be sent while scrubbing occurs, and the new position should also be sent where the user scrubs to.&lt;br /&gt;
*Exiting a stream early should execute the last current position in a playhead update to receive accurate duration.&lt;br /&gt;
*Upon pause, the current position should be sent, and playhead updates should stop incrementing until resume play occurs.&lt;br /&gt;
&lt;br /&gt;
==== complete ====&lt;br /&gt;
*Check that the complete event executes upon content complete after the final playhead update is sent&lt;br /&gt;
*Do not execute the complete event for ads&lt;br /&gt;
&lt;br /&gt;
==== delete ====&lt;br /&gt;
*Check to see that the delete event occurs upon app exit, if the platform has the necessary exit callback events.&lt;br /&gt;
&lt;br /&gt;
==== GET Request Format ====&lt;br /&gt;
*Ensure that the event payloads are formatted in JSON&lt;br /&gt;
*Check to see that each of the Cloud API GET requests are properly encoded&lt;br /&gt;
&lt;br /&gt;
==== HTTP Response ====&lt;br /&gt;
*Make sure that each of the Cloud API Get requests are received by the Nielsen Cloud API properly through use of the HTTP Response Code outputs enabled in console.&lt;br /&gt;
&lt;br /&gt;
== Go Live ==&lt;br /&gt;
After your integration has been certified, you will need to: Change Endpoint and Disable Logging.&lt;br /&gt;
&lt;br /&gt;
'''Change Endpoint:''' You will need to update to the production endpoint:&lt;br /&gt;
&lt;br /&gt;
*Testing: &amp;lt;code&amp;gt;https://sc-eucert.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your production URL structure should now be:&lt;br /&gt;
&amp;lt;code&amp;gt;https://agfcapi.nmrodam.com/nmapi/v2/[appid]/[sessionID]/a?b=[payload]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Disable Logging:''' You can now disable debug logging&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6098</id>
		<title>DCR Germany Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6098"/>
		<updated>2023-01-25T14:18:00Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Ad metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 browser 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) - e.g. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&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;
&lt;br /&gt;
/* NLSQUEUE build v*/&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&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 files 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(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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. Users 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;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Example Content metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  '88675545',&lt;br /&gt;
  program:  'Program Name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '3600',&lt;br /&gt;
  nol_c0:  'p0,1',&lt;br /&gt;
  nol_c2:  'p2,Y',&lt;br /&gt;
  nol_c7:  'p7,videoid123',&lt;br /&gt;
  nol_c8:  'p8,3600',&lt;br /&gt;
  nol_c9:  'p9,VideoTitle123',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c12: 'p12,content',&lt;br /&gt;
  nol_c18: 'p18,N'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &lt;br /&gt;
==== Ad Metadata ====&lt;br /&gt;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'sonstiges' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Ad metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var ad_metadata_object = {  &lt;br /&gt;
  type:     'preroll',&lt;br /&gt;
  assetid:  'ad345-67483',&lt;br /&gt;
  title:    'ad_title',&lt;br /&gt;
  length:   '25',&lt;br /&gt;
  nol_c8:  'p8,25',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c11: 'p11,2352723141',&lt;br /&gt;
  nol_c12: 'p12,Ad',&lt;br /&gt;
  nol_c17: 'p17,preroll'&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;
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;
== Livestream ==&lt;br /&gt;
For '''Livestreams'''  please make sure playheadPosition is in UNIX-Timestamp for Content.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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 parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6097</id>
		<title>DCR Germany Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_Browser_SDK&amp;diff=6097"/>
		<updated>2023-01-25T14:16:35Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Content metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 browser 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) - e.g. for Cordova. Only native webview implementations may work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To get started, an AppID is needed. The AppID is a unique ID assigned to the player/site/app. This will be provided upon starting the integration from Nielsen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  apid: &amp;quot;XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot; // eg. PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&lt;br /&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;
&lt;br /&gt;
/* NLSQUEUE build v*/&lt;br /&gt;
!function(e,n){&lt;br /&gt;
  function t(e){&lt;br /&gt;
    return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
  }&lt;br /&gt;
  e[n]=e[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(o,r,c){&lt;br /&gt;
      var s=e.document,&lt;br /&gt;
      a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
      a.async=1,&lt;br /&gt;
      a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
      var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
      return i.parentNode.insertBefore(a,i),&lt;br /&gt;
      e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
      ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
      trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
      e[n][r]&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 files 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(e,n){&lt;br /&gt;
		function t(e){&lt;br /&gt;
			return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
		}&lt;br /&gt;
		e[n]=e[n]||&lt;br /&gt;
		{&lt;br /&gt;
			nlsQ:function(o,r,c){&lt;br /&gt;
				var s=e.document,&lt;br /&gt;
				a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
				a.async=1,&lt;br /&gt;
				a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.nmrodam.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
				var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
				return i.parentNode.insertBefore(a,i),&lt;br /&gt;
				e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
				ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
				trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
				e[n][r]&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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. Users 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;
===== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Example Content metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var content_metadata_object = {  &lt;br /&gt;
  type:     'content',&lt;br /&gt;
  assetid:  '88675545',&lt;br /&gt;
  program:  'Program Name',&lt;br /&gt;
  title:    'episode title',&lt;br /&gt;
  length:   '3600',&lt;br /&gt;
  nol_c0:  'p0,1',&lt;br /&gt;
  nol_c2:  'p2,Y',&lt;br /&gt;
  nol_c7:  'p7,videoid123',&lt;br /&gt;
  nol_c8:  'p8,3600',&lt;br /&gt;
  nol_c9:  'p9,VideoTitle123',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c12: 'p12,content',&lt;br /&gt;
  nol_c18: 'p18,N'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &lt;br /&gt;
==== Ad Metadata ====&lt;br /&gt;
===== Description of 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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'sonstiges' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Example Ad metadata =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var ad_metadata_object = {  &lt;br /&gt;
  type:     'preroll',&lt;br /&gt;
  assetid:  'ad345-67483',&lt;br /&gt;
  title:    'ad_title',&lt;br /&gt;
  length:   '25',&lt;br /&gt;
  nol_c8:  'p8,25',&lt;br /&gt;
  nol_c10: 'p10,clientname',&lt;br /&gt;
  nol_c11: 'p11,2352723141',&lt;br /&gt;
  nol_c12: 'p12,Ad',&lt;br /&gt;
  nol_c17: 'p17,preroll'&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;
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;
== Livestream ==&lt;br /&gt;
For '''Livestreams'''  please make sure playheadPosition is in UNIX-Timestamp for Content.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
The Browser SDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen Browser SDK measurement is utilizing a cookieless domain.&lt;br /&gt;
&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&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;P14273221-CF5C-46BF-A832-994AEFB7XXXX&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 parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6096</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6096"/>
		<updated>2023-01-25T14:13:57Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: /* Description of Ad metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'sonstiges' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Ad&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6095</id>
		<title>DCR Germany Video App SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Germany_Video_App_SDK&amp;diff=6095"/>
		<updated>2023-01-25T14:12:34Z</updated>

		<summary type="html">&lt;p&gt;MichelFodjo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|AGF Implementation Documentation}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of the 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 the 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;
* &amp;lt;blockquote&amp;gt;'''No ID AppSDK''': &amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;ONLY the No ID AppSDK should be downloaded for the AGF market!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
Please contact our SDK sales support team if you do not have any of these prerequisites or have any questions.&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;
&lt;br /&gt;
=== iOS  ===&lt;br /&gt;
&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;
* SystemConfiguration.framework&lt;br /&gt;
* Security.framework&lt;br /&gt;
** Nielsen Analytics framework uses several 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 &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 the 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;
&lt;br /&gt;
&lt;br /&gt;
=== Android  ===&lt;br /&gt;
==== General  ====&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
'''Configuring Android Java Development Environment'''&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;br /&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 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 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 Google Play support to work properly.&lt;br /&gt;
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;&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 on handling 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 a Google service is available and updated.&lt;br /&gt;
* If unavailable or updated, App SDK will not use this service when executing its functions and will reference 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;
* 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;
==== Add the dependency &amp;quot;lifecycle-extensions&amp;quot; to your project  ====&lt;br /&gt;
Add the dependency &amp;quot;lifecycle-extensions&amp;quot; in the in the app gradle file as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
implementation &amp;quot;androidx.lifecycle:lifecycle-extensions:2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will enable the AppSdk to detect the application UI visibility state transitions between background and foreground by utilizing the LifeCycleObserver. This is i.e. required for the Static Measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Review SDK Integration Architecture Diagram ==&lt;br /&gt;
&lt;br /&gt;
=== For Content Playback ===&lt;br /&gt;
&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-content-agf-v0.png||SDK Integration Architecture Diagram - Content]]&lt;br /&gt;
&lt;br /&gt;
=== For Ad Playback ===&lt;br /&gt;
[[File:nlsn-sdk-achitecture-diagram-agf-ad-v0.png||SDK Integration Architecture Diagram - Ad]]&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 before 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/Obligatory? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || ✓ || &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || No || &amp;quot;Nielsen Sample App&amp;quot;&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;
'''AGF Clients'''&lt;br /&gt;
* &amp;quot;eu&amp;quot; (For Testing/Certification and in Production)&lt;br /&gt;
|| Nielsen-specified || ✓ || &amp;quot;eu&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Has to be set to &amp;quot;DEBUG&amp;quot; until certified&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&lt;br /&gt;
&lt;br /&gt;
=====  iOS =====&lt;br /&gt;
====== Swift ======&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;PDA7D5EE6-B1B8-XXXX-XXXX-2A788BCXXXCA&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;eu&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;
&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;sfcode&amp;quot;: &amp;quot;eu&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;
&lt;br /&gt;
=====  Android =====&lt;br /&gt;
====== Java ======&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;sfcode&amp;quot;, &amp;quot;eu&amp;quot;)&lt;br /&gt;
          .put(&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;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 the 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 the property page of the App’s project).&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 handle 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 the unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** The error message will be logged if the string has an invalid JSON format.&lt;br /&gt;
* JSON value must be a 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;
&lt;br /&gt;
=== Configure ChannelInfo metadata === &lt;br /&gt;
==== Description of ChannelInfo metadata ====&lt;br /&gt;
channelName 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;
| 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;
==== Example ChannelInfo metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&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;
&amp;lt;/syntaxhighlight&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Configure Content metadata ===&lt;br /&gt;
&lt;br /&gt;
==== Description of 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;
For detailed information on metadata and custom variables, see '''[[AGF Metadata Convention#Video Measurement|AGF Metadata Convention for Video Measurement]]'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required/Obligatory&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; || ✓&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;
| program ||(string) name of program (254 character limit) || 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 || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&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 with 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;
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;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nol_c0  || number of episode part (Sendungsteilenummer)              || number                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c5  || page URL                     || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c7  || Video ID                     || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration in seconds          || `seconds` ('86400' for 24/7 Livestream. For Event-Livestreams planned length. For VoD video length) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c9  || episode title                || custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || type of asset                || 'Trailer' or 'Content'             || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c13 || original air time            || `(YYYY-MM-TT)T(HH:mm:ss)   Example: 2004-06-14T23:34:30  ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c14 || ISO 8601 timestamp           || `(YYYY-MM-TT)T(HH:mm:ss)`    ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c15 || format ID                    || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c18 || livestream                   || 'Y' or 'N' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c19 || custom variable              || custom                ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c20 || GfK-ID                     || custom                ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example Content metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&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;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;episode title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;, &lt;br /&gt;
    &amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;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;: @&amp;quot;88675545&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;episode title&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c0&amp;quot;: &amp;quot;p0,1&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c2&amp;quot;: &amp;quot;p2,Y&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c7&amp;quot;: &amp;quot;p7,videoid123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,3600&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c9&amp;quot;: &amp;quot;p9,VideoTitle123&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,content&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c18&amp;quot;: &amp;quot;p18,N&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&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;88675545&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;episode title&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c0&amp;quot;, &amp;quot;p0,1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c2&amp;quot;, &amp;quot;p2,Y&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c7&amp;quot;, &amp;quot;p7,videoid123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c9&amp;quot;, &amp;quot;p9,VideoTitle123&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c18&amp;quot;, &amp;quot;p18,N&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
=== Configure Ad Metadata ===&lt;br /&gt;
==== Description of 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 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 SPACE - no [https://engineeringportal.nielsen.com/docs/Special_Characters Special Characters]) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided App ID. In order to override the sub-brand configured to the App ID, value can be passed here (e.g. multiple sub-brands in App) || provided by Nielsen	||&lt;br /&gt;
|-&lt;br /&gt;
| title || only the AD-ID is necessary || custom, &amp;lt;AD-ID&amp;gt; without &amp;quot;VAST&amp;quot; Prefix or other, i.e.  '2352723141' ||	✓&lt;br /&gt;
|-	&lt;br /&gt;
| length || length of Ad in seconds || length of Ad in seconds || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c1 || universal AdID (Additional AD-ID to be used by second or third marketers) || custom, i.e. 'adgapid_022_800160_1601097_001_0_0' ||&lt;br /&gt;
|-&lt;br /&gt;
| nol_c2  || web only                     || 'Y' or 'N'          || &lt;br /&gt;
|-&lt;br /&gt;
| nol_c4 || form of advertising || 'preroll','midroll', 'postroll', 'pre-split', 'sponsor' ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c8  || duration of the video file in seconds          ||  || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c10 || publisher                    || custom                || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c11 || AD-ID (unique ID of an advertisement. Necessary if ads are being broadcasted) || custom, i.e. '2352723141' || ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c12 || content type (key distinction of content, advertising, and Trailer) || 'Werbung' ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| nol_c16 || content-ID (Combines different videos to a common category, content-wise, a content-ID is available for content, trailer and ads) || custom, i.e. 'dVxRcCpOqKyFz02fuss', 'dvrsowf_ten_rtlibes', etc ||	&lt;br /&gt;
|-&lt;br /&gt;
| nol_c17 || ad placement type (placement information of advertisement) || 'preroll', 'midroll', 'postroll' or 'sonstiges' ||	✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example Ad metadata ====&lt;br /&gt;
===== iOS =====&lt;br /&gt;
====== Swift ======&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
let adMetadata = [&lt;br /&gt;
	&amp;quot;type&amp;quot;: &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;ad345-67483&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;ad_title&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
    &amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====== Objective-C ======&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
NSDictionary *adMetadata = @&lt;br /&gt;
  {@&amp;quot;type&amp;quot;: @&amp;quot;preroll&amp;quot;,&lt;br /&gt;
  @&amp;quot;assetid&amp;quot;: @&amp;quot;ad345-67483&amp;quot;&amp;quot;,&lt;br /&gt;
  @&amp;quot;title&amp;quot;: @&amp;quot;ad_title&amp;quot;,&lt;br /&gt;
  @&amp;quot;length&amp;quot;: @&amp;quot;25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c8&amp;quot;: &amp;quot;p8,25&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c10&amp;quot;: &amp;quot;p10,clientname&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c11&amp;quot;: &amp;quot;p11,2352723141&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c12&amp;quot;: &amp;quot;p12,Ad&amp;quot;,&lt;br /&gt;
  @&amp;quot;nol_c17&amp;quot;: &amp;quot;p17,preroll&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Android =====&lt;br /&gt;
====== Java ======&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;preroll&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;ad345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c8&amp;quot;, &amp;quot;p8,25&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c10&amp;quot;, &amp;quot;p10,clientname&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c11&amp;quot;, &amp;quot;p11,2352723141&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c12&amp;quot;, &amp;quot;p12,Ad&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;nol_c17&amp;quot;, &amp;quot;p17,preroll&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
| 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;
&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 processes playing information. [[play]] and [[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;
## [[playheadPosition]] – Call this API every one second when playhead position timer is fired.&lt;br /&gt;
## [[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;
## [[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;
&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 pause the measurement.&lt;br /&gt;
* As soon as the playback resumes, call [[loadMetadata]] and  [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== API Call sequence ===&lt;br /&gt;
==== Use Case 1: Content has no Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for content as below.&lt;br /&gt;
'''[[#Example Content metadata|Example Content metadata]]'''&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the stream playback is interrupted or has ended.&lt;br /&gt;
Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.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;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position 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;mAppSdk.end();&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Use Case 2: Content has Advertisements ====&lt;br /&gt;
Call [[play()]] with channelName JSON as below.&lt;br /&gt;
'''[[#Example ChannelInfo metadata|Example ChannelInfo metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: ONLY for a preroll Ad , Call [[loadMetadata()]] for Content before calling it for preroll ad &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[loadMetadata()]] with JSON metadata for ad as below.&lt;br /&gt;
'''[[#Example Ad metadata|Example Ad metadata]]'''&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until the Ad playback is interrupted or has ended for each single Ad. Playhead should be passed for the entire duration of ad pod, if the ad pod details are passed as part of [[loadMetadata()]].&lt;br /&gt;
&lt;br /&gt;
The sample API sequence can be used as a reference to identify the specific events that need to be called during content and ad playback.&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;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;mAppSdk.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;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Preroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(prerollMetadataObject);&amp;lt;/code&amp;gt; || // prerollMetadataObject contains the JSON metadata for the preroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the preroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after preroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after the content is paused (ad starts)&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | Midroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // midrollMetadataObject contains the JSON metadata for the midroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the midroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead while the midroll ad is being played &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (Content resume) || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Always call stop irrespective of postroll is followed or not&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;mAppSdk.end();&amp;lt;/code&amp;gt; || // Call end() at the end of content&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Postroll || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(postrollMetaDataObject);&amp;lt;/code&amp;gt; || // postrollMetadataObject contains the JSON metadata for the postroll ad&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.setPlayheadPosition(playheadPosition);&amp;lt;/code&amp;gt; || // position is position of the playhead while the postroll ad is being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mAppSdk.stop();&amp;lt;/code&amp;gt; || // Call stop after postroll occurs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: Each Ad playhead should reset or begin from 0 at ad start.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sequence of Calls ===&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[play]] to pass the channel descriptor information through channelName parameter after the SDK has been initialized and the content starts playing. If the user is returning from a '''Pause/Stop''' interaction, call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   - (void)play:(id)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;
Needs to be called at the beginning of each asset, pass JSON object for relevant content or ad. &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;
&lt;br /&gt;
&amp;quot;playheadPosition&amp;quot; has to be called every second.&lt;br /&gt;
&lt;br /&gt;
* VOD : &lt;br /&gt;
** For Content and each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
*Live : &lt;br /&gt;
**For Content, pass the Unix timestamp (seconds since Jan-1-1970 UTC). Pass whole number that increments only by 1 like 1631098029,1631098030,1631098031,1631098032,... . &lt;br /&gt;
**For each single Ad, pass the current position in seconds. Pass whole number that increments only by 1 like 0,1,2,3...&lt;br /&gt;
&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;
&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;
Call when&lt;br /&gt;
* ads complete playing&lt;br /&gt;
* when a user pauses playback&lt;br /&gt;
* upon any user interruption scenario - see bellow chapter Interruption scenario&lt;br /&gt;
&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;
Call when the content asset completes playback. Stops measurement progress. &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;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:&lt;br /&gt;
* Pause / Play&lt;br /&gt;
* Network Loss (Wi-Fi / Airplane / Cellular)&lt;br /&gt;
* Call Interrupt (SIM or Third party Skype / Hangout call)&lt;br /&gt;
* Alarm Interrupt&lt;br /&gt;
* Content Buffering&lt;br /&gt;
* Device Lock / Unlock (Video players only, not for Audio players)&lt;br /&gt;
* App going in the Background/Foreground (Video players only, not for Audio players)&lt;br /&gt;
* Channel / Station Change Scenario&lt;br /&gt;
* Unplugging of headphone&lt;br /&gt;
In case of encountering one of the above interruptions, the player application needs to&lt;br /&gt;
* Call [[stop]] immediately and withhold sending playhead position.&lt;br /&gt;
* '''For video content:'''&lt;br /&gt;
** Call [[loadMetadata]] with the same metadata and continue sending [[playheadPosition]] once the playback resumes.&lt;br /&gt;
* '''For ads:'''&lt;br /&gt;
** just continue sending [[playheadPosition]] once the playback resumes (no [[loadMetadata]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional information:&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;
&lt;br /&gt;
=== App termination ===&lt;br /&gt;
If your app is executing a termination process and therefore ending the Content or Ad Playback, call [[end]] if the Content is playing or [[stop]] if an Ad is playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
&lt;br /&gt;
The AppSDK measurement is working without cookies and other personal information. No user can be identified personally, therefore an opt-out functionality is not required. The Nielsen AppSDK measurement is utilizing a cookieless domain.&lt;br /&gt;
In order to disclose Nielsen measurement privacy statement, please include the following items in your privacy policy:&lt;br /&gt;
* A notice that the player includes third party measurement software that allows users to contribute to market research with anonymous data.&lt;br /&gt;
* A link to the Nielsen Digital Measurement Privacy Policy located at https://nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=de .&lt;br /&gt;
 &lt;br /&gt;
Please contact your Nielsen SDK support team directly for any related questions.&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
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:&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;eu&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;eu&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note''': before going live, you have to inform the Nielsen team - this is necessary because the Nielsen team has to adjust internal configuration parameters to enable data collection. Without that notification, no data will be collected, and no data will be reported.&lt;/div&gt;</summary>
		<author><name>MichelFodjo</name></author>
	</entry>
</feed>