<?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=MarkTufano</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=MarkTufano"/>
	<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/wiki/Special:Contributions/MarkTufano"/>
	<updated>2026-04-12T02:54:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DTVR_Browser_SDK&amp;diff=4226</id>
		<title>DTVR Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DTVR_Browser_SDK&amp;diff=4226"/>
		<updated>2020-06-23T17:11:31Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}   {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
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;
|-&lt;br /&gt;
|| ☑ || '''App ID (apid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure SDK ==&lt;br /&gt;
There are two steps required for configuring your SDK: 1. Add Static Queue Snippet and 2. Create SDK Instance.&lt;br /&gt;
&lt;br /&gt;
== Add Static Queue Snippet ==&lt;br /&gt;
Add the following script tag to your website:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    ! function(t, n) {&lt;br /&gt;
        t[n] = t[n] || {&lt;br /&gt;
            nlsQ: function(e, o, c, r, s, i) {&lt;br /&gt;
                return s = t.document,&lt;br /&gt;
                    r = s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
                    r.async = 1,&lt;br /&gt;
                    r.src = (&amp;quot;http:&amp;quot; === t.location.protocol ? &amp;quot;http:&amp;quot; : &amp;quot;https:&amp;quot;) + &amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot; + e + &amp;quot;.js#name=&amp;quot; + o + &amp;quot;&amp;amp;ns=&amp;quot; + n,&lt;br /&gt;
                    i = s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
                    i.parentNode.insertBefore(r, i),&lt;br /&gt;
                    t[n][o] = t[n][o] || {&lt;br /&gt;
                        g: c || {},&lt;br /&gt;
                        ggPM: function(e, c, r, s, i) {&lt;br /&gt;
                            (t[n][o].q = t[n][o].q || []).push([e, c, r, s, i])&lt;br /&gt;
                        }&lt;br /&gt;
                    }, t[n][o]&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    (window, &amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&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. Since the queue is able to 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, you will need to create an SDK instance by making the initialization call:&lt;br /&gt;
&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;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When creating your instance, you will need to pass three parameter values. The available parameters are listed in the table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters !! Description !! Value !! Required? (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
| apid || UniqueID assigned to player/site. &lt;br /&gt;
|| &amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| instanceName || User-defined string value for describing the player/site. || Client specified || Yes&lt;br /&gt;
|-&lt;br /&gt;
| nol_sdkDebug:&amp;quot;debug&amp;quot; || Enables Debug Mode which allows output to be viewed in console. || &amp;quot;{nol_sdkDebug: &amp;quot;debug&amp;quot;}&amp;quot; || No&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;XXXXXXXXXXX-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 your apid and 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: &amp;quot;nlsSDK600.bundle.min.js&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Initialization ===&lt;br /&gt;
Your configuration should include the Static Queue Snippet and an SDK Instance for your unique App ID as shown in the example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//Add Static Queue Snippet&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    ! function(t, n) {&lt;br /&gt;
        t[n] = t[n] || {&lt;br /&gt;
            nlsQ: function(e, o, c, r, s, i) {&lt;br /&gt;
                return s = t.document,&lt;br /&gt;
                    r = s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
                    r.async = 1,&lt;br /&gt;
                    r.src = (&amp;quot;http:&amp;quot; === t.location.protocol ? &amp;quot;http:&amp;quot; : &amp;quot;https:&amp;quot;) + &amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot; + e + &amp;quot;.js#name=&amp;quot; + o + &amp;quot;&amp;amp;ns=&amp;quot; + n,&lt;br /&gt;
                    i = s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
                    i.parentNode.insertBefore(r, i),&lt;br /&gt;
                    t[n][o] = t[n][o] || {&lt;br /&gt;
                        g: c || {},&lt;br /&gt;
                        ggPM: function(e, c, r, s, i) {&lt;br /&gt;
                            (t[n][o].q = t[n][o].q || []).push([e, c, r, s, i])&lt;br /&gt;
                        }&lt;br /&gt;
                    }, t[n][o]&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    (window, &amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//Create SDK Instance&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Content Metadata ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adModel	|| linear vs dynamic ad model	|| * 1) - Linear – matches TV ad load * 2) Dynamic – Dynamic Ad Insertion (DAI)     || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Content Object'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type: 'content',&lt;br /&gt;
  adModel: '1'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata Object ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If Ad is not ID3 tagged, then Ad metadata 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	||  &amp;lt;code&amp;gt;'preroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;'ad'&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 (no [[Special Characters]]) || ✓&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Example Ad Object'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; var adMetadataObject = &lt;br /&gt;
{  &lt;br /&gt;
  assetid: 'AD-1',&lt;br /&gt;
  type:    'preroll'&lt;br /&gt;
};&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Events ===&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/Ad metadata object	|| Needs to be called at the beginning of each asset to pass type and adModel.&lt;br /&gt;
|-&lt;br /&gt;
| 'sendID3'	|| Used to send the ID3 tag payload retrieved from the stream || Needs to be called at the beginning of playback&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configure and fire API calls ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The syntax for firing events is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;event&amp;quot;, parameter object);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Event is passed in parameter 1 and the argument is passed in parameter 2.&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - loadMetadata ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Use [[loadMetadata (Browser)]] to pass the metadata object. The data must be passed as a JSON string.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;loadMetadata&amp;quot;, metadataObject);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - sendID3 ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Use [[sendID3 (Browser)]] to send ID3 payload of the HLS content being played. This will allow the ID3 payload to be sent every time an ID3 packet is received (approximately, once in every 10 seconds).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;sendID3&amp;quot;, ID3_Payload);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==== Sample ID3 tags ====&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/X100zdCIGeIlgZnkYj6UvQ==/AAAB2Jz2_k74GXSzx4npHuI_&amp;lt;wbr /&amp;gt;JwJd3QSUpW30rDkGTcbHEzIMWleCzM-uvNOP9fzJcQMWQLJqzXMCAxParOb5sGijSV9dNM3QiBniJYGZ5GI-lL1fXTTN0IgZ4iWBmeRiPpS9AAAAAAAAAAAAAAAAAAAAAFJWFM5SVhTONNU=/00000/00000/00&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/R8WHe7pEBeqBhu8jTeXydg==/AAICoyitYqlxT7n6aZ0oMCGhe&amp;lt;wbr /&amp;gt;Fi4CXFp46AMUPZz1lMr_M9tr3_cjee1SHqxrOiVerMDLeyn9xzocZSKwi746Re8vNOtpNCAZjYABs_J0R25IHpvOc1HS8&amp;lt;wbr /&amp;gt;QHGgD5TgOJeS6gX100zdCIGeIlgZnkYj6UvVJWFNhSVhTiPE0=/00000/46016/00&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ID3_Payload&amp;lt;/code&amp;gt; is the container to pass the retrieved ID3 tag from the streaming. The player should look for 'PRIV' ID3 tags and send 'owner' field (which typically starts from &amp;quot;www.nielsen.com&amp;quot;) through this API. Refer to [[Browser SDK API Reference#Retrieving ID3 Tags|Browser SDK API Reference - Retrieving ID3 Tags]] for more information.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Refer to [[Browser SDK API Reference#Retrieving ID3 Tags|Browser SDK API Reference - Retrieving ID3 Tags]] section to know more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - end ===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Call [[end (Browser)]] only at the end of playback, or if the stream is interrupted.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;nSdkInstance.ggPM(&amp;quot;end&amp;quot;, playhead);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK DTVR Event Sequence ==&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The sample event lifecycle can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject); &lt;br /&gt;
nSdkInstance.ggPM('sendID3', ID3_Payload); //call sendID3 every 10 seconds and stop calling during any playback interruptions&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
&lt;br /&gt;
'''Example Production Initialization Call'''&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;nlsnInstance&amp;quot;, { optout: &amp;quot;false&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DTVR_Android_SDK&amp;diff=4225</id>
		<title>DTVR Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DTVR_Android_SDK&amp;diff=4225"/>
		<updated>2020-06-23T17:10:21Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
If the content being played contains ID3 tags, when played on a mobile device or within a browser, these tags can be sent to Nielsen for collection/processing via the Nielsen SDK.  &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
VOD in TV Ratings (formally knows as Recently Telecast VOD) support is now available; however, you must notify us to ensure accurate reporting.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&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: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|-&lt;br /&gt;
 || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[Android SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If need App ID(s) or our SDKs, feel free to reach out to us and we will be happy to help you get started.&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 Android using Android Studio utilizing the Standard Nielsen SDK for DTVR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The 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;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click “+” button and select &amp;lt;code&amp;gt;“com.google.android.gms:play-services”&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &lt;br /&gt;
* Add the following permissions on the project’s ''AndroidManifest.xml'' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; android:required=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more details to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
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 Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you. || Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Debug flag for development environment ====&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;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;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;) 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;
*The integration of Nielsen App SDK will depend on type of client app.&lt;br /&gt;
*Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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;
== Content Metadata and SDK Events ==&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| &lt;br /&gt;
|-&lt;br /&gt;
| adModel	|| linear vs dynamic ad model	|| 1 = Linear  matches TV ad load      || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    &lt;br /&gt;
    //Loading Channel Info.&lt;br /&gt;
    public JSONObject loadChannelInfo(){&lt;br /&gt;
        JSONObject channel = null;&lt;br /&gt;
        try {&lt;br /&gt;
        channel = new JSONObject()&lt;br /&gt;
                .put(&amp;quot;channelName&amp;quot;, &amp;quot;ChannelTitle&amp;quot;);&lt;br /&gt;
        } catch (JSONException e) {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        return  channel;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
------------------------&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;   &lt;br /&gt;
    public JSONObject loadDtvr() {&lt;br /&gt;
     try {&lt;br /&gt;
            dtvr = new JSONObject()&lt;br /&gt;
                    .put( &amp;quot;type&amp;quot;,&amp;quot;content&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;adModel&amp;quot;, &amp;quot;1&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        return dtvr;&lt;br /&gt;
    }&lt;br /&gt;
    &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset to pass type and adModel.&lt;br /&gt;
|-&lt;br /&gt;
|'play'||||Call when starting or resuming a streaming session. '''Note:''' Not required starting at SDK version 7.2.0 or higher.&lt;br /&gt;
|-&lt;br /&gt;
| 'sendID3'	|| Used to send the ID3 tag payload retrieved from the stream || Needs to be called at the beginning of playback&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
'''Note:'''no longer required for SDK version 7.2 or higher.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - play ===&lt;br /&gt;
Call play at start of new stream:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  appSdk.play();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' no longer required for SDK version 7.2 or higher.&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - loadMetadata ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; to pass ‘content’ and ‘ad’ &amp;lt;code&amp;gt;Digital Measurement Metadata&amp;lt;/code&amp;gt;. The CMS data must be passed as a JSON object.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; appSdk.loadMetadata(data);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - sendID3 ===&lt;br /&gt;
[[sendID3]] API is a receiver for timed metadata events (ID3 tags. This API filters out Nielsen-specific ID3 tags from the system and buffers the data for transfer to Nielsen’s collection facility.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; //Sending ID3 tag to SDK.&lt;br /&gt;
appSdk.sendID3(id3String);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Sample ID3 tags''' &lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/X100zdCIGeIlgZnkYj6UvQ==/AAAB2Jz2_k74GXSzx4npHuI_&amp;lt;wbr /&amp;gt;JwJd3QSUpW30rDkGTcbHEzIMWleCzM-uvNOP9fzJcQMWQLJqzXMCAxParOb5sGijSV9dNM3QiBniJYGZ5GI-lL1fXTTN0IgZ4iWBmeRiPpS9AAAAAAAAAAAAAAAAAAAAAFJWFM5SVhTONNU=/00000/00000/00&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/R8WHe7pEBeqBhu8jTeXydg==/AAICoyitYqlxT7n6aZ0oMCGhe&amp;lt;wbr /&amp;gt;Fi4CXFp46AMUPZz1lMr_M9tr3_cjee1SHqxrOiVerMDLeyn9xzocZSKwi746Re8vNOtpNCAZjYABs_J0R25IHpvOc1HS8&amp;lt;wbr /&amp;gt;QHGgD5TgOJeS6gX100zdCIGeIlgZnkYj6UvVJWFNhSVhTiPE0=/00000/46016/00&amp;lt;/code&amp;gt;&lt;br /&gt;
Refer to [[Android SDK API Reference#Retrieving ID3 Tags|Retrieving ID3 Tags]] section to know more details.&lt;br /&gt;
&lt;br /&gt;
===Configure API calls - stop ===&lt;br /&gt;
Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; in case of interruptions during playback like flight mode, Wi-Fi toggle, etc. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' no longer required for SDK version 7.2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Retrieving ID3 Tags ==&lt;br /&gt;
ID3 tags have a payload of about 249 characters and start with &amp;quot;www.nielsen.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===  Examples of extracting ID3 tags fromAndroid Native Media Player ===&lt;br /&gt;
As the Android Media Player versions (prior to Android 6 / Android API 23) do not support ID3, Nielsen has created a library that becomes an extension to the media player, thus MPX. This library extracts the ID3 tags and sends them to the app. For more information on how to use the MPX component, refer to the Nielsen-supplied sample application.&lt;br /&gt;
&lt;br /&gt;
Starting from '''Android 6 (Android API 23)''', Android Native Media Player allows apps to register a callback to be invoked, when a selected track has the timed metadata available. Currently, only HTTP Live Streaming (HLS) data URI’s embedded with timed ID3 tags generate TimedMetadata. Once the HLS video starts, call onTimedMetaDataAvailable() as and when the player observes a TimedMetadata (ID3 tag).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;@Override&lt;br /&gt;
    public void onTimedMetaDataAvailable(MediaPlayer mediaPlayer, TimedMetaData timedMetaData) {&lt;br /&gt;
&lt;br /&gt;
        if(timedMetaData != null &amp;amp;&amp;amp; timedMetaData.getMetaData() != null &amp;amp;&amp;amp; mMediaPlayer.isPlaying()){&lt;br /&gt;
&lt;br /&gt;
            //getting metadata.&lt;br /&gt;
            String iD3Payload = new String(timedMetaData.getMetaData(), StandardCharsets.UTF_8);&lt;br /&gt;
&lt;br /&gt;
            //If tag metadata contains &amp;quot;www.nielsen.com&amp;quot;, then only sending to SDK&lt;br /&gt;
            if (null != iD3Payload &amp;amp;&amp;amp; iD3Payload.contains(&amp;quot;www.nielsen.com&amp;quot;))&lt;br /&gt;
            {&lt;br /&gt;
                //getting index&lt;br /&gt;
                int index = iD3Payload.indexOf(&amp;quot;www.nielsen.com&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
                //getting substring as ID3 tag will be of 249 characters&lt;br /&gt;
                String id3String = iD3Payload.substring(index, (index + 249));&lt;br /&gt;
                Log.d(TAG, &amp;quot;TimedMetaData ID3 Tag:&amp;quot; + id3String);&lt;br /&gt;
&lt;br /&gt;
                //Sending ID3 tag to SDK.&lt;br /&gt;
                appSdk.sendID3(id3String);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; call moves the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;   ''(This is testing purposes only. Not for User Opt-Out.)''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call &amp;lt;/code&amp;gt;stop&amp;lt;/code&amp;gt; to stop the measurement.&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states ==&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class] is compatible with Android 4+ and has been made available to Nielsen clients.&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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&lt;br /&gt;
&lt;br /&gt;
== Interruptions during playback ==&lt;br /&gt;
As part of integrating Nielsen App SDK with the player application, the 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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are two primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen Android SDK versions (&amp;lt; 5.1.1.18)&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the Android's ''Opt out of Ads Personalization'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Opt out of Ads Personalization&amp;quot;'' (&amp;quot;Limit Ad Tracking&amp;quot; for iOS) setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen Android '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen Android SDK 5.1.1.18 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the current Nielsen opt-out URL via [[userOptOutURLString()]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[userOptOutURLString()]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut()]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=java&amp;gt;appSdk.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;);  // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Legacy Opt Out example code ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
WebView webView;&lt;br /&gt;
AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_OUT = &amp;quot;nielsenappsdk://1&amp;quot;;&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_IN = &amp;quot;nielsenappsdk://0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
//  Within your app you would provide your User the option to Opt Out.&lt;br /&gt;
//  Perhaps via a toggle or button&lt;br /&gt;
//  This is separate from Limit Ad Tracking &lt;br /&gt;
&lt;br /&gt;
      let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Retrieve current Opt-Out preference ===&lt;br /&gt;
Whether the user is opted out viaOS-level Opt-out or via App-level Opt-out, the current Opt-Out status as detected by the SDK is available via the [[getOptOutStatus()]] property in the Nielsen Android SDK API,&lt;br /&gt;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/us/en/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    WebView webView;&lt;br /&gt;
    AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onCreate(@Nullable Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_optout);&lt;br /&gt;
        webView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
&lt;br /&gt;
        webView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
        webView.setWebViewClient(new WebViewClient() {&lt;br /&gt;
            @SuppressWarnings(&amp;quot;deprecation&amp;quot;)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {&lt;br /&gt;
                Toast.makeText(OptOutActivity.this, description, Toast.LENGTH_SHORT).show();&lt;br /&gt;
            }&lt;br /&gt;
            @TargetApi(android.os.Build.VERSION_CODES.M)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, WebResourceRequest req, WebResourceError rerr) {&lt;br /&gt;
                // Redirect to deprecated method, so you can use it in all SDK versions&lt;br /&gt;
                onReceivedError(view, rerr.getErrorCode(), rerr.getDescription().toString(), req.getUrl().toString());&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
        //Getting the optPut URL from eventTracker&lt;br /&gt;
        String url = appSdk.userOptOutURLString();&lt;br /&gt;
        webView.loadUrl(url);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen API using a standard no-frills player.&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is contained in the ZIP package.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DTVR_iOS_SDK&amp;diff=4224</id>
		<title>DTVR iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DTVR_iOS_SDK&amp;diff=4224"/>
		<updated>2020-06-23T17:09:48Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
If the content being played contains ID3 tags, when played on a mobile device or within a browser, these tags can be sent to Nielsen for collection/processing via the Nielsen SDK.  &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
VOD in TV Ratings (formally knows as Recently Telecast VOD) support is now available; however, you must notify us to ensure accurate reporting.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&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: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|-&lt;br /&gt;
 || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[iOS SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode utilizing the Standard Nielsen SDK for DTVR.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
Prior to SDK Version 6.2.0.0 the  IOS framework has been distributed as a static library packaged into framework bundle format. Apple recommends to use dynamic framework, it has some benefits over static libraries like less executable file size of an app, faster startup time and native support in xCode IDE. Nielsen AppSDK has been transformed into dynamic framework in this release ([[iOS_Static_Framework_Setup|static framework]] is still available).&lt;br /&gt;
&lt;br /&gt;
If migrating from the static library to this new dynamic framework, once implemented, unless your specific application requires, you can remove the following Frameworks that were once required:&amp;lt;code&amp;gt; [AdSupport, JavascriptCore, SystemConfiguration, Security, AVFoundation, libc++] &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Dynamic framework is created as a fat framework. It means that it contains slices required for devices (armv7, arm64) as well as slices required for simulators (i386, x86_64). Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore. The example of the shell script that should be added as a Run Script phase in the application can be [[DCR_Video_iOS_SDK#Removing_Simulators|found below]].&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;
&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, when using the dynamic framework,  all the required frameworks are linked automatically as the are needed.  More details can be found here: https://stackoverflow.com/questions/24902787/dont-we-need-to-link-framework-to-xcode-project-anymore&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;
=== Download Framework ===&lt;br /&gt;
The first step is to download and copy the [[Special:Downloads|NielsenAppApi.framework]] bundle to the app project directory. (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Framework ===&lt;br /&gt;
In the General tab for app configuration add NielsenAppApi.framework in the list of Embedded Binaries.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Path ===&lt;br /&gt;
Add path to the NielsenAppApi.framework in the Framework Search Paths build setting.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Import Framework ===&lt;br /&gt;
Add NielsenAppApi.framework module in the source file of your app:&lt;br /&gt;
&lt;br /&gt;
==== Using Swift ====&lt;br /&gt;
Add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&amp;lt;/syntaxhighlight&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 NielsenAppApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. [[Dual_Instances_of_SDK|(Click here for an example of multiple instances)]]&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 Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you. || Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
&lt;br /&gt;
== Content Metadata and SDK Events ==&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode or live stream.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| &lt;br /&gt;
|-&lt;br /&gt;
| adModel	|| linear vs dynamic ad model	|| 1 = Linear  matches TV ad load      || ✓&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
- (NSDictionary *)loadChannelInfo&lt;br /&gt;
{&lt;br /&gt;
    //Loading Channel Info.    &lt;br /&gt;
    NSString *strUrl = self.url.absoluteString;  &lt;br /&gt;
    NSDictionary *channel = @{  @&amp;quot;channelName&amp;quot; : @&amp;quot;TheGreatBigMovie&amp;quot;: strUrl };   &lt;br /&gt;
    return channel;&lt;br /&gt;
}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objectivec&amp;quot;&amp;gt;    &lt;br /&gt;
- (NSDictionary *)loadDtvr{&lt;br /&gt;
    &lt;br /&gt;
    //Loading DTVR data  &lt;br /&gt;
    NSDictionary *dtvr = @{ @&amp;quot;adModel&amp;quot;:@&amp;quot;1&amp;quot; ,  &lt;br /&gt;
                            @&amp;quot;type&amp;quot;:@&amp;quot;content&amp;quot;,};  &lt;br /&gt;
    return dtvr;&lt;br /&gt;
}&lt;br /&gt;
    &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Events ===&lt;br /&gt;
&amp;lt;!--[[File:appsdkTimeline-DTVR-V2.png|icon]]--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset to pass type and adModel.&lt;br /&gt;
|-&lt;br /&gt;
|'play'||||Call when starting or resuming a streaming session. &lt;br /&gt;
'''Note:'''no longer required for SDK version 7.2 or higher.&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
'''Note:'''no longer required for SDK version 7.2 or higher.&lt;br /&gt;
|-&lt;br /&gt;
| 'sendID3'	|| Used to send the ID3 tag payload retrieved from the stream || Needs to be called at the beginning of playback&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - play ===&lt;br /&gt;
Call at start of new stream:&lt;br /&gt;
&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:()];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' no longer required for SDK version 7.2 or higher.&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - loadMetadata ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; to pass ‘content’ and ‘ad’ &amp;lt;code&amp;gt;Digital Measurement Metadata&amp;lt;/code&amp;gt;. The CMS data must be passed as a JSON object.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi loadMetadata:(loadDtvr)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(loadDtvr)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - sendID3 ===&lt;br /&gt;
[[sendID3]] API is a receiver for timed metadata events (ID3 tags) provided through iOS’s NSNotificationCenter notification system. This API filters out Nielsen-specific ID3 tags from the system and buffers the data for transfer to Nielsen’s collection facility.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi sendID3:extraString];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; [nielsenApi sendID3:extraString];&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
'''Sample ID3 tags''' &lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/X100zdCIGeIlgZnkYj6UvQ==/AAAB2Jz2_k74GXSzx4npHuI_&amp;lt;wbr /&amp;gt;JwJd3QSUpW30rDkGTcbHEzIMWleCzM-uvNOP9fzJcQMWQLJqzXMCAxParOb5sGijSV9dNM3QiBniJYGZ5GI-lL1fXTTN0IgZ4iWBmeRiPpS9AAAAAAAAAAAAAAAAAAAAAFJWFM5SVhTONNU=/00000/00000/00&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;www.nielsen.com/X100zdCIGeIlgZnkYj6UvQ==/R8WHe7pEBeqBhu8jTeXydg==/AAICoyitYqlxT7n6aZ0oMCGhe&amp;lt;wbr /&amp;gt;Fi4CXFp46AMUPZz1lMr_M9tr3_cjee1SHqxrOiVerMDLeyn9xzocZSKwi746Re8vNOtpNCAZjYABs_J0R25IHpvOc1HS8&amp;lt;wbr /&amp;gt;QHGgD5TgOJeS6gX100zdCIGeIlgZnkYj6UvVJWFNhSVhTiPE0=/00000/46016/00&amp;lt;/code&amp;gt;&lt;br /&gt;
Refer to [[iOS SDK API Reference#Retrieving ID3 Tags|Retrieving ID3 Tags]] section to know more details.&lt;br /&gt;
&lt;br /&gt;
=== Configure API calls - stop ===&lt;br /&gt;
Call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; in case of interruptions during playback like flight mode, Wi-Fi toggle, etc. &lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi.stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' no longer required for SDK version 7.2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Retrieving ID3 Tags ==&lt;br /&gt;
ID3 tags have a payload of about 249 characters and start with &amp;quot;www.nielsen.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
ID3 tags are extracted by observing a property called timedMetadata on the iOS player item. Now this is done via a concept called KVO (Key Value Observing), where you register interest in a property, and the runtime will let you know when it has changed.&lt;br /&gt;
&lt;br /&gt;
Both the iOS native players have the ability to extract ID3 tags, If any other player apart from iOS native players (AVPlayer, MPMoviePlayer) is used, check and ensure that the player has the capability to extract ID3 tags.&lt;br /&gt;
&lt;br /&gt;
=== Examples of extracting ID3 tags from the iOS Native Player ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
    //Adding observer to player to track play,pause and reverse&lt;br /&gt;
    [player addObserver:self&lt;br /&gt;
             forKeyPath:@&amp;quot;rate&amp;quot;&lt;br /&gt;
                options:(NSKeyValueObservingOptionNew)&lt;br /&gt;
                context:nil];&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;
        //Setting observer to track timedMetadata&lt;br /&gt;
        [player addObserver:self&lt;br /&gt;
                 forKeyPath: timedMetadataKey&lt;br /&gt;
                    options: (NSKeyValueObservingOptionNew)&lt;br /&gt;
                    context: &amp;amp;TimedMetadataObserverContext];&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;
- (void)observeValueForKeyPath:(NSString *)keyPath&lt;br /&gt;
                      ofObject:(id)object&lt;br /&gt;
                        change:(NSDictionary *)change&lt;br /&gt;
                       context:(void *)context&lt;br /&gt;
{&lt;br /&gt;
    if(keyPath == timedMetadataKey){&lt;br /&gt;
        if(context == &amp;amp;TimedMetadataObserverContext){&lt;br /&gt;
            &lt;br /&gt;
            id newMetadataArray = [change objectForKey:NSKeyValueChangeNewKey];&lt;br /&gt;
            if (newMetadataArray != [NSNull null])&lt;br /&gt;
            {&lt;br /&gt;
                array = newMetadataArray;&lt;br /&gt;
                for (AVMetadataItem *metadataItem in array)&lt;br /&gt;
                {&lt;br /&gt;
                    //Handling TimedMetadata&lt;br /&gt;
                    [self handleTimedMetadata: metadataItem];&lt;br /&gt;
                }&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;
  &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;     &lt;br /&gt;
- (void)handleTimedMetadata:(AVMetadataItem *)timedMetadata&lt;br /&gt;
{&lt;br /&gt;
    // We expect the content to contain plists encoded as timed metadata&lt;br /&gt;
    // AVPlayer turns these into NSDictionaries&lt;br /&gt;
    &lt;br /&gt;
    id extraAttributeType = [timedMetadata extraAttributes];&lt;br /&gt;
    NSString *extraString = nil;&lt;br /&gt;
    if ([extraAttributeType isKindOfClass:[NSDictionary class]])&lt;br /&gt;
    {&lt;br /&gt;
        extraString = [extraAttributeType valueForKey:@&amp;quot;info&amp;quot;];&lt;br /&gt;
    }&lt;br /&gt;
    else if ([extraAttributeType isKindOfClass:[NSString class]])&lt;br /&gt;
    {&lt;br /&gt;
        extraString = extraAttributeType;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    NSString *key = [NSString stringWithFormat:@&amp;quot;%@&amp;quot;, [timedMetadata key]];&lt;br /&gt;
    &lt;br /&gt;
    //If tag starts with &amp;quot;www.nielsen.com&amp;quot;, then only sending to SDK&lt;br /&gt;
    if ([key isEqualToString:@&amp;quot;PRIV&amp;quot;] &amp;amp;&amp;amp; [extraString rangeOfString:@&amp;quot;www.nielsen.com&amp;quot;].length &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{&lt;br /&gt;
            [nielsenApi sendID3:extraString];&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
      //Setting observer to track timedMetadata&lt;br /&gt;
            player.addObserver(self, forKeyPath: timedMetadataKey, options: NSKeyValueObservingOptions.new, context: &amp;amp;TimedMetadataObserverContext)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
   override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {&lt;br /&gt;
        &lt;br /&gt;
        if keyPath == timedMetadataKey {&lt;br /&gt;
            if(context == &amp;amp;TimedMetadataObserverContext){&lt;br /&gt;
                if change != nil {&lt;br /&gt;
                    let timedMetadataArray = change![.newKey]&lt;br /&gt;
                    if timedMetadataArray != nil &amp;amp;&amp;amp; (timedMetadataArray! as AnyObject) is Array&amp;lt;Any&amp;gt; {&lt;br /&gt;
                        for item in timedMetadataArray as! [AVMetadataItem]  {&lt;br /&gt;
                            //Handling TimedMetadata&lt;br /&gt;
                            self.handleTimedMetadata(metadataItem: item)&lt;br /&gt;
                        }&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;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt; &lt;br /&gt;
 func handleTimedMetadata(metadataItem: AVMetadataItem) {&lt;br /&gt;
        guard let extraAttributeType = metadataItem.extraAttributes else {&lt;br /&gt;
            return&lt;br /&gt;
        }&lt;br /&gt;
        let info : AVMetadataExtraAttributeKey = AVMetadataExtraAttributeKey(rawValue: &amp;quot;info&amp;quot;)&lt;br /&gt;
        let extraString = extraAttributeType[info] as AnyObject&lt;br /&gt;
        let key = metadataItem.key as! String&lt;br /&gt;
        &lt;br /&gt;
        //If tag starts with &amp;quot;www.nielsen.com&amp;quot;, then only sending to SDK&lt;br /&gt;
        if key == &amp;quot;PRIV&amp;quot; &amp;amp;&amp;amp; extraString.range(of: &amp;quot;www.nielsen.com&amp;quot;).length &amp;gt; 0 {&lt;br /&gt;
            &lt;br /&gt;
            DispatchQueue.global(qos: .default).async { () -&amp;gt; Void in&lt;br /&gt;
                self.nielsenApi?.sendID3(extraString as! String)&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;
&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. For DTVR, the &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; call moves the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;   ''(This is testing purposes only.  Not for User Opt-Out.)''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; to stop the measurement.&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states ==&lt;br /&gt;
For iOS, background/foreground detection is handled by the app lifecylce APIs which are provided by [https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html Apple:]&lt;br /&gt;
&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement.&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 &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;
* Call &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; once the playback resumes.&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:iOS_Privacy_and_Opt-Out}}&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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen Simplified API integrated into a custom video player is contained in the ZIP package.&lt;br /&gt;
&lt;br /&gt;
== Testing an Implementation - App ==&lt;br /&gt;
See [[Digital Measurement Testing]].&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=4223</id>
		<title>DCR Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Browser_SDK&amp;diff=4223"/>
		<updated>2020-06-23T17:08:25Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
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;
|-&lt;br /&gt;
|| ☑ || '''App ID (apid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&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;
!function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {&lt;br /&gt;
  nol_sdkDebug: &amp;quot;debug&amp;quot;,&lt;br /&gt;
  optout: &amp;quot;false&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The static queue snippet allows the SDK APIs to be called while the actual SDK and configuration file are still being downloaded. As the queue can capture all API calls before the download completes, there is no wait time. Once the SDK is available, the API calls will transition from directing to the queue to the SDK seamlessly.&lt;br /&gt;
&lt;br /&gt;
===Create SDK Instance===&lt;br /&gt;
To initialize the SDK, create an SDK instance by making the initialization call:&lt;br /&gt;
&lt;br /&gt;
==== Initialization API Call ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
NOLBUNDLE.nlsQ(&amp;quot;&amp;lt;apid&amp;gt;&amp;quot;, &amp;quot;&amp;lt;instanceName&amp;gt;&amp;quot;,{nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When creating an instance, pass the following values: (&amp;lt;code&amp;gt;nol_sdkDebug&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;optout&amp;lt;/code&amp;gt; are 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;
| 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 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;
{nol_sdkDebug: &amp;quot;info&amp;quot;}&lt;br /&gt;
{nol_sdkDebug: &amp;quot;warn&amp;quot;}&lt;br /&gt;
{nol_sdkDebug: &amp;quot;true&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|optout || Optional: OptOut global parameter. || &amp;lt;code&amp;gt;1/0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;true/false&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example SDK Initialization ====&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;
More information on OptOut Parameter under [[DCR Video Browser SDK#Privacy_and_Opt-Out|Privacy and Opt-Out.]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==== Example SDK Initialization with Viewability ====&lt;br /&gt;
If you decide to implement the Nielsen Viewability Module, the SDK will track the viewability of the targeted player/element, log the viewable percentage and record in seconds the time the player/element was in that viewable state.  The only additional information required is the HTML element ID of the element being tracked (which is passed during SDK Initialization), and the volume level (passed as an event).&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;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {&lt;br /&gt;
  nol_sdkDebug: &amp;quot;debug&amp;quot;,&lt;br /&gt;
  optout: &amp;quot;false&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no &amp;quot;volume&amp;quot; event is passed, a default value of '1' will be used. (IE: 100%).  If the volume level is adjusted, the modified value can be passed to the SDK using the standard ggPM() API along with the new &amp;quot;volume&amp;quot; event.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;volume&amp;quot;, &amp;lt;volume level&amp;gt;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event Name	!! Event #	!! Purpose !! Possible Values !!Example&lt;br /&gt;
|-&lt;br /&gt;
| volume	|| 61  ||ggPM event that will allow clients to pass in the volume levels.	||Supports decimal values in range from 0 - 1||instance.ggPM(&amp;quot;61&amp;quot;, 0); =&amp;gt; muted&lt;br /&gt;
instance.ggPM(&amp;quot;61&amp;quot;, .5) =&amp;gt; not muted&lt;br /&gt;
intance.ggPM(&amp;quot;61&amp;quot;, 1) =&amp;gt; not muted&lt;br /&gt;
|}&lt;br /&gt;
Sample:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM(&amp;quot;volume&amp;quot;, 0); // muted&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example SDK Configuration ===&lt;br /&gt;
&lt;br /&gt;
The configuration should include the Static Queue Snippet and an SDK Instance for an unique App ID as shown in the example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
// Add Static Queue Snippet&lt;br /&gt;
 !function(t,n)&lt;br /&gt;
{&lt;br /&gt;
  t[n]=t[n]||&lt;br /&gt;
  {&lt;br /&gt;
    nlsQ:function(e,o,c,r,s,i)&lt;br /&gt;
    {&lt;br /&gt;
     return s=t.document,&lt;br /&gt;
     r=s.createElement(&amp;quot;script&amp;quot;),&lt;br /&gt;
     r.async=1,&lt;br /&gt;
     r.src=(&amp;quot;http:&amp;quot;===t.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+e+&amp;quot;.js#name=&amp;quot;+o+&amp;quot;&amp;amp;ns=&amp;quot;+n,&lt;br /&gt;
     i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0],&lt;br /&gt;
     i.parentNode.insertBefore(r,i),&lt;br /&gt;
     t[n][o]=t[n][o]||{g:c||{},&lt;br /&gt;
     ggPM:function(e,c,r,s,i){(t[n][o].q=t[n][o].q||[]).push([e,c,r,s,i])}},t[n][o]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
// Created SDK Instance&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, {nol_sdkDebug: &amp;quot;debug&amp;quot;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create Metadata Objects ===&lt;br /&gt;
There are two types of asset metadata:&lt;br /&gt;
*content: identify video&lt;br /&gt;
*ad: identify each ad&lt;br /&gt;
&lt;br /&gt;
The metadata received for each asset is used for classification and reporting.&lt;br /&gt;
&lt;br /&gt;
Metadata can be passed through key-values using the Nielsen reserved keys. User will need to set up content and ad objects with the required Nielsen keys as shown in the sample code below.&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
==== Example Content Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  airdate:        '20210321 09:00:00',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  adloadtype:     '2',&lt;br /&gt;
  segB:           'custom segment B', // optional&lt;br /&gt;
  segC:           'custom segment C', // optional&lt;br /&gt;
  crossId1:       'Standard Episode ID', // optional&lt;br /&gt;
  crossId2:       'Content Originator' //optional&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&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;'preroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;'ad'&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	|| ✓&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:    'preroll',&lt;br /&gt;
  assetid: 'AD-1'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt; URL Character Limit: There is a URL character limit of 2K characters due to browser limitations. Exceeding this value could impair data delivery on particular browsers. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Call Nielsen APIs ====&lt;br /&gt;
The method for calling events is ggPM().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
nSdkInstance.ggPM('event', parameter, ...);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interrupt Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Pause Event ===&lt;br /&gt;
The setPlayheadPostion event is used for handling pause. To indicate pause, stop passing the playhead position to the SDK. Once the content resumes, begin sending the playhead again with the correct playhead value.&lt;br /&gt;
&lt;br /&gt;
=== Other Interrupt Scenarios ===&lt;br /&gt;
The following possible browser interruption scenarios must be handled:&lt;br /&gt;
&lt;br /&gt;
* Browser/Tab close&lt;br /&gt;
* Leaving the page to another destination&lt;br /&gt;
* Pressing the stop button&lt;br /&gt;
* Network Loss&lt;br /&gt;
&lt;br /&gt;
There are many cases where the player itself has the ability to detect such situations. If not, these interruption scenarios can be handled through JavaScript. The events that are called will depend on the asset being played (e.g. midroll vs. content).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
window.addEventListener('beforeunload', function(event) &lt;br /&gt;
{&lt;br /&gt;
  // Only inside a midroll indicate &amp;lt;stop&amp;gt; for the ad&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
  &lt;br /&gt;
  // Indicate &amp;lt;end&amp;gt; and &amp;lt;stop&amp;gt; for the content&lt;br /&gt;
  nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
  nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' User may need to add code to support specific browser versions (e.g. older versions of Internet Explorer).&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current Unix timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position in seconds	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK Playhead Event Sequence ==&lt;br /&gt;
The sample event lifecycles can be used as a reference for identifying the order for calling events.&lt;br /&gt;
&lt;br /&gt;
=== Content Playback ===&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;
// CONTENT PLAYS&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;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Content Playback 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); &lt;br /&gt;
 &lt;br /&gt;
// PREROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', prerollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', contentMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&lt;br /&gt;
// MIDROLL&lt;br /&gt;
nSdkInstance.ggPM('loadMetadata', midrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// CONTENT RESUMES&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;
// END OF STREAM&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('end', playheadPosition);&lt;br /&gt;
 &lt;br /&gt;
// POSTROLL&lt;br /&gt;
nSdkInstance.ggPM('loadmetadata', postrollMetadataObject);&lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
//  &lt;br /&gt;
//   pass playhead every second&lt;br /&gt;
//   &lt;br /&gt;
nSdkInstance.ggPM('setPlayheadPosition', playheadPosition);&lt;br /&gt;
nSdkInstance.ggPM('stop', playheadPosition);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
* 'setPlayheadPosition' is used for calculating duration and must be passed every second. The final playhead position must be sent for the current asset being played before calling 'stop', 'end', or 'loadmetadata'.&lt;br /&gt;
&lt;br /&gt;
* For Ad Pods, events must be called for each individual Ad. Each Ad playhead position should begin at ‘0’ when ad starts.&lt;br /&gt;
&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where previous content segment left off. The playhead position should be passed as a rounded number with no decimals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;br /&gt;
&lt;br /&gt;
== Going Live ==&lt;br /&gt;
After the integration has been certified, users will need to make a couple of updates to the initialization call to ensure that player will be measured properly.&lt;br /&gt;
Disable debug logging by deleting {nol_sdkDebug: 'DEBUG'} from initialization call.&lt;br /&gt;
&lt;br /&gt;
'''Example Production Initialization Call'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;nlsnInstance&amp;quot;, { optout: &amp;quot;false&amp;quot;});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4222</id>
		<title>DCR Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4222"/>
		<updated>2020-06-23T17:07:15Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|-&lt;br /&gt;
 || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[Android SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If need App ID(s) or our SDKs, feel free to reach out to us and we will be happy to help you get started.&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 Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The 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;
&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
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 Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you. || Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;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;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- == Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;) &lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20200321 20:00:00&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;adloadtype&amp;quot;, &amp;quot;2&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional   &lt;br /&gt;
    .put(&amp;quot;crossId1&amp;quot;, &amp;quot;Standard Episode ID&amp;quot;)  //optional  &lt;br /&gt;
    .put(&amp;quot;crossId2&amp;quot;, &amp;quot;Content Originator&amp;quot;)  //optional  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type 	|| type of Ad	||  &amp;lt;code&amp;gt;'preroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;'ad'&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	|| ✓&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;
// 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;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play];&amp;lt;/code&amp;gt; || // call at start of each new stream&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 setplayheadPosition: 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;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'play'	|| 	|| Call at start of each new stream&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current Unix timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call during any interruption to content or Ad playback and at the end of each Ad.&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: For livestream, send the Unix timestamp; for VOD send the time in seconds as integer. The final playhead position must be sent for the current asset being played before calling &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; or&amp;lt;code&amp;gt; '''loadmetadata'''&amp;lt;/code&amp;gt;,.&amp;lt;/blockquote&amp;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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – Call when content completes. When called, the SDK instance exits from Processing state.&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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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()]] 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 / stop.&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;
| rowspan=&amp;quot;2&amp;quot; | Resume Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt;  || // Call loadMetadata and pass content metadata object when content resumes&lt;br /&gt;
|- &lt;br /&gt;
|&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 Advertisements ====&lt;br /&gt;
Call [[play()]] &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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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;
'''Ad Content'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    long pos = mAdPlayer.videoPosition() / 1000;&lt;br /&gt;
   if (mAppSdk != null)&lt;br /&gt;
   {&lt;br /&gt;
     mAppSdk.setPlayheadPosition(pos);&lt;br /&gt;
   }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: The playhead positions for ad and content should be maintained separately.&amp;lt;/blockquote&amp;gt;&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(); &amp;lt;/code&amp;gt; || // stream starts&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;3&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; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content Resumes || &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;1&amp;quot; | 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 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;
* Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
* Utilizing the [[DCR_Video_Android_SDK#The_SdkBgFgDetectionUtility_class|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 provides 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;
==== 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;
&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;
&amp;lt;blockquote&amp;gt;&lt;br /&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, can do so by calling the following newly introduced AppSdk public api, passing the application context :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public static void registerLifeCycleObserver(Context applicationContext)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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;
&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&lt;br /&gt;
== Using the NielsenAppSDKJSHandler ==&lt;br /&gt;
There could be a scenario in which a browser page, that is already tagged with the Nielsen BSDK, needs to be loaded via a webview.  In this situation it is recommended to use the '''NielsenAppSDKJSHandler''' which will allow communication between the AppSDK and the BSDK. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''This feature is supported in versions 7.2 and above.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
* Make sure you have the latest AppSdk.jar from Nielsen&lt;br /&gt;
* Enable the javascript on webview using below lines&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
 &amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
WebSettings webSetting = webView.getSettings();&lt;br /&gt;
webSetting.setJavaScriptEnabled(true);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Add  NielsenAppSDKJSHandler instance as javascript interface to webview with name “NielsenAppSDK” like below snippet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
webView.addJavascriptInterface(new NielsenAppSDKJSHandler(getApplicationContext()), &amp;quot;NielsenAppSDK&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will enable listening to BSDK api calls within the APPSDK.  Please make sure your Technical Account Manager is aware that you wish to implement this method so a configuration file can be modified on the Nielsen servers; however, there are '''no changes required to the Browser page'''.&lt;br /&gt;
&lt;br /&gt;
==== Example:====&lt;br /&gt;
The below is an example of opening a webview with the NielsenApp[SDKJSHandler&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
      WebSettings webSetting = webView.getSettings();&lt;br /&gt;
      webView.getSettings().setDomStorageEnabled(true); &lt;br /&gt;
      webSetting.setJavaScriptEnabled(true);&lt;br /&gt;
      webView.addJavascriptInterface(new NielsenAppSDKJSHandler(getApplicationContext(), &amp;quot;&amp;quot;), &amp;quot;NielsenAppSDK&amp;quot;);&lt;br /&gt;
      String url = &amp;quot;https://nielsen.com.index.htm&amp;quot;;&lt;br /&gt;
      webView.loadUrl(url);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;AndroidManifest.xml&amp;lt;/code&amp;gt; may need the following permissions set:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&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;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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 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 &lt;br /&gt;
* App going in the Background/Foreground&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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:Android_Privacy_and_Opt-Out}}&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_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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_iOS_SDK&amp;diff=4221</id>
		<title>DCR Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_iOS_SDK&amp;diff=4221"/>
		<updated>2020-06-23T17:06:20Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__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, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
 || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Provided by Nielsen&lt;br /&gt;
|-&lt;br /&gt;
 || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[iOS SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If need App ID(s) or our SDKs, feel free to reach out to us and we will be happy to help you get started.&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 utilizing the Standard Nielsen SDK for DCR.&lt;br /&gt;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
Prior to SDK Version 6.2.0.0 the  IOS framework has been distributed as a static library packaged into framework bundle format. Apple recommends to use dynamic framework, it has some benefits over static libraries like less executable file size of an app, faster startup time and native support in xCode IDE. Nielsen AppSDK has been transformed into dynamic framework in this release ([[iOS_Static_Framework_Setup|static framework]] is still available).&lt;br /&gt;
&lt;br /&gt;
If migrating from the static library to this new dynamic framework, once implemented, unless your specific application requires, you can remove the following Frameworks that were once required:&amp;lt;code&amp;gt; [AdSupport, JavascriptCore, SystemConfiguration, Security, AVFoundation, libc++] &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Dynamic framework''' is created as a fat framework. It means that it contains slices required for devices (armv7, arm64) as well as slices required for simulators (i386, x86_64). Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore. The example of the shell script that should be added as a Run Script phase in the application can be [[DCR_Video_iOS_SDK#Removing_Simulators_.28Dynamic_Framework_Only.29|found below]].&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;
&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, when using the dynamic framework,  all the required frameworks are linked automatically as the are needed.  More details can be found here: https://stackoverflow.com/questions/24902787/dont-we-need-to-link-framework-to-xcode-project-anymore&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;
=== Download Framework ===&lt;br /&gt;
The first step is to download and copy the [[Special:Downloads|NielsenAppApi.framework]] bundle to the app project directory. (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Framework ===&lt;br /&gt;
In the General tab for app configuration add NielsenAppApi.framework in the list of Embedded Binaries.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Path ===&lt;br /&gt;
Add path to the NielsenAppApi.framework in the Framework Search Paths build setting.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Import Framework ===&lt;br /&gt;
Add NielsenAppApi.framework module in the source file of your app:&lt;br /&gt;
&lt;br /&gt;
==== Using Swift ====&lt;br /&gt;
Add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&amp;lt;/syntaxhighlight&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 NielsenAppApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. [[Dual_Instances_of_SDK|(Click here for an example of multiple instances)]]&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 Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you. || Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sample SDK Initialization Code ===&lt;br /&gt;
&lt;br /&gt;
====Swift 4.0 Example:====&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import Foundation&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&lt;br /&gt;
class NielsenInit : NSObject {&lt;br /&gt;
    class func createNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
        &lt;br /&gt;
        let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&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;
===Sample code using AVPlayer===&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, AVPlayerViewControllerDelegate  {&lt;br /&gt;
&lt;br /&gt;
// your code//    &lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&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;NielsenInit.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenEventTracker.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NielsenInit&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate&lt;br /&gt;
{    &lt;br /&gt;
    //Initialising the NielsenEventTracker class by passing app information which returns the instance of NielsenEventTracker.&lt;br /&gt;
    &lt;br /&gt;
    NSDictionary *appInformation = @{ @&amp;quot;appid&amp;quot;: @&amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&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;
&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;NielsenInit.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 NielsenAppApiDelegate;&lt;br /&gt;
&lt;br /&gt;
@interface NielsenInit : 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;
====Sample Code:====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@implementation ViewController&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
        &lt;br /&gt;
    //Getting the instance of Nielsen SDK&lt;br /&gt;
    nielsenApi = [NielsenInit createNielsenAppApiWithDelegate:nil];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
&lt;br /&gt;
== Configure Metadata ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Nielsen Key names (e.g. appid, program) are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
&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;C77664&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;Program S2, E3&amp;quot;,&lt;br /&gt;
    &amp;quot;isfullepisode&amp;quot;: &amp;quot;Yes&amp;quot;,&lt;br /&gt;
    &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
    &amp;quot;airdate&amp;quot;: &amp;quot;20200321 10:05:00&amp;quot;,&lt;br /&gt;
    &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
    &amp;quot;segB&amp;quot;: &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;segC&amp;quot;: &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;crossId1&amp;quot;: &amp;quot;Standard Episode ID&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;crossId2&amp;quot;: &amp;quot;Content Originator&amp;quot; //optional&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * contentMetadata = @ {&lt;br /&gt;
    @ &amp;quot;type&amp;quot;: @ &amp;quot;content&amp;quot;,&lt;br /&gt;
    @ &amp;quot;assetid&amp;quot;: @ &amp;quot;C77664&amp;quot;,&lt;br /&gt;
    @ &amp;quot;title&amp;quot;: @ &amp;quot;S2,E3&amp;quot;,&lt;br /&gt;
    @ &amp;quot;isfullepisode&amp;quot;: @ &amp;quot;y&amp;quot;,  &lt;br /&gt;
    @ &amp;quot;program&amp;quot;: @ &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    @ &amp;quot;length&amp;quot;: @ &amp;quot;3600&amp;quot;,&lt;br /&gt;
    @ &amp;quot;airdate&amp;quot;: @ &amp;quot;20200321 10:05:00&amp;quot;,&lt;br /&gt;
    @ &amp;quot;adloadtype&amp;quot;: @ &amp;quot;2&amp;quot;,&lt;br /&gt;
    @ &amp;quot;segB&amp;quot;: @ &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
    @ &amp;quot;segC&amp;quot;: @ &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
    @ &amp;quot;crossId1&amp;quot;: @ &amp;quot;Standard Episode ID&amp;quot;, //optional&lt;br /&gt;
    @ &amp;quot;crossId2&amp;quot;: @ &amp;quot;Content Originator&amp;quot; //optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Configure metadata === &lt;br /&gt;
channelName should remain constant throughout the completion of an episode or live stream.&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	|| ChannelInfo refers to the Channel name. This can be a free-form value&lt;br /&gt;
value such as a friendly name for the content being played. the SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
will pass the application name automatically.&lt;br /&gt;
|| custom	|| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type 	|| type of Ad	||  &amp;lt;code&amp;gt;'preroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;'ad'&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	|| ✓&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;
// 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;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Static Metadata if Applicable===&lt;br /&gt;
The below is to measure [[DCR Static iOS SDK|Static Content.]] &lt;br /&gt;
&lt;br /&gt;
The Nielsen reserved keys are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of each site (e.g. section value should be first level in page URL: website.com/section). Limit to 25 unique values || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segA || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
'''Aggregation Limits'''&lt;br /&gt;
There are limits on the number of unique values that can be aggregated on in reporting. The specific limitations by key are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Aggregation Limit&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segA || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segB || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|-&lt;br /&gt;
| segC || Maximum number of unique values allowed across segA, segB, and segC is 25 (segA + segB + segC&amp;lt;= 25)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Static Object ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&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;section&amp;quot;: &amp;quot;Section Name&amp;quot;,&lt;br /&gt;
                &amp;quot;segA&amp;quot;: &amp;quot;segmentA&amp;quot;,&lt;br /&gt;
                &amp;quot;segB&amp;quot;: &amp;quot;segmentB&amp;quot;,&lt;br /&gt;
                &amp;quot;segC&amp;quot;: &amp;quot;en-us&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
&amp;lt;!--[[File:appsdkTimeline-DCR.png|icon|link=]]--&amp;gt;&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;syntaxhighlight lang=Swift&amp;gt;&lt;br /&gt;
NielsenInit.createMainBrandApi(delegate: self)&lt;br /&gt;
self.data = loadStaticMetadata()&lt;br /&gt;
self.nielsenMeter .loadMetadata(self.data)&amp;lt;/syntaxhighlight&amp;gt; || // Pass Static Metadata here if applicable&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;nielsenMeter.play()&amp;lt;/code&amp;gt; || // Call at start of each new stream&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenMeter.loadMetadata(contentMetadata)&amp;lt;/code&amp;gt; || // MetadataObject contains the JSON metadata&amp;lt;br&amp;gt; for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;nielsenMeter.playheadPosition(pos);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead &amp;lt;br&amp;gt;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;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'play'	|| 	|| Call at start of each new stream&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'playheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current UNIX timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'PlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call during any interruption to content or Ad playback and at the end of each Ad.&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: For livestream, send the UNIX timestamp, for VOD send the time in seconds as integer. The final playhead position must be sent for the current asset being played before calling &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; or&amp;lt;code&amp;gt; '''loadmetadata'''&amp;lt;/code&amp;gt;,.&amp;lt;/blockquote&amp;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 '''Idle 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 an event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position is active.  If a LIVE event, use the current UNIX timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the content or Ad playback is interrupted and at the end of each Ad. &lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – Call when content completes. When called, the SDK instance exits from Processing state.&lt;br /&gt;
# '''Disabled state''' – The SDK instance is disabled and is not processing playing information. &lt;br /&gt;
## &amp;lt;code&amp;gt;'''appDisableApi'''&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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()]] 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 [[playheadPosition|playheadPosition()]] every one second until a pause / stop.&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;
| rowspan=&amp;quot;2&amp;quot; | Resume Content || &amp;lt;code&amp;gt;mAppSdk.loadMetadata(contentMetaDataObject);&amp;lt;/code&amp;gt;  || // Call loadMetadata and pass content metadata object when content resumes&lt;br /&gt;
|- &lt;br /&gt;
|&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 Advertisements ====&lt;br /&gt;
Call [[play()]] at start of stream&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;ad123&amp;quot;&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 / stop / another [[loadMetadata()]] is called. 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(); &amp;lt;/code&amp;gt; || // stream starts&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.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;
| rowspan=&amp;quot;3&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; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Content Resumes || &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 begin from 0 at ad start.  When content has resumed following an ad break, playhead position must continue from where previous content segment was left off.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Call &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; at the start of each new stream. If changing videos or watching a new video, call &amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt; each time. &lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenAppApi play:()];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenAppApi?.play();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi loadMetadata:(contentMetadata)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;self.nielsenAppApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-(void) setPlayHeadPosition {&lt;br /&gt;
    &lt;br /&gt;
    //Setting play head position&lt;br /&gt;
    CMTime timeInterval = CMTimeMakeWithSeconds(1, 1);&lt;br /&gt;
    [player addPeriodicTimeObserverForInterval:(timeInterval) queue:dispatch_get_main_queue() usingBlock:^(CMTime time){&lt;br /&gt;
        NSTimeInterval seconds = CMTimeGetSeconds(time);&lt;br /&gt;
        NSInteger intSec = seconds;&lt;br /&gt;
        &lt;br /&gt;
        //Sending data dictionary to SDK with updated playHead position.&lt;br /&gt;
        [nielsenApi playheadPosition:(intSec)];&lt;br /&gt;
    }];&lt;br /&gt;
}&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;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi.stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi.end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states ==&lt;br /&gt;
For iOS, background/foreground detection is handled by the app lifecylce APIs which are provided by [https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html Apple:]&lt;br /&gt;
&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement.&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 &lt;br /&gt;
* App going in the Background/Foreground &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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Start sending API calls – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Using the NielsenAppSDKJSHandler ==&lt;br /&gt;
There could be a scenario in which a browser page, that is already tagged with the Nielsen BSDK, needs to be loaded via a webview.  In this situation it is recommended to use the '''NielsenAppSDKJSHandler''' which will allow communication between the AppSDK and the BSDK. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''This feature is supported in versions 7.2 and above.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
* Make sure you have the latest NielsenAppApi.framework from Nielsen containing the NielsenAppSDKJSHandler class.&lt;br /&gt;
* Add NielsenAppSDKJSHandler instance as web view message handler object conforming to WKScriptMessageHandler protocol with name: &amp;quot;NielsenSDKMsg&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Objective-C:'''&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=Objective-c&amp;gt;&lt;br /&gt;
self.jsAppSDK = [[NielsenAppSDKJSHandler alloc] init];&lt;br /&gt;
[self.webView.configuration.userContentController addScriptMessageHandler:self.jsAppSDK name:@&amp;quot;NielsenSDKMsg&amp;quot;];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Swift:'''&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=Swift&amp;gt;&lt;br /&gt;
self.jsAppSDK=NielsenAppSDKJSHandler(apiType: &amp;quot;ggPM&amp;quot;)&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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will enable listening to BSDK api calls within the APPSDK.  Please make sure your Technical Account Manager is aware that you wish to implement this method so a configuration file can be modified on the Nielsen servers; however, there are '''no changes required to the Browser page'''.&lt;br /&gt;
&lt;br /&gt;
==== Example:====&lt;br /&gt;
The below is an example of opening a webview with the NielsenApp[SDKJSHandler using Swift 5.0&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
  let jsFunctionNativeMessage = &amp;quot;NielsenSDKMsg&amp;quot;&lt;br /&gt;
  var jsAppSDK: NielsenAppSDKJSHandler?&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;
        let url = URL(string: &amp;quot;https://nielsen.com/index.htm&amp;quot;)!&lt;br /&gt;
        self.jsAppSDK=NielsenAppSDKJSHandler(apiType: &amp;quot;ggPM&amp;quot;)&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;
            webView.load(URLRequest(url: url))&lt;br /&gt;
            webView.allowsBackForwardNavigationGestures = true&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
    deinit {&lt;br /&gt;
        if let webView = self.webView {&lt;br /&gt;
            webView.configuration.userContentController.removeScriptMessageHandler(forName: jsFunctionNativeMessage)&lt;br /&gt;
        }&lt;br /&gt;
        self.jsAppSDK = nil&lt;br /&gt;
        if let webView = self.webView {&lt;br /&gt;
            webView.removeFromSuperview()&lt;br /&gt;
        }&lt;br /&gt;
        self.webView = nil&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;
Please note:  The page you load into the webview cannot have mixed protocol content.  For example, if your page is https:// you cannot have any images on the page as http:// or you will encounter errors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:iOS_Privacy_and_Opt-Out}}&lt;br /&gt;
&lt;br /&gt;
== AirPlay ==&lt;br /&gt;
To implement OTT measurement, report OTT changes to the SDK using 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;
== 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;br /&gt;
&lt;br /&gt;
== Removing Simulators (Dynamic Framework Only)==&lt;br /&gt;
&lt;br /&gt;
Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore.  Here is an example Shell script that could be added as a Run Script phase in the application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='bash'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
APP_PATH=&amp;quot;${TARGET_BUILD_DIR}/${WRAPPER_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This script loops through the frameworks embedded in the application and&lt;br /&gt;
# removes unused architectures.&lt;br /&gt;
find &amp;quot;$APP_PATH&amp;quot; -name '*.framework' -type d | while read -r FRAMEWORK&lt;br /&gt;
do&lt;br /&gt;
FRAMEWORK_EXECUTABLE_NAME=$(defaults read &amp;quot;$FRAMEWORK/Info.plist&amp;quot; CFBundleExecutable)&lt;br /&gt;
FRAMEWORK_EXECUTABLE_PATH=&amp;quot;$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
echo &amp;quot;Executable is $FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
EXTRACTED_ARCHS=()&lt;br /&gt;
&lt;br /&gt;
for ARCH in $ARCHS&lt;br /&gt;
do&lt;br /&gt;
echo &amp;quot;Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
lipo -extract &amp;quot;$ARCH&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot; -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;&lt;br /&gt;
EXTRACTED_ARCHS+=(&amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;)&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Merging extracted architectures: ${ARCHS}&amp;quot;&lt;br /&gt;
lipo -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; -create &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
rm &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Replacing original executable with thinned version&amp;quot;&lt;br /&gt;
rm &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
mv &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the Simplified API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen Simplified API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 5.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen Simplified API integrated into a custom video player.&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Swift 5.0 Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Objective-C Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Java/Android Studio Sample]&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Metadata&amp;diff=4220</id>
		<title>Digital Measurement Metadata</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=Digital_Measurement_Metadata&amp;diff=4220"/>
		<updated>2020-06-23T17:04:42Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
= Digital Metadata =&lt;br /&gt;
Digital Metadata can passed through key-values using the Nielsen reserved keys. The keys and values are listed by product below. &lt;br /&gt;
&lt;br /&gt;
== Digital Content Ratings (DCR) Metadata ==&lt;br /&gt;
=== Video Metadata ===&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
==== Example Video Metadata Object ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type:           'content',&lt;br /&gt;
  assetid:        'VID-123456',&lt;br /&gt;
  program:        'program name',&lt;br /&gt;
  title:          'episode title',&lt;br /&gt;
  length:         'length in seconds',&lt;br /&gt;
  airdate:        '20210321 09:00:00',&lt;br /&gt;
  isfullepisode:  'y',&lt;br /&gt;
  adloadtype:     '2',&lt;br /&gt;
  segB:           'custom segment B', // optional&lt;br /&gt;
  segC:           'custom segment C', // optional&lt;br /&gt;
  crossId1:       'Standard Episode ID', // optional&lt;br /&gt;
  crossId2:       'Content Originator' //optional&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The Ad Metadata (if applicable) should be passed for each individual ad.&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;'preroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt; &amp;lt;code&amp;gt;'ad'&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	|| ✓&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:    'preroll',&lt;br /&gt;
  assetid: 'AD-1'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Static Metadata ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID for each article || dynamic || custom &amp;lt;br&amp;gt;(no [[Special Characters]]) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of each site (e.g. section value should be first level in page URL: website.com/section). Limit to 25 unique values || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segA || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment for reporting: Limit to 25 unique values across custom segments (segA + segB + segC) || dynamic || custom || No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
==== Example Static Metadata 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: '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;&lt;br /&gt;
&lt;br /&gt;
== Digital TV Ratings (DTVR) Metadata ==&lt;br /&gt;
=== Content Metadata ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type ||	type of asset	|| &amp;quot;content&amp;quot;	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adModel	|| linear vs dynamic ad model	|| * 1) - Linear – matches TV ad load * 2) Dynamic – Dynamic Ad Insertion (DAI)     || ✓&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; var contentMetadataObject =&lt;br /&gt;
{  &lt;br /&gt;
  type: 'content',&lt;br /&gt;
  adModel: '1'&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== Custom Variables Extension ====&lt;br /&gt;
If you are looking for additional reporting options, reach out to us. We have a [[Custom Variables Extension]] and can work with you to obtain your desired reporting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key&lt;br /&gt;
! Description&lt;br /&gt;
! style=&amp;quot;width: 14%;&amp;quot; | Values&lt;br /&gt;
! style=&amp;quot;width: 12%;&amp;quot; | Required for Audio/Video?&lt;br /&gt;
! style=&amp;quot;width: 12%;&amp;quot; | Required for Static (page)?&lt;br /&gt;
! Reported for&lt;br /&gt;
|-&lt;br /&gt;
| clientid || Brand value is automatically populated through the App ID provided. The value passed here will override the default value. (e.g. Multiple brands in App) || custom || Optional || Optional || Audio / Video and Static Measurement&lt;br /&gt;
|-&lt;br /&gt;
| subbrand || VCID value is automatically populated through the App ID provided. This value passed here will override the default value. (e.g. Multiple Sub-brands in App) || custom || Optional || Optional || Audio / Video and Static Measurement&lt;br /&gt;
|-&lt;br /&gt;
| type ||&lt;br /&gt;
Type of measurement:&lt;br /&gt;
*audio / video – &amp;quot;content&amp;quot;&lt;br /&gt;
*page – &amp;quot;static&amp;quot;&lt;br /&gt;
*ad – &amp;quot;preroll&amp;quot;, &amp;quot;midroll&amp;quot; or &amp;quot;postroll&amp;quot;&lt;br /&gt;
|| &amp;quot;content&amp;quot;, &amp;quot;static&amp;quot; || Mandatory || Mandatory || &lt;br /&gt;
|-&lt;br /&gt;
| assetid || ID assigned to content. '''Must be unique and consistent''' across all content at the episode level, as well as across platforms (e.g. iOS and Android use the same ID). || custom&amp;lt;br&amp;gt;(no [[Special Characters]]) || Mandatory || Not Required || &lt;br /&gt;
|-&lt;br /&gt;
| section || Section of site || custom || Not Required || Mandatory || &lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || Full episode flag ||&lt;br /&gt;
*&amp;quot;y&amp;quot; or &amp;quot;lf&amp;quot; - full episode&lt;br /&gt;
*&amp;quot;n&amp;quot; or &amp;quot;sf&amp;quot; - short form&lt;br /&gt;
|| Mandatory || Not Required ||&lt;br /&gt;
|-&lt;br /&gt;
| program || Program name || custom || Mandatory || Not Required || Audio / Video Measurement&lt;br /&gt;
|-&lt;br /&gt;
| title || Episode title || custom || Mandatory || Not Required || Audio / Video Measurement&lt;br /&gt;
|-&lt;br /&gt;
| length || Length of content in seconds for VOD. 0 may be used for Live content if the exact content length is not known.  || custom || Mandatory || Not Required ||&lt;br /&gt;
|-&lt;br /&gt;
| segA || Segment A (this is not available for audio / video Measurement reporting as the episode title is reported) || custom || Not Required || Not Required || Static Measurement&lt;br /&gt;
|-&lt;br /&gt;
| segB || Segment B || custom || Not Required || Not Required || Audio / Video and Static Measurement&lt;br /&gt;
|-&lt;br /&gt;
| segC || Segment C || custom || Not Required || Not Required || Audio / Video and Static Measurement&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || Standard episode ID. Gracenote/TMS ID should be used when available. Must be unique per episode. || custom || Optional || Not Required ||&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || Content originator (required only for distributors) || custom || Optional || Not Required ||&lt;br /&gt;
|-&lt;br /&gt;
| airdate || Original (local) air date and time (Eastern Time for US) || YYYYMMDD HH24:MI:SS || Mandatory || Not Required ||&lt;br /&gt;
|-&lt;br /&gt;
| pipmode ||&lt;br /&gt;
Current state of picture-in-picture (PIP) mode on device.&lt;br /&gt;
*&amp;quot;true&amp;quot; if audio / video measurement is displayed in PIP mode&lt;br /&gt;
*&amp;quot;false&amp;quot; if audio / video measurement is displayed in regular mode&lt;br /&gt;
|| &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; || Optional || Not Required || Audio / Video Measurement&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype ||&lt;br /&gt;
Type of ad load:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;quot;1&amp;quot; - Linear&lt;br /&gt;
&amp;quot;2&amp;quot; - Dynamic&lt;br /&gt;
|| Mandatory for DCR || Not Required || DCR &lt;br /&gt;
|-&lt;br /&gt;
| adModel ||&lt;br /&gt;
Type of ad model:&lt;br /&gt;
#Linear - matches TV ad load&lt;br /&gt;
#Dynamic - Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;quot;1&amp;quot; - Linear&lt;br /&gt;
&amp;quot;2&amp;quot; - Dynamic&lt;br /&gt;
|| Mandatory for DTVR || Not Required || DTVR&lt;br /&gt;
|-&lt;br /&gt;
| progen || Genre (required only for non-TV originated content). See [[DCR OTT Genre List]] for acceptable values. || e.g. DD for Daytime Drama || Required for non-TV content || Not Required&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''clientid &amp;amp; subbrand (vcid)'''&lt;br /&gt;
By default, clientid and subbrand are setup in Nielsen backend configuration to capture brand and sub-brand information. The fields get populated from backend for a registered client appid. But if an app contains multiple brands and sub-brands and client is willing to give credit to another brand or sub-brand then :&lt;br /&gt;
*Client app developer can override the clientid and subbrand (brand and sub-brand info.) in [[loadMetadata]] call to get a proper measurement for a desired brand and sub-brand.&lt;br /&gt;
**If no clientid and subbrand are specified in CMS of a content and an ad, default values reported in the Configuration will be reported.&lt;br /&gt;
**If clientid and subbrand are specified in CMS of the content or ad, the most recent clientid and subbrand will be reported in subsequent pings. To report with a different clientid and subbrand, include the new values for the keys in their subsequent [[loadMetadata]] call.&lt;br /&gt;
'''Picture-in-picture (PIP) mode'''&lt;br /&gt;
Once the app detects PIP mode, call [[loadMetadata]] with the same set of assetids, values and with one additional parameter &amp;quot;pipmode&amp;quot;: &amp;quot;true&amp;quot;. Once PIP mode is disabled in the device, call [[loadMetadata]] again with &amp;quot;pipmode&amp;quot;:&amp;quot;false&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Custom Variables Extension ====&lt;br /&gt;
Contact Nielsen Technical Account Manager (TAM) to configure any custom variables, as needed for implementing the application.&lt;br /&gt;
&lt;br /&gt;
See [[Custom Variables Extension]] for more information.&lt;br /&gt;
&lt;br /&gt;
==== Advertisement Metadata ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Values !! Required for Audio / Video? !! Required for Static (page)&lt;br /&gt;
|-&lt;br /&gt;
| type || Type of ad || &amp;quot;preroll&amp;quot;&lt;br /&gt;
&amp;quot;midroll&amp;quot;&lt;br /&gt;
&amp;quot;postroll&amp;quot; &lt;br /&gt;
|| Mandatory || Not Required&lt;br /&gt;
|-&lt;br /&gt;
| assetid || An ID assigned to the advertisement. Can be an internal ID, an ID provided by the ad server, or a randomly generated ID. Must be unique across all ads || custom || Mandatory || Not Required&lt;br /&gt;
|-&lt;br /&gt;
| title || Title of the advertisement || &amp;quot;MyAdName&amp;quot; || Mandatory || Not Required&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Passing Metadata ===&lt;br /&gt;
The required metadata can be passed as key values through the loadMetadata method. The sample code below shows a metadata objects for various assets.&lt;br /&gt;
'''Audio / Video Measurement Asset'''&lt;br /&gt;
Type should be &amp;quot;content&amp;quot;&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;assetName&amp;quot;: &amp;quot;myassetName&amp;quot;,&lt;br /&gt;
       &amp;quot;length&amp;quot;: &amp;quot;300.0&amp;quot;,&lt;br /&gt;
       &amp;quot;title&amp;quot;: &amp;quot;myTitle&amp;quot;,&lt;br /&gt;
       &amp;quot;program&amp;quot;: &amp;quot;myProgram&amp;quot;,&lt;br /&gt;
       &amp;quot;censuscategory&amp;quot;: &amp;quot;myCensusCategory&amp;quot;,&lt;br /&gt;
       &amp;quot;assetid&amp;quot;: &amp;quot;myAssetId&amp;quot;,&lt;br /&gt;
       &amp;quot;channelName&amp;quot;: &amp;quot;myChannel&amp;quot;,&lt;br /&gt;
       &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
       &amp;quot;segB&amp;quot;: &amp;quot;segmentB&amp;quot;,&lt;br /&gt;
       &amp;quot;segC&amp;quot;: &amp;quot;segmentC&amp;quot;,&lt;br /&gt;
       &amp;quot;isfullepisode&amp;quot;:&amp;quot;y&amp;quot;,&lt;br /&gt;
       &amp;quot;crossId1&amp;quot;: &amp;quot;Reference11&amp;quot;,&lt;br /&gt;
       &amp;quot;crossId2&amp;quot;: &amp;quot;Reference22&amp;quot;,&lt;br /&gt;
       &amp;quot;airdate&amp;quot;: &amp;quot;20161013 20:00:00&amp;quot;&lt;br /&gt;
    }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Static (Page) Measurement Asset'''&lt;br /&gt;
Type should be &amp;quot;static&amp;quot;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {&lt;br /&gt;
       &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
       &amp;quot;assetid&amp;quot;: &amp;quot;static123&amp;quot;,&lt;br /&gt;
       &amp;quot;section&amp;quot;: &amp;quot;siteSection&amp;quot;,&lt;br /&gt;
       &amp;quot;segA&amp;quot;: &amp;quot;segmentA&amp;quot;,&lt;br /&gt;
       &amp;quot;segB&amp;quot;: &amp;quot;segmentB&amp;quot;,&lt;br /&gt;
       &amp;quot;segC&amp;quot;: &amp;quot;segmentC&amp;quot;&lt;br /&gt;
    }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''For any of the ad types'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;midroll&amp;quot;,&lt;br /&gt;
        &amp;quot;length&amp;quot;: &amp;quot;30.0&amp;quot;,&lt;br /&gt;
        &amp;quot;assetid&amp;quot;: &amp;quot;myMidrollAssetId&amp;quot;,&lt;br /&gt;
        &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
        &amp;quot;tv&amp;quot;: &amp;quot;true&amp;quot;,&lt;br /&gt;
        &amp;quot;dataSrc&amp;quot;: &amp;quot;cms&amp;quot;&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 &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; and playhead position through &amp;lt;code&amp;gt;setPlayheadPosition&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''loadMetadata'''&lt;br /&gt;
The object can then be passed when calling [[loadMetadata]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    loadMetadata(jsonMetadataObject);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Facebook_Instant_Articles_Browser_SDK&amp;diff=4216</id>
		<title>DCR Italy Static Facebook Instant Articles Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Italy_Static_Facebook_Instant_Articles_Browser_SDK&amp;diff=4216"/>
		<updated>2020-06-16T17:13:37Z</updated>

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

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

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), [[Digital Ad Ratings]] (DAR), [[Digital Audio]]. Nielsen SDKs are also equipped to measure static content and can track key life cycle events of an application like:&lt;br /&gt;
*Application launch events and how long app was running&lt;br /&gt;
*Time of viewing a sub section / page in the application.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode and Java using Android Studio to enable '''STATIC MEASUREMENT''' within you APP.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites == &lt;br /&gt;
To start using the Nielsen App SDK, your Xcode or Android Studio environments need to have specific Frameworks or Classes included in your project/app.  This information is detailed in the [[DCR Italy Video App SDK]] documentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; The remainder of this document will assume that you have followed the steps outlined in the [[DCR Italy Video App SDK]] documentation to Initialize the Nielsen SDK.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initialize the SDK == &lt;br /&gt;
Specific steps are outlined in the [[DCR Italy Video App SDK]] documentation.&lt;br /&gt;
&lt;br /&gt;
== Populate and Pass Metadata Object ==&lt;br /&gt;
The Nielsen SDK is able to monitor Application launch events and how long your app has been running.  Once the Nielsen SDK has been Initialized, pass &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;:'static'&amp;lt;/code&amp;gt; as a JSON object via loadMetadata.&lt;br /&gt;
&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
        let staticMetadata = [&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
            &amp;quot;assetid&amp;quot;: &amp;quot;vid345-67483&amp;quot;,&lt;br /&gt;
            &amp;quot;section&amp;quot;: &amp;quot;Home_EntityName_iOS&amp;quot;&lt;br /&gt;
        ];&lt;br /&gt;
         self.nielsenAppApi?.loadMetadata(staticMetadata)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
   NSDictionary *staticMetadata = @&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;vid345-67483&amp;quot;,&lt;br /&gt;
        &amp;quot;section&amp;quot;: &amp;quot;Home_EntityName_iOS&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
– (void)loadMetadata:(id)staticMetadata;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|Android = &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    JSONObject 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;Home_EntityName_Android&amp;quot;)&lt;br /&gt;
        .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
public void loadMetadata(JSONObject staticMetadata);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
The above code would be repeated for each change in &amp;quot;section&amp;quot; within your app.&lt;br /&gt;
&lt;br /&gt;
=== Nielsen SDK Metadata ===&lt;br /&gt;
The following table defines the staticMetadata reserved keys:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !! Data Type !! Value !! Required?&lt;br /&gt;
|-&lt;br /&gt;
| type || asset type || fixed || &amp;lt;code&amp;gt;'static'&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || Unique ID for each article || dynamic || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| section || section of the App to be measured &amp;lt;/br&amp;gt; EntityName = brand name or sub-brand name|| dynamic || &amp;lt;code&amp;gt;Home_EntityName_Android&amp;lt;/code&amp;gt; for Android App &amp;lt;/br&amp;gt;&amp;lt;code&amp;gt;Home_EntityName_iOS&amp;lt;/code&amp;gt; for iOS App  || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Handling Foreground and Background states  ==&lt;br /&gt;
For iOS, background/foreground detection is handled by the app lifecylce APIs which are provided by [https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html Apple]:&lt;br /&gt;
&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=”com.nielsen.app.sdk.AppSdkApplication”&amp;gt;&lt;br /&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 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.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
Please follow the steps outlined in the [[DCR Italy Video App SDK|Privacy_and_Opt-Out]] documentation.&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;it&amp;quot;&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Android Example:&amp;lt;/big&amp;gt;''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;  &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
  // Prepare AppSdk configuration object (JSONObject)&lt;br /&gt;
  JSONObject appSdkConfig = new JSONObject()&lt;br /&gt;
          .put(&amp;quot;appid&amp;quot;, &amp;quot;PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;sfcode&amp;quot;, &amp;quot;it&amp;quot;)&lt;br /&gt;
            // Remove Flag:   &amp;quot;nol_devDebug&amp;quot;: &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=4213</id>
		<title>DCR Poland Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=4213"/>
		<updated>2020-06-16T17:06:52Z</updated>

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

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. &lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
* &amp;quot;pl&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || pl&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;pl&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
== 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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All metadata needs to passed to the SDK using JSONObject instances.&lt;br /&gt;
* JSON values must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
* All the variable names like appid, appname, sfcode, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ChannelName metadata === &lt;br /&gt;
channelName should remain constant throughout the completion of an episode or live stream.&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	|| ChannelInfo refers to the Channel name. This can be a free-form value&lt;br /&gt;
value such as a friendly name for the content being played. the SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
will pass the application name automatically.&lt;br /&gt;
|| custom	|| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || The airdate in the linear TV. Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDD HH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || standard episode ID	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Ad Object ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&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;AD-ID123&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Nielsen API Documentation ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Pass in channelName metadata as described above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
Call to inform SDK about asset being played. Pass in metadata as described here [[#Configure Payload]], [[#Content Metadata]]&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition ===&lt;br /&gt;
Call to inform Nielsen SDK about position in video asset (for VOD pass second within video, for livestreams UTC timestamp in seconds).&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
Call to indicate interruption during playback, e.g. pause. (more on interruption scenarios here: [[#Interruptions during playback]] )&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content has finished playback and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;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(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;mAppSdk.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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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;C77664&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;Program S2, E3&amp;quot;,&lt;br /&gt;
    &amp;quot;isfullepisode&amp;quot;: &amp;quot;Yes&amp;quot;,&lt;br /&gt;
    &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
    &amp;quot;airdate&amp;quot;: &amp;quot;20171020 10:05:00&amp;quot;,&lt;br /&gt;
    &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
    &amp;quot;segB&amp;quot;: &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;segC&amp;quot;: &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Call [[setPlayheadPosition()]] every one second until a pause / stop.&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;
&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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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 (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;
| &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. When content has resumed following an ad break, playhead position must continue from where 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;
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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&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;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are two primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen Android SDK versions (&amp;lt; 5.1.1.18)&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the Android's ''Opt out of Ads Personalization'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Opt out of Ads Personalization&amp;quot;'' (&amp;quot;Limit Ad Tracking&amp;quot; for iOS) setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen Android '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen Android SDK 5.1.1.18 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the current Nielsen opt-out URL via [[userOptOutURLString()]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[userOptOutURLString()]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut()]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=java&amp;gt;appSdk.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;);  // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Legacy Opt Out example code ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
WebView webView;&lt;br /&gt;
AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_OUT = &amp;quot;nielsenappsdk://1&amp;quot;;&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_IN = &amp;quot;nielsenappsdk://0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
//  Within your app you would provide your User the option to Opt Out.&lt;br /&gt;
//  Perhaps via a toggle or button&lt;br /&gt;
//  This is separate from Limit Ad Tracking &lt;br /&gt;
&lt;br /&gt;
      let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Retrieve current Opt-Out preference ===&lt;br /&gt;
Whether the user is opted out viaOS-level Opt-out or via App-level Opt-out, the current Opt-Out status as detected by the SDK is available via the [[getOptOutStatus()]] property in the Nielsen Android SDK API,&lt;br /&gt;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/pl/pl/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    WebView webView;&lt;br /&gt;
    AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onCreate(@Nullable Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_optout);&lt;br /&gt;
        webView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
&lt;br /&gt;
        webView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
        webView.setWebViewClient(new WebViewClient() {&lt;br /&gt;
            @SuppressWarnings(&amp;quot;deprecation&amp;quot;)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {&lt;br /&gt;
                Toast.makeText(OptOutActivity.this, description, Toast.LENGTH_SHORT).show();&lt;br /&gt;
            }&lt;br /&gt;
            @TargetApi(android.os.Build.VERSION_CODES.M)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, WebResourceRequest req, WebResourceError rerr) {&lt;br /&gt;
                // Redirect to deprecated method, so you can use it in all SDK versions&lt;br /&gt;
                onReceivedError(view, rerr.getErrorCode(), rerr.getDescription().toString(), req.getUrl().toString());&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
        //Getting the optPut URL from eventTracker&lt;br /&gt;
        String url = appSdk.userOptOutURLString();&lt;br /&gt;
        webView.loadUrl(url);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;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;
'''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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_iOS_SDK&amp;diff=4211</id>
		<title>DCR Poland Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_iOS_SDK&amp;diff=4211"/>
		<updated>2020-06-16T17:04:01Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Content Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__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, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following items are required:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 30px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''sfcode''' || Environment that the SDK must point to || Contact Nielsen&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[iOS SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you do not have any of these pre-requisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode utilizing the Standard Nielsen SDK for DCR.&lt;br /&gt;
&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
Prior to SDK Version 6.2.0.0 the  IOS framework has been distributed as a static library packaged into framework bundle format. Apple recommends to use dynamic framework, it has some benefits over static libraries like less executable file size of an app, faster startup time and native support in xCode IDE. Nielsen AppSDK has been transformed into dynamic framework in this release ([[iOS_Static_Framework_Setup|static framework]] is still available).&lt;br /&gt;
&lt;br /&gt;
If migrating from the static library to this new dynamic framework, once implemented, unless your specific application requires, you can remove the following Frameworks that were once required:&amp;lt;code&amp;gt; [AdSupport, JavascriptCore, SystemConfiguration, Security, AVFoundation, libc++] &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Dynamic framework is created as a fat framework. It means that it contains slices required for devices (armv7, arm64) as well as slices required for simulators (i386, x86_64). Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore. The example of the shell script that should be added as a Run Script phase in the application can be [[DCR_Video_iOS_SDK#Removing_Simulators|found below]].&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;
&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, when using the dynamic framework,  all the required frameworks are linked automatically as the are needed.  More details can be found here: https://stackoverflow.com/questions/24902787/dont-we-need-to-link-framework-to-xcode-project-anymore&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;
=== Download Framework ===&lt;br /&gt;
The first step is to download and copy the [[Special:Downloads|NielsenAppApi.framework]] bundle to the app project directory. (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Framework ===&lt;br /&gt;
In the General tab for app configuration add NielsenAppApi.framework in the list of Embedded Binaries.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Path ===&lt;br /&gt;
Add path to the NielsenAppApi.framework in the Framework Search Paths build setting.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Import Framework ===&lt;br /&gt;
Add NielsenAppApi.framework module in the source file of your app:&lt;br /&gt;
&lt;br /&gt;
==== Using Swift ====&lt;br /&gt;
Add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&amp;lt;/syntaxhighlight&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 NielsenAppApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. [[Dual_Instances_of_SDK|(Click here for an example of multiple instances)]]&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
* &amp;quot;pl&amp;quot; &lt;br /&gt;
|| Nielsen-specified || Yes || pl&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sample SDK Initialization Code ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import Foundation&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&lt;br /&gt;
class NielsenInit : NSObject {&lt;br /&gt;
    class func createNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
        &lt;br /&gt;
        let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;pl&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;
Sample code using AVPlayer.&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, AVPlayerViewControllerDelegate  {&lt;br /&gt;
&lt;br /&gt;
// your code//    &lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NielsenInit.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NielsenInit&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate&lt;br /&gt;
{    &lt;br /&gt;
    NSDictionary *appInformation = @{ @&amp;quot;appid&amp;quot;: @&amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&amp;quot;,&lt;br /&gt;
                            @&amp;quot;appversion&amp;quot;: @&amp;quot;1.0&amp;quot;,&lt;br /&gt;
                            @&amp;quot;sfcode&amp;quot;: @&amp;quot;pl&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;
&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;NielsenInit.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 NielsenAppApiDelegate;&lt;br /&gt;
&lt;br /&gt;
@interface NielsenInit : 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;
Sample Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@implementation ViewController&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
        &lt;br /&gt;
    //Getting the instance of Nielsen SDK&lt;br /&gt;
    nielsenApi = [NielsenInit createNielsenAppApiWithDelegate:nil];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
let channelInfo = [&lt;br /&gt;
    &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
let contentMetadata = [&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;C77664&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;Program S2, E3&amp;quot;,&lt;br /&gt;
    &amp;quot;isfullepisode&amp;quot;: &amp;quot;Yes&amp;quot;,&lt;br /&gt;
    &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
    &amp;quot;airdate&amp;quot;: &amp;quot;20171020 10:05:00&amp;quot;,&lt;br /&gt;
    &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
    &amp;quot;segB&amp;quot;: &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;segC&amp;quot;: &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * 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;
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;C77664&amp;quot;,&lt;br /&gt;
        @ &amp;quot;title&amp;quot;: @ &amp;quot;S2,E3&amp;quot;,&lt;br /&gt;
        @ &amp;quot;isfullepisode&amp;quot;: @ &amp;quot;y&amp;quot;,  &lt;br /&gt;
        @ &amp;quot;program&amp;quot;: @ &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
        @ &amp;quot;length&amp;quot;: @ &amp;quot;3600&amp;quot;,&lt;br /&gt;
        @ &amp;quot;airdate&amp;quot;: @ &amp;quot;20180120 10:00:00&amp;quot;,&lt;br /&gt;
        @ &amp;quot;adloadtype&amp;quot;: @ &amp;quot;2&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segB&amp;quot;: @ &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
        @ &amp;quot;segC&amp;quot;: @ &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ChannelName metadata ===&lt;br /&gt;
channelName should remain constant throughout the completion of an episode or live stream.&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	|| ChannelInfo refers to the Channel name. This can be a free-form value&lt;br /&gt;
value such as a friendly name for the content being played. the SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
will pass the application name automatically.&lt;br /&gt;
|| custom	|| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode / clip including when ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || The airdate in the linear TV. Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDD HH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads ||  ✓&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || standard episode ID	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 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;
{| 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;'preroll'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt;||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Ad Object ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &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;123456&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * adMetadata = @ {&lt;br /&gt;
    @ &amp;quot;type&amp;quot;: @ &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    @ &amp;quot;assetid&amp;quot;: @ &amp;quot;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Nielsen API Documentation ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Pass in channelName metadata as described above.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenApi play:([NSDictionary *channel loadChannelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.play(channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
Call to inform SDK about asset being played. Pass in metadata as described here [[#Configure Payload]], [[#Content Metadata]]&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi loadMetadata:(contentMetadata)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
Call to inform Nielsen SDK about position in video asset (for VOD pass second within video, for livestreams UTC timestamp in seconds).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi playheadPosition:secondsAsInt];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.playheadPosition(secondsAsInt)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
Call to indicate interruption during playback, e.g. pause. (more on interruption scenarios here: [[#Interruptions during playback]] )&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
Call when content finished playback and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
[[File:appsdkTimeline-DCR.png|icon|link=]]&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;syntaxhighlight lang=Swift&amp;gt;&lt;br /&gt;
nielsenApi = NielsenInit.createNielsenApi(delegate: self);&lt;br /&gt;
data = loadStaticMetadata();&lt;br /&gt;
nielsenApi.loadMetadata(self.data);&amp;lt;/syntaxhighlight&amp;gt; || // Pass Static Metadata here if applicable&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;nielsenApi.play(channelName)&amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.loadMetadata(contentMetadata)&amp;lt;/code&amp;gt; || // MetadataObject contains the JSON metadata&amp;lt;br&amp;gt; for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;nielsenApi.playheadPosition(pos);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead &amp;lt;br&amp;gt;while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;nielsenApi.end()&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&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 '''Idle 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 an event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position is active.  If a LIVE event, use the current UNIX timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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. &lt;br /&gt;
## &amp;lt;code&amp;gt;'''appDisableApi'''&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 / stop.&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;nielsenApi.play(channelName); &amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;
&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;
}&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 / stop / another [[loadMetadata()]] is called. 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;nielsenApi.play(channelName); &amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (End of stream) || &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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 begin from 0 at ad start.  When content has resumed following an ad break, playhead position must continue from where 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;
For iOS, background/foreground detection is handled by the app lifecylce APIs which are provided by [https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html Apple:]&lt;br /&gt;
&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement.&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;
* Start sending API calls – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are three primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Limit Ad Tracking'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen iOS SDK (&amp;lt; 5.1.1.18)&lt;br /&gt;
# '''[[#App_Level_Opt_Out|App Level Opt-Out]]''' - Where [https://developer.apple.com/documentation/adsupport Ad Framework] cannot be leveraged&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen iOS '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the iOS's ''Limit Ad Tracking'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Limit Ad Tracking&amp;quot;'' setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen iOS '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen iOS SDK 5.1.1.17 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the legacy 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 close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=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;
==== Legacy Opt-out example code ====&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)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {&lt;br /&gt;
&lt;br /&gt;
    NSURLRequest *request = [navigationAction request];&lt;br /&gt;
    NSString *url = [[request URL]absoluteString];&lt;br /&gt;
    &lt;br /&gt;
    if([url isEqualToString:self.NIELSEN_URL_OPT_OUT] || [url isEqualToString:self.NIELSEN_URL_OPT_IN]){&lt;br /&gt;
        [self.nielsenApi userOptOut:url];&lt;br /&gt;
        decisionHandler(WKNavigationActionPolicyAllow);&lt;br /&gt;
    }else{&lt;br /&gt;
        decisionHandler(WKNavigationActionPolicyCancel);&lt;br /&gt;
    }        &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var webView: WKWebView!&lt;br /&gt;
var NIELSEN_URL_OPT_OUT : String = &amp;quot;nielsenappsdk://1&amp;quot;&lt;br /&gt;
var NIELSEN_URL_OPT_IN : String = &amp;quot;nielsenappsdk://0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -&amp;gt; Void) {&lt;br /&gt;
&lt;br /&gt;
       let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
            decisionHandler(.allow)&lt;br /&gt;
&lt;br /&gt;
        }else{&lt;br /&gt;
           decisionHandler(.cancel)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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 App-level 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;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/pl/pl/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
    &lt;br /&gt;
    //Setting background image&lt;br /&gt;
    UIImage *backgroundImage = [UIImage imageNamed:@&amp;quot;new_ios_bg.png&amp;quot;];&lt;br /&gt;
    UIImageView *backgroundImageView=[[UIImageView alloc]initWithFrame:self.view.frame];&lt;br /&gt;
    backgroundImageView.image=backgroundImage;&lt;br /&gt;
    [self.view insertSubview:backgroundImageView atIndex:0];&lt;br /&gt;
&lt;br /&gt;
    self.nielsenApi = [NielsenInit createNielsenAppApiWithDelegate:nil];&lt;br /&gt;
&lt;br /&gt;
    //Initialising the webview&lt;br /&gt;
    WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];&lt;br /&gt;
    _wkwebView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration];&lt;br /&gt;
    _wkwebView.navigationDelegate = self;&lt;br /&gt;
&lt;br /&gt;
     //Getting the optPut URL from SDK&lt;br /&gt;
    NSURL *nsurl=[NSURL URLWithString:[self.nielsenApi optOutURL]];&lt;br /&gt;
&lt;br /&gt;
    //Setting url request in webview&lt;br /&gt;
    NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];&lt;br /&gt;
&lt;br /&gt;
     //Setting url request in webview&lt;br /&gt;
    [_wkwebView loadRequest:nsrequest];&lt;br /&gt;
&lt;br /&gt;
      //Adding webview to the controller view &lt;br /&gt;
    [self.view addSubview:_wkwebView];   &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &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;
    &lt;br /&gt;
    var webView: WKWebView!&lt;br /&gt;
    var nielsenApi: NielsenAppApi!&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;
        self.view.backgroundColor = UIColor(patternImage: UIImage(named: &amp;quot;new_ios_bg.png&amp;quot;)!) &lt;br /&gt;
        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&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;
    }&lt;br /&gt;
    &lt;br /&gt;
}&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;
=== App Level Opt Out ===&lt;br /&gt;
This is only used if the Ad Framework is not available.  The Opt-Out occurs by opening a Nielsen-defined web page and passing the user choice from the 'WebView'. In order to do this, the application needs to:&lt;br /&gt;
* Implement the UIWebView delegate method to open the Nielsen Privacy web page&lt;br /&gt;
* Capture user's selection&lt;br /&gt;
* Pass the selection back to the SDK via the &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Capture and forward user selection ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType&lt;br /&gt;
{&lt;br /&gt;
    NSString *command = [NSString stringWithFormat:@&amp;quot;%@&amp;quot;,request.URL];&lt;br /&gt;
    if ([command isEqualToString:kNielsenWebClose]) {&lt;br /&gt;
        // Close the WebView&lt;br /&gt;
        [self performSelector:@selector(closeOptOutView) withObject:nil afterDelay:0];&lt;br /&gt;
        return NO;&lt;br /&gt;
    }&lt;br /&gt;
    // Retrieve next URL if it’s not opt-in/out selection&lt;br /&gt;
    return (![nAppApiObject userOptOut:command]);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt; with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.&lt;br /&gt;
**&amp;lt;code&amp;gt;[nAppApiObject userOptOut:command]&amp;lt;/code&amp;gt; passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When 'WebView' is closed, pass the status returned from 'WebView' to the SDK within the app. The App SDK manages the user's choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -&amp;gt; Bool {&lt;br /&gt;
&lt;br /&gt;
        let command = request.url?.absoluteString&lt;br /&gt;
        if  command ==  &amp;quot;kNielsenWebClose&amp;quot;{&lt;br /&gt;
&lt;br /&gt;
            self.perform(#selector(closeOptOutView), with: nil, afterDelay: 0)&lt;br /&gt;
&lt;br /&gt;
            return false&lt;br /&gt;
        }    &lt;br /&gt;
        return NielsenAppApi.optOutURL&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt; with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.&lt;br /&gt;
**&amp;lt;code&amp;gt;[nAppApiObject userOptOut:command]&amp;lt;/code&amp;gt; passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When 'WebView' is closed, pass the status returned from 'WebView' to the SDK within the app. The App SDK manages the user's choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== AirPlay ==&lt;br /&gt;
To implement OTT measurement, report OTT changes to the SDK using 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;
== 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;
&amp;lt;br/&amp;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;br /&gt;
&lt;br /&gt;
== Removing Simulators (Dynamic Framework Only)==&lt;br /&gt;
&lt;br /&gt;
Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore.  Here is an example Shell script that could be added as a Run Script phase in the application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='bash'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
APP_PATH=&amp;quot;${TARGET_BUILD_DIR}/${WRAPPER_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This script loops through the frameworks embedded in the application and&lt;br /&gt;
# removes unused architectures.&lt;br /&gt;
find &amp;quot;$APP_PATH&amp;quot; -name '*.framework' -type d | while read -r FRAMEWORK&lt;br /&gt;
do&lt;br /&gt;
FRAMEWORK_EXECUTABLE_NAME=$(defaults read &amp;quot;$FRAMEWORK/Info.plist&amp;quot; CFBundleExecutable)&lt;br /&gt;
FRAMEWORK_EXECUTABLE_PATH=&amp;quot;$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
echo &amp;quot;Executable is $FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
EXTRACTED_ARCHS=()&lt;br /&gt;
&lt;br /&gt;
for ARCH in $ARCHS&lt;br /&gt;
do&lt;br /&gt;
echo &amp;quot;Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
lipo -extract &amp;quot;$ARCH&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot; -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;&lt;br /&gt;
EXTRACTED_ARCHS+=(&amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;)&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Merging extracted architectures: ${ARCHS}&amp;quot;&lt;br /&gt;
lipo -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; -create &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
rm &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Replacing original executable with thinned version&amp;quot;&lt;br /&gt;
rm &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
mv &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the Simplified API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen Simplified API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen Simplified API integrated into a custom video player.&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Swift 4.0 Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Objective-C Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Java/Android Studio Sample]&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_%26_Static_Roku_Cloud_API&amp;diff=4197</id>
		<title>DCR Video &amp; Static Roku Cloud API</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_%26_Static_Roku_Cloud_API&amp;diff=4197"/>
		<updated>2020-05-21T17:25:24Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
This guide shows you how to integrate the Nielsen Cloud API to enable Digital Content Ratings (DCR) measurement on your Roku Apps.&lt;br /&gt;
*For other OTT Apps, please see [[DCR Video &amp;amp; Static Cloud API]]&lt;br /&gt;
*For Mobile Apps, please see [[DCR Video &amp;amp; Static Mobile Cloud API]]&lt;br /&gt;
&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 upon starting the integration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amp;lt;/syntaxhighlight&amp;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;
===Request Overview===&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;
*&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://sandbox-cloudapi.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://cloudapi.imrworldwide.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. Once your application has been certified, the URL should be updated to point to the Cloud API production endpoint.&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://sandbox-cloudapi.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;static&amp;quot;: [static_metadata],&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;: [UTC]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Session ID===&lt;br /&gt;
A unique Session ID must be created upon app launch and provided in the URL. This will allow measurement to occur for the entire duration that a user is within the app.&lt;br /&gt;
&lt;br /&gt;
The session ID must be passed with every request and must remain consistent throughout each individual session.&lt;br /&gt;
&lt;br /&gt;
A Session ID needs to be completely unique so it is recommended to use a version 4 UUID or another method of your choosing to guarantee there are no repeats.&lt;br /&gt;
&lt;br /&gt;
Upon exiting the app, the session will need to be terminated using the delete event. Sessions will automatically expire after 30 minutes of cloud inactivity.&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://sandbox-cloudapi.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;apn&amp;quot;: &amp;quot;AppName&amp;quot;,&lt;br /&gt;
        &amp;quot;encdata&amp;quot;: &amp;quot;encdata=v1.key.RokuAES256CBC00.iv3x2EV0BpHH9AbZK%2FnBWWRhZbj7pD%3D...&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;
    },&lt;br /&gt;
    &lt;br /&gt;
    // 3.2 Configure Payload: metadata&lt;br /&gt;
    &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
        &amp;quot;static&amp;quot;: {}, // object for measuring static content&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;VIDEO-ID123&amp;quot;, // unique ID for video&lt;br /&gt;
            &amp;quot;isfullepisode&amp;quot;: &amp;quot;y&amp;quot;, // full episode flag&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;, // program name&lt;br /&gt;
            &amp;quot;title&amp;quot;: &amp;quot;Episode Title S3 - EP1&amp;quot;, // episode name&lt;br /&gt;
            &amp;quot;length&amp;quot;: &amp;quot;1800&amp;quot;, // content duration in seconds&lt;br /&gt;
            &amp;quot;segB&amp;quot;: &amp;quot;Custom Segment B&amp;quot;, // custom segment&lt;br /&gt;
            &amp;quot;segC&amp;quot;: &amp;quot;Custom Segment C&amp;quot;, // custom segment&lt;br /&gt;
            &amp;quot;crossId1&amp;quot;: &amp;quot;Standard Episode ID&amp;quot;, // episode ID&lt;br /&gt;
            &amp;quot;crossId2&amp;quot;: &amp;quot;Content Originator ID&amp;quot;, // content orginator (required for distributors)&lt;br /&gt;
            &amp;quot;airdate&amp;quot;: &amp;quot;20161013 20:00:00&amp;quot;, // airdate&lt;br /&gt;
            &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;, //ad load flag&lt;br /&gt;
            &amp;quot;hasAds&amp;quot;: &amp;quot;1&amp;quot;, // content contains ads = 1 / no ads = 0&lt;br /&gt;
            &amp;quot;progen&amp;quot;: &amp;quot;CV&amp;quot; // program genre abbreviation&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;
        }&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;
|-&lt;br /&gt;
| encdata || Nielsen - Roku ID for Advertisers || N-RIDA Payload || Yes&lt;br /&gt;
|-&lt;br /&gt;
| apn || app name || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| apv || app build version || custom || Yes&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; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Yes&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;encdata&amp;quot;: &amp;quot;encdata=v1.key.RokuAES256CB...&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;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Encdata (N-RIDA): Nielsen - Roku Identifier for Advertisers =====&lt;br /&gt;
The N-RIDA (Nielsen-Roku ID for Advertisers) is a proprietary advertising identifier that ties back to an individual Roku device, and allows Nielsen to attribute audience metrics. The N-RIDA is provided by Roku, and is pulled through the Roku &amp;lt;code&amp;gt;[https://sdkdocs.roku.com/display/sdkdoc/Integrating+the+Roku+Advertising+Framework#IntegratingtheRokuAdvertisingFramework-getNielsenContentData()asString AdIface.GetNielsenContentData()]&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
The N-RIDA payload should be requested once per user session and populated in the &amp;lt;code&amp;gt;&amp;quot;encdata&amp;quot;&amp;lt;/code&amp;gt; Nielsen key within the &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; payload. Each Cloud API request throughout a user session should include the same N-RIDA payload. The N-RIDA should be established when a user launches the app, and it should be maintained until the user exits. A new N-RIDA payload should be requested when the user re-enters the app.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisites For Using The AdIface.GetNielsenContentData() Roku API'''&lt;br /&gt;
&lt;br /&gt;
* Roku Ad Framework (RAF) must be implemented:&lt;br /&gt;
** &amp;lt;code&amp;gt;bs_libs_required=roku_ads_lib&amp;lt;/code&amp;gt; must be included in the Roku manifest file.&lt;br /&gt;
** &amp;lt;code&amp;gt;Library &amp;quot;Roku_Ads.brs&amp;quot;&amp;lt;/code&amp;gt; should be the first entry in your Roku main.brs file.&lt;br /&gt;
** &amp;lt;code&amp;gt;adIface = Roku_Ads()&amp;lt;/code&amp;gt; allows you to access the Roku Ad Framework interface and must be called before utilizing RAF API's such as &amp;lt;code&amp;gt;AdIface.GetNielsenContentData()&amp;lt;/code&amp;gt;&lt;br /&gt;
* For additional details for integrating the Roku Ad Framework (RAF) please refer to the link provided below:&lt;br /&gt;
** https://sdkdocs.roku.com/display/sdkdoc/Integrating+the+Roku+Advertising+Framework&lt;br /&gt;
&lt;br /&gt;
===== Request N-RIDA for the devInfo Payload encdata parameter using AdIface.GetNielsenContentData() =====&lt;br /&gt;
&lt;br /&gt;
'''Example Code For Configuring Encdata'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;// create a variable as a placeholder for the N-RIDA payload&lt;br /&gt;
n_Rida=AdIface.GetNielsenContentData()&lt;br /&gt;
&lt;br /&gt;
// populate the encdata key in devInfo with the AdIface.GetNielsenContentData() retrun&lt;br /&gt;
&amp;quot;devInfo&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;encdata&amp;quot;: &amp;quot;n_Rida&amp;quot;, //insert the AdIface.GetNielsenContentData() return within encdata&lt;br /&gt;
  &amp;quot;uoo&amp;quot;: &amp;quot;false&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': When pulled and populated into the encdata key, the &amp;lt;code&amp;gt;AdIface.GetNielsenContentData()&amp;lt;/code&amp;gt; return will be formatted similarly to the example below, and will include &amp;quot;encdata=&amp;quot; within the return along with the N-RIDA key.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&amp;quot;encdata&amp;quot;:&amp;quot;encdata=v1.key.RokuAES256CBC00.iv.HSh88AM%2BG%2Fx57TZ%2BW5j5Fw%3D%3D...&amp;quot;&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;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset || &amp;lt;code&amp;gt;&amp;quot;content&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to asset || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| program ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| title ||name of program (25 character limit) || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| length || length of content in seconds || &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; (0 for live stream) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment B || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment C || custom || No&lt;br /&gt;
|-&lt;br /&gt;
| airdate || the airdate in the linear TV || YYYYMMDD HH24:MI:SS || Yes&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag || &amp;lt;code&amp;gt;&amp;quot;y&amp;quot;&amp;lt;/code&amp;gt;- full episode, &amp;lt;code&amp;gt;&amp;quot;n&amp;quot;&amp;lt;/code&amp;gt;- non full episode || Yes&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || standard episode ID || custom || Yes&lt;br /&gt;
|-&lt;br /&gt;
| crossId2 || content originator (only required for distributors) || Nielsen || No&lt;br /&gt;
|-&lt;br /&gt;
| adloadtype || type of ad load:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; Linear – matches TV ad load&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; Dynamic – Dynamic Ad Insertion (DAI)&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; - DCR measures content with dynamic ads || Yes&lt;br /&gt;
|-&lt;br /&gt;
| hasAds || ads indicator&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt;: ads included&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt;: ads not included&lt;br /&gt;
|| &amp;lt;code&amp;gt;&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;0&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| subbrand || sub brand override || Nielsen || No&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre abbreviation - see [[DCR OTT Genre List]] for accepted values || &amp;lt;code&amp;gt;&amp;quot;CV&amp;quot;&amp;lt;/code&amp;gt; for Comedy Variety || Yes&lt;br /&gt;
|}&lt;br /&gt;
&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;VIDEO-ID123&amp;quot;,&lt;br /&gt;
    &amp;quot;isfullepisode&amp;quot;: &amp;quot;y&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 S3 - EP1&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;1800&amp;quot;,&lt;br /&gt;
    &amp;quot;segB&amp;quot;: &amp;quot;Custom Segment B&amp;quot;,&lt;br /&gt;
    &amp;quot;segC&amp;quot;: &amp;quot;Custom Segment C&amp;quot;,&lt;br /&gt;
    &amp;quot;crossId1&amp;quot;: &amp;quot;Standard Episode ID&amp;quot;,&lt;br /&gt;
    &amp;quot;crossId2&amp;quot;: &amp;quot;Content Originator ID&amp;quot;,&lt;br /&gt;
    &amp;quot;airdate&amp;quot;: &amp;quot;20161013 20:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
    &amp;quot;hasAds&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
    &amp;quot;subbrand&amp;quot;: &amp;quot;c05&amp;quot;,&lt;br /&gt;
    &amp;quot;progen&amp;quot;: &amp;quot;CV&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Ad Metadata =====&lt;br /&gt;
The ad metadata should be passed for each individual ad.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Description !! Values !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of ad || &amp;lt;code&amp;gt;&amp;quot;preroll&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;midroll&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;quot;postroll&amp;quot;&amp;lt;/code&amp;gt; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| assetid || unique ID assigned to ad || custom || Yes&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;
// 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;AD-ID123&amp;quot;&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; || Playhead position in seconds, must be passed as a whole number every 10 seconds. The final playhead position should be sent before an asset has changed to properly capture full duration. When content is paused, stop passing playhead position until content is resumed. Upon resuming content, continue to pass playhead position every 10 seconds starting at the playhead position in which content was paused.  On playhead scrubbing, send current playhead position, followed by the playhead position the user scrubs to. For Live streams, you may use Unix Time (in seconds) as the playhead position. Note that ad playheads must also use Unix Time if Unix Time is used for content playheads.&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; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;position&amp;quot;&amp;lt;/code&amp;gt; || creditable position || playhead position in seconds or Unix Time for live stream || Yes&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; || Yes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;quot;utc&amp;quot;&amp;lt;/code&amp;gt; || Unix timestamp. Must be passed every 10 seconds. || &amp;lt;code&amp;gt;&amp;quot;1472760000000&amp;quot;&amp;lt;/code&amp;gt; || Yes&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;static&amp;quot;: [static metadata],&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&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;
===Example Image Request===&lt;br /&gt;
&lt;br /&gt;
In order to execute Cloud API calls, image requests will need to be established for each event.&lt;br /&gt;
&lt;br /&gt;
===Playhead Image Request Example Code===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
playheadRequest = CreateObject(&amp;quot;roUrlTransfer&amp;quot;)&lt;br /&gt;
                sendUrl = sessionUrl+playheadRequest.Escape(playheadPayload)&lt;br /&gt;
                playheadRequest.SetUrl(sendUrl)&lt;br /&gt;
                xport=CreateObject(&amp;quot;RoMessagePort&amp;quot;)&lt;br /&gt;
                playheadRequest.setport(xport)&lt;br /&gt;
                aa3 = {}&lt;br /&gt;
                aa3[&amp;quot;Connection&amp;quot;] = &amp;quot;keep-alive&amp;quot;&lt;br /&gt;
                aa3[&amp;quot;Content-type&amp;quot;] = &amp;quot;image/gif&amp;quot;&lt;br /&gt;
                playheadRequest.SetHeaders(aa3)&lt;br /&gt;
                playheadRequest.setRequest(&amp;quot;GET&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Sample Event Lifecycle =====&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 - 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;
=====Handling Playhead=====&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;
'''Playhead: General'''&lt;br /&gt;
* Playhead position must start at 0 for each new asset, and be passed at least every 10 seconds.&lt;br /&gt;
* Final postion must be sent at the end of content or an ad&lt;br /&gt;
&lt;br /&gt;
'''Playhead: Ads'''&lt;br /&gt;
* The final position must be sent when switching from content to ad, or ad to content.&lt;br /&gt;
* Each ad playhead position should be 0 at ad start.&lt;br /&gt;
* For Ad Pods, playhead must be called, and reset to 0 for each individual ad. &lt;br /&gt;
* The last content position before an Ad should be sent before switching to Ads.&lt;br /&gt;
* When content has resumed following an ad break, the playhead position update must continue where the previous content segment left off.&lt;br /&gt;
&lt;br /&gt;
'''Playhead: User Actions'''&lt;br /&gt;
* 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;
* On pause, send the current position and then stop passing the playhead position until content is resumed. Once content resumes, continue to pass playhead position every 10 seconds starting at the playhead position in which content was paused.&lt;br /&gt;
* 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;
===== 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;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// 1. Create Session ID&lt;br /&gt;
sessionID = dfc7dc6a-66a7-4705-9fba-adaaf7e3d5e0  // 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://sandbox-cloudapi.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;encdata&amp;quot;: &amp;quot;encdata=v1.key.RokuAES256CB...&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;
  },&lt;br /&gt;
  &lt;br /&gt;
  // 3.2 Configure Payload: metadata&lt;br /&gt;
  &amp;quot;metadata&amp;quot;: {&lt;br /&gt;
    &amp;quot;static&amp;quot;: {}, // object for measuring static content&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;VIDEO-ID123&amp;quot;, // unique ID for video&lt;br /&gt;
      &amp;quot;isfullepisode&amp;quot;: &amp;quot;y&amp;quot;, // full episode flag&lt;br /&gt;
      &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;, // program name&lt;br /&gt;
      &amp;quot;title&amp;quot;: &amp;quot;Episode Title S3 - EP1&amp;quot;, // episode name&lt;br /&gt;
      &amp;quot;length&amp;quot;: &amp;quot;1800&amp;quot;, // content duration in seconds&lt;br /&gt;
      &amp;quot;segB&amp;quot;: &amp;quot;Custom Segment B&amp;quot;, // custom segment&lt;br /&gt;
      &amp;quot;segC&amp;quot;: &amp;quot;Custom Segment C&amp;quot;, // custom segment&lt;br /&gt;
      &amp;quot;crossId1&amp;quot;: &amp;quot;Standard Episode ID&amp;quot;, // episode ID&lt;br /&gt;
      &amp;quot;crossId2&amp;quot;: &amp;quot;Content Originator ID&amp;quot;, // content orginator (required for distributors)&lt;br /&gt;
      &amp;quot;airdate&amp;quot;: &amp;quot;20161013 20:00:00&amp;quot;, // airdate&lt;br /&gt;
      &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;, // ad load flag&lt;br /&gt;
      &amp;quot;hasAds&amp;quot;: &amp;quot;1&amp;quot;, // content contains ads = 1 / no ads = 0&lt;br /&gt;
      &amp;quot;progen&amp;quot;: &amp;quot;CV&amp;quot; // program genre abbreviation&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;
    }&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;
&lt;br /&gt;
// Append payload to URL&lt;br /&gt;
sendUrl = sessionUrl.Escape(payload)&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;
print &amp;quot;Playhead Event &amp;quot; + sendUrl&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;
print &amp;quot;Event Payload &amp;quot;+ playheadPayload + modSeq%.tostr()&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;
httpCode = GetResponseCode()&lt;br /&gt;
print &amp;quot;Response Code  &amp;quot; +httpCode.tostr()&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;
&lt;br /&gt;
Your app must provide a means for the user to Opt-Out, or Opt-In to Nielsen Measurement. This can be implemented in two steps:&lt;br /&gt;
&lt;br /&gt;
==== Step 1: Nielsen Privacy Policy &amp;amp; Roku Channel Disclosure ====&lt;br /&gt;
&lt;br /&gt;
In your application, you must display the Nielsen privacy policy, which instructs users on how to opt out and opt in to Nielsen measurements. This text is usually displayed in an application's &amp;quot;Settings&amp;quot; or &amp;quot;About&amp;quot; screens.&lt;br /&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 clients 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 choose the appropriate &amp;quot;Limit Ad Tracking&amp;quot; setting on your device. 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://www.nielsen.com/digitalprivacy&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, on your Roku Channel description, you should add the following disclosure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;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://www.nielsen.com/digitalprivacy for more information.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 2: Use &amp;quot;Limit Ad Tracking&amp;quot; setting to set User Opt Out ====&lt;br /&gt;
&lt;br /&gt;
Depending on the user's selection for the &amp;quot;Limit Ad Tracking&amp;quot; device setting, you should set the Cloud API &amp;lt;code&amp;gt;&amp;quot;uoo&amp;quot;&amp;lt;/code&amp;gt; parameter accordingly. Roku provides an API called [https://sdkdocs.roku.com/display/sdkdoc/ifDeviceInfo#ifDeviceInfo-IsAdIdTrackingDisabled()asBoolean IsAdIdTrackingDisabled()] to check the user's limit ad tracking setting.&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 || &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;
The &amp;lt;code&amp;gt;&amp;quot;uoo&amp;quot;&amp;lt;/code&amp;gt; parameter is located in the &amp;lt;code&amp;gt;&amp;quot;devInfo&amp;quot;&amp;lt;/code&amp;gt; JSON object, which will be sent in every Cloud API event (playhead, complete, &amp;amp; delete).&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;Roku Sample App&amp;quot;,&lt;br /&gt;
    &amp;quot;apv&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt;
    &amp;quot;encdata&amp;quot;: &amp;quot;encdata=v1.key.RokuAES256CB...&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;Roku Sample App&amp;quot;,&lt;br /&gt;
    &amp;quot;apv&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt;
    &amp;quot;encdata&amp;quot;: &amp;quot;&amp;quot;, //Encdata 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;
Your application should check the Limit Ad Tracking setting on each app start, and/or periodically, to ensure the user's ad tracking selection is reflected in the Nielsen opt-out setting in your app.&lt;br /&gt;
&lt;br /&gt;
*In addition, you will need to ensure that the encdata field is populated with a blank value if a user has elected to Opt-Out.&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;
*Opt-Out status&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.&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;
*When content is paused, send the current position and then stop passing playhead position until content resumes. Once content resumes, continue passing playhead position every 10 seconds starting at the position in which content was paused.&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&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 based on the device's &amp;quot;Limit Ad Tracking&amp;quot; setting.&lt;br /&gt;
*Test that the encdata field is populated with a blank value if a user has elected to Opt-Out. For Example: &amp;quot;encdata&amp;quot;: &amp;quot;&amp;quot;,&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://sandbox-cloudapi.imrworldwide.com/nmapi/v2/&amp;lt;/code&amp;gt;&lt;br /&gt;
*Production: &amp;lt;code&amp;gt;https://cloudapi.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://cloudapi.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>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4158</id>
		<title>DCR Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4158"/>
		<updated>2020-03-23T19:05:17Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. &lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''DTVR'''&lt;br /&gt;
* &amp;quot;us&amp;quot;&lt;br /&gt;
'''DCR'''&lt;br /&gt;
* &amp;quot;dcr&amp;quot; &lt;br /&gt;
|| Nielsen-specified || Yes || 'dcr'&lt;br /&gt;
|-&lt;br /&gt;
|containerID || View ID of the UI element used as player view in application for Viewability ||Client-defined||Optional||&amp;quot;1234567&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;dcr&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;containerID&amp;quot;: &amp;quot;2131558561&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- == Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;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;
// 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;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter setplayheadPosition: 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;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current Unix timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: For livestream, send the Unix timestamp; for VOD send the time in seconds as integer. The final playhead position must be sent for the current asset being played before calling &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; or&amp;lt;code&amp;gt; '''loadmetadata'''&amp;lt;/code&amp;gt;,.&amp;lt;/blockquote&amp;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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 [[setPlayheadPosition()]] every one second until a pause / stop.&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;
&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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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;
'''Ad Content'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    long pos = mAdPlayer.videoPosition() / 1000;&lt;br /&gt;
   if (mAppSdk != null)&lt;br /&gt;
   {&lt;br /&gt;
     mAppSdk.setPlayheadPosition(pos);&lt;br /&gt;
   }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: The playhead positions for ad and content should be maintained separately.&amp;lt;/blockquote&amp;gt;&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 (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;
| &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. When content has resumed following an ad break, playhead position must continue from where 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;
* Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
* Utilizing the [[DCR_Video_Android_SDK#The_SdkBgFgDetectionUtility_class|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 provides 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;
==== 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;
&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;
&amp;lt;blockquote&amp;gt;&lt;br /&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, can do so by calling the following newly introduced AppSdk public api, passing the application context :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public static void registerLifeCycleObserver(Context applicationContext)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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;
&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:Android_Privacy_and_Opt-Out}}&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;
'''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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4157</id>
		<title>DCR Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4157"/>
		<updated>2020-03-23T19:04:15Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. &lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''DTVR'''&lt;br /&gt;
* &amp;quot;us&amp;quot;&lt;br /&gt;
'''DCR'''&lt;br /&gt;
* &amp;quot;dcr&amp;quot; &lt;br /&gt;
|| Nielsen-specified || Yes || dcr&lt;br /&gt;
|-&lt;br /&gt;
|containerID || View ID of the UI element used as player view in application for Viewability ||Client-defined||Optional||&amp;quot;1234567&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;dcr&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;containerID&amp;quot;: &amp;quot;2131558561&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- == Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;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;
// 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;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter setplayheadPosition: 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;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current Unix timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: For livestream, send the Unix timestamp; for VOD send the time in seconds as integer. The final playhead position must be sent for the current asset being played before calling &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; or&amp;lt;code&amp;gt; '''loadmetadata'''&amp;lt;/code&amp;gt;,.&amp;lt;/blockquote&amp;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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 [[setPlayheadPosition()]] every one second until a pause / stop.&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;
&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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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;
'''Ad Content'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    long pos = mAdPlayer.videoPosition() / 1000;&lt;br /&gt;
   if (mAppSdk != null)&lt;br /&gt;
   {&lt;br /&gt;
     mAppSdk.setPlayheadPosition(pos);&lt;br /&gt;
   }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: The playhead positions for ad and content should be maintained separately.&amp;lt;/blockquote&amp;gt;&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 (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;
| &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. When content has resumed following an ad break, playhead position must continue from where 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;
* Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
* Utilizing the [[DCR_Video_Android_SDK#The_SdkBgFgDetectionUtility_class|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 provides 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;
==== 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;
&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;
&amp;lt;blockquote&amp;gt;&lt;br /&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, can do so by calling the following newly introduced AppSdk public api, passing the application context :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public static void registerLifeCycleObserver(Context applicationContext)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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;
&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:Android_Privacy_and_Opt-Out}}&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;
'''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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4156</id>
		<title>DCR Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Video_Android_SDK&amp;diff=4156"/>
		<updated>2020-03-23T18:59:36Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK Initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. &lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
'''DTVR'''&lt;br /&gt;
* &amp;quot;us&amp;quot;&lt;br /&gt;
'''DCR'''&lt;br /&gt;
* &amp;quot;dcr&amp;quot; &lt;br /&gt;
|| Nielsen-specified || Yes || 'dcr'&lt;br /&gt;
|containerID || View ID of the UI element used as player view in application for Viewability ||Client-defined||Optional||&amp;quot;1234567&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;dcr&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;containerID&amp;quot;: &amp;quot;2131558561&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- == Initializing the Nielsen AppSDK to measure the Viewability ==&lt;br /&gt;
The integrator to support the viewability metrics in the application has to provide a tag value of the player view to let Nielsen AppSDK know that there is a player that needs to be tracked. It’s called the ‘containerId’ and it should be passed in application info dictionary as string while initializing the Nielsen AppSDK.&lt;br /&gt;
&lt;br /&gt;
==== Android ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||View ID of the UI element used as player view in application. getId() method of View class can be used to get this value.	||A positive integer used to identify the view. || 2131558561&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== iOS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! #	!! Parameter Name	!! Description !! Supported Values !! Example&lt;br /&gt;
|-&lt;br /&gt;
| 1	|| containerId ||The tag of the UIView that represents the Player View	||The string value representing the NSInteger value with maximum value of NSIntegerMax that is related on 32- or 64-bit applications. || &amp;quot;100&amp;quot; &amp;lt;br&amp;gt; &amp;quot;2131558561&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For iOS it is required to link additional frameworks that are needed for viewability engine:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JavaScriptCore.framework&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;WebKit.framework&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Nielsen AppSDK uses a tracking WebView (TWV) approach.  For more information on Viewability, please refer to [https://engineeringportal.nielsen.com/docs/Implementing_Viewability_with_AppSDK Implementing Viewability with AppSDK.]&lt;br /&gt;
--&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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content metadata ===&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode/clip including when ads play.&lt;br /&gt;
{{DCR Content Metadata}}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
== Sequence of Calls ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content stop is initiated and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;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;
// 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;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure API Calls ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadata];&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;[nielsenMeter play: channelName];&amp;lt;/code&amp;gt; || // channelName contains JSON metadata of channel/video name being played&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[nielsenMeter loadMetadata: contentMetadataObject];&amp;lt;/code&amp;gt; || // contentMetadataObject contains the JSON metadata for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;[nielsenMeter setplayheadPosition: 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;
=== SDK Events ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Event !!	Parameter	!! Description&lt;br /&gt;
|-&lt;br /&gt;
| 'loadMetadata'	|| content/ad metadata object	|| Needs to be called at the beginning of each asset&lt;br /&gt;
|-&lt;br /&gt;
| 'setPlayheadPosition'	|| playhead position as integer&amp;lt;br/&amp;gt;&lt;br /&gt;
VOD: || current position in seconds &amp;lt;br/&amp;gt;&lt;br /&gt;
Live: current Unix timestamp (seconds since Jan-1-1970 UTC) &amp;lt;br/&amp;gt;&lt;br /&gt;
Note: 'setPlayheadPosition' has to be called every second&lt;br /&gt;
||&lt;br /&gt;
Pass playhead position every second during playback&lt;br /&gt;
|-&lt;br /&gt;
| 'stop' ||	playhead position	|| Call when content or ads complete playing and pass playhead position&lt;br /&gt;
|-&lt;br /&gt;
| 'end'	|| playhead position in seconds	|| Call when the current video asset completes playback and pass the playhead position. &amp;lt;br/&amp;gt;&lt;br /&gt;
Example: At the end of the content stream, if the user switches to another piece of content, when the browser is refreshed or closed.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: For livestream, send the Unix timestamp; for VOD send the time in seconds as integer. The final playhead position must be sent for the current asset being played before calling &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; or&amp;lt;code&amp;gt; '''loadmetadata'''&amp;lt;/code&amp;gt;,.&amp;lt;/blockquote&amp;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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 [[setPlayheadPosition()]] every one second until a pause / stop.&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;
&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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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;
'''Ad Content'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;    long pos = mAdPlayer.videoPosition() / 1000;&lt;br /&gt;
   if (mAppSdk != null)&lt;br /&gt;
   {&lt;br /&gt;
     mAppSdk.setPlayheadPosition(pos);&lt;br /&gt;
   }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Note: The playhead positions for ad and content should be maintained separately.&amp;lt;/blockquote&amp;gt;&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 (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;
| &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. When content has resumed following an ad break, playhead position must continue from where 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;
* Utilizing the Androidx LifeCycleObserver (The recommended approach starting sdk version 7.1.0.0+)&lt;br /&gt;
* Utilizing the [[DCR_Video_Android_SDK#The_SdkBgFgDetectionUtility_class|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 provides 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;
==== 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;
&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;
&amp;lt;blockquote&amp;gt;&lt;br /&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, can do so by calling the following newly introduced AppSdk public api, passing the application context :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public static void registerLifeCycleObserver(Context applicationContext)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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;
&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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&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 (except when content is buffering) and withhold sending playhead position.&lt;br /&gt;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
{{Template:Android_Privacy_and_Opt-Out}}&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;
'''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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_iOS_SDK&amp;diff=4152</id>
		<title>DCR Poland Video iOS SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_iOS_SDK&amp;diff=4152"/>
		<updated>2020-02-28T20:39:46Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
__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, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following items are required:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 30px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 15%;&amp;quot; | Item&lt;br /&gt;
! Description&lt;br /&gt;
! Source&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''App ID (appid)''' || Unique ID assigned to the player/site and configured by product. || Contact Nielsen&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''sfcode''' || Environment that the SDK must point to || Contact Nielsen&lt;br /&gt;
|-&lt;br /&gt;
|| ☑ || '''Nielsen SDK''' || Includes SDK frameworks and '''sample implementation'''; ''See [[iOS SDK Release Notes]]'' || [[Special:Downloads|Download]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you do not have any of these pre-requisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for iOS using Xcode utilizing the Standard Nielsen SDK for DCR.&lt;br /&gt;
&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
Prior to SDK Version 6.2.0.0 the  IOS framework has been distributed as a static library packaged into framework bundle format. Apple recommends to use dynamic framework, it has some benefits over static libraries like less executable file size of an app, faster startup time and native support in xCode IDE. Nielsen AppSDK has been transformed into dynamic framework in this release ([[iOS_Static_Framework_Setup|static framework]] is still available).&lt;br /&gt;
&lt;br /&gt;
If migrating from the static library to this new dynamic framework, once implemented, unless your specific application requires, you can remove the following Frameworks that were once required:&amp;lt;code&amp;gt; [AdSupport, JavascriptCore, SystemConfiguration, Security, AVFoundation, libc++] &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Dynamic framework is created as a fat framework. It means that it contains slices required for devices (armv7, arm64) as well as slices required for simulators (i386, x86_64). Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore. The example of the shell script that should be added as a Run Script phase in the application can be [[DCR_Video_iOS_SDK#Removing_Simulators|found below]].&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;
&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, when using the dynamic framework,  all the required frameworks are linked automatically as the are needed.  More details can be found here: https://stackoverflow.com/questions/24902787/dont-we-need-to-link-framework-to-xcode-project-anymore&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;
=== Download Framework ===&lt;br /&gt;
The first step is to download and copy the [[Special:Downloads|NielsenAppApi.framework]] bundle to the app project directory. (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Framework ===&lt;br /&gt;
In the General tab for app configuration add NielsenAppApi.framework in the list of Embedded Binaries.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Add Path ===&lt;br /&gt;
Add path to the NielsenAppApi.framework in the Framework Search Paths build setting.  (''Not required if using CocaPods'')&lt;br /&gt;
&lt;br /&gt;
=== Import Framework ===&lt;br /&gt;
Add NielsenAppApi.framework module in the source file of your app:&lt;br /&gt;
&lt;br /&gt;
==== Using Swift ====&lt;br /&gt;
Add the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&amp;lt;/syntaxhighlight&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 NielsenAppApi;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. [[Dual_Instances_of_SDK|(Click here for an example of multiple instances)]]&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
* &amp;quot;pl&amp;quot; &lt;br /&gt;
|| Nielsen-specified || Yes || pl&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sample SDK Initialization Code ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift  = &lt;br /&gt;
Swift 4.0 Example:&lt;br /&gt;
&amp;lt;code&amp;gt;NielsenInit.swift&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
import Foundation&lt;br /&gt;
import NielsenAppApi&lt;br /&gt;
&lt;br /&gt;
class NielsenInit : NSObject {&lt;br /&gt;
    class func createNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
        &lt;br /&gt;
        let appInformation:[String: String] = [&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;pl&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;
Sample code using AVPlayer.&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, AVPlayerViewControllerDelegate  {&lt;br /&gt;
&lt;br /&gt;
// your code//    &lt;br /&gt;
&lt;br /&gt;
  override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Objective C = &lt;br /&gt;
Initialize the Nielsen App object within the viewDidLoad view controller delegate method using initWithAppInfo:delegate:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;If App SDK is initialized using init or new methods, it will ignore the API calls resulting in no measurement. The SDK will not return any errors.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;    &lt;br /&gt;
#import &amp;quot;NielsenInit.h&amp;quot;&lt;br /&gt;
#import &amp;lt;NielsenAppApi/NielsenAppApi.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
@implementation NielsenInit&lt;br /&gt;
&lt;br /&gt;
+ (NielsenAppApi *)createNielsenAppApiWithDelegate:(id&amp;lt;NielsenAppApiDelegate&amp;gt;)delegate&lt;br /&gt;
{    &lt;br /&gt;
    NSDictionary *appInformation = @{ @&amp;quot;appid&amp;quot;: @&amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788XXXXXXX&amp;quot;,&lt;br /&gt;
                            @&amp;quot;appversion&amp;quot;: @&amp;quot;1.0&amp;quot;,&lt;br /&gt;
                            @&amp;quot;sfcode&amp;quot;: @&amp;quot;pl&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;
&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;NielsenInit.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 NielsenAppApiDelegate;&lt;br /&gt;
&lt;br /&gt;
@interface NielsenInit : 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;
Sample Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
@implementation ViewController&lt;br /&gt;
&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
        &lt;br /&gt;
    //Getting the instance of Nielsen SDK&lt;br /&gt;
    nielsenApi = [NielsenInit createNielsenAppApiWithDelegate:nil];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== APP SDK Error &amp;amp; Event Codes ==&lt;br /&gt;
To view the Error and Event codes for iOS and Android, please review the [[APP SDK Event Codes|App SDK Event Code]] Reference page.&lt;br /&gt;
&lt;br /&gt;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All the SDK methods handles only two types of objects: NSString, NSDictionary. The parameters passed must be either a JSON formatted string or a NSDictionary object. The JSON passed in the SDK must be well-formed.&lt;br /&gt;
* NSDictionary object&lt;br /&gt;
** If an object of unexpected type is passed to the method, the error message will be logged.&lt;br /&gt;
** If string has invalid JSON format, the error message will be logged.&lt;br /&gt;
* JSON value must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
** All the Variable Names like appid, appname, sfcode, dataSrc, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
* JSON string can be prepared using either raw NSString or serialized NSDictionary.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
let channelInfo = [&lt;br /&gt;
    &amp;quot;channelName&amp;quot;: &amp;quot;My Channel Name 1&amp;quot;,&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
let contentMetadata = [&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
    &amp;quot;assetid&amp;quot;: &amp;quot;C77664&amp;quot;,&lt;br /&gt;
    &amp;quot;title&amp;quot;: &amp;quot;Program S2, E3&amp;quot;,&lt;br /&gt;
    &amp;quot;isfullepisode&amp;quot;: &amp;quot;Yes&amp;quot;,&lt;br /&gt;
    &amp;quot;program&amp;quot;: &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
    &amp;quot;length&amp;quot;: &amp;quot;3600&amp;quot;,&lt;br /&gt;
    &amp;quot;airdate&amp;quot;: &amp;quot;20171020 10:05:00&amp;quot;,&lt;br /&gt;
    &amp;quot;adloadtype&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt;
    &amp;quot;segB&amp;quot;: &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
    &amp;quot;segC&amp;quot;: &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * 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;
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;C77664&amp;quot;,&lt;br /&gt;
        @ &amp;quot;title&amp;quot;: @ &amp;quot;S2,E3&amp;quot;,&lt;br /&gt;
        @ &amp;quot;isfullepisode&amp;quot;: @ &amp;quot;y&amp;quot;,  &lt;br /&gt;
        @ &amp;quot;program&amp;quot;: @ &amp;quot;Program Name&amp;quot;,&lt;br /&gt;
        @ &amp;quot;length&amp;quot;: @ &amp;quot;3600&amp;quot;,&lt;br /&gt;
        @ &amp;quot;airdate&amp;quot;: @ &amp;quot;20180120 10:00:00&amp;quot;,&lt;br /&gt;
        @ &amp;quot;adloadtype&amp;quot;: @ &amp;quot;2&amp;quot;,&lt;br /&gt;
        @ &amp;quot;segB&amp;quot;: @ &amp;quot;CustomSegmentValueB&amp;quot;, //optional&lt;br /&gt;
        @ &amp;quot;segC&amp;quot;: @ &amp;quot;CustomSegmentValueC&amp;quot;, //optional&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ChannelName metadata ===&lt;br /&gt;
channelName should remain constant throughout the completion of an episode or live stream.&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	|| ChannelInfo refers to the Channel name. This can be a free-form value&lt;br /&gt;
value such as a friendly name for the content being played. the SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
will pass the application name automatically.&lt;br /&gt;
|| custom	|| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the entirety of an episode / clip including when ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || The airdate in the linear TV. Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDD HH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	||&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || standard episode ID	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 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;
{| 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;'preroll'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'midroll'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'postroll'&amp;lt;/code&amp;gt;||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Ad Object ===&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Swift = &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;123456&amp;quot;&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;     &lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt; &lt;br /&gt;
NSDictionary * adMetadata = @ {&lt;br /&gt;
    @ &amp;quot;type&amp;quot;: @ &amp;quot;preroll&amp;quot;,&lt;br /&gt;
    @ &amp;quot;assetid&amp;quot;: @ &amp;quot;AD-ID123&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Nielsen API Documentation ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;play&amp;lt;/code&amp;gt; to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Pass in channelName metadata as described above.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;   [nielsenApi play:([NSDictionary *channel loadChannelInfo)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.play(channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
Call to inform SDK about asset being played. Pass in metadata as described here [[#Configure Payload]], [[#Content Metadata]]&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi loadMetadata:(contentMetadata)];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.loadMetadata(contentMetadata)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== playheadPosition ===&lt;br /&gt;
Call to inform Nielsen SDK about position in video asset (for VOD pass second within video, for livestreams UTC timestamp in seconds).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi playheadPosition:secondsAsInt];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.playheadPosition(secondsAsInt)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== stop ===&lt;br /&gt;
Call to indicate interruption during playback, e.g. pause. (more on interruption scenarios here: [[#Interruptions during playback]] )&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi stop];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
Call when content finished playback and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;[nielsenApi end];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;nielsenApi?.end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
[[File:appsdkTimeline-DCR.png|icon|link=]]&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;syntaxhighlight lang=Swift&amp;gt;&lt;br /&gt;
nielsenApi = NielsenInit.createNielsenApi(delegate: self);&lt;br /&gt;
data = loadStaticMetadata();&lt;br /&gt;
nielsenApi.loadMetadata(self.data);&amp;lt;/syntaxhighlight&amp;gt; || // Pass Static Metadata here if applicable&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;nielsenApi.play(channelName)&amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.loadMetadata(contentMetadata)&amp;lt;/code&amp;gt; || // MetadataObject contains the JSON metadata&amp;lt;br&amp;gt; for the content being played&lt;br /&gt;
|-&lt;br /&gt;
| Content || &amp;lt;code&amp;gt;nielsenApi.playheadPosition(pos);&amp;lt;/code&amp;gt; || // playheadPosition is position of the playhead &amp;lt;br&amp;gt;while the content is being played&lt;br /&gt;
|-&lt;br /&gt;
| End of Stream || &amp;lt;code&amp;gt;nielsenApi.end()&amp;lt;/code&amp;gt; || // Content playback is completed.&lt;br /&gt;
|}&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 '''Idle 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 an event to occur.&lt;br /&gt;
# '''Processing state''' – The SDK instance is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position is active.  If a LIVE event, use the current UNIX timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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. &lt;br /&gt;
## &amp;lt;code&amp;gt;'''appDisableApi'''&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 / stop.&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;nielsenApi.play(channelName); &amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;
&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;
}&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 / stop / another [[loadMetadata()]] is called. 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;nielsenApi.play(channelName); &amp;lt;/code&amp;gt; || // channelName now automatically generated by Nielsen SDK&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.stop();&amp;lt;/code&amp;gt; || // App moves to background(midroll pauses) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.loadMetadata(midrollMetaDataObject);&amp;lt;/code&amp;gt; || // App moves to foreground (midroll resumes) &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.stop();&amp;lt;/code&amp;gt; || // Call stop after midroll occurs&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Content (End of stream) || &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;
| &amp;lt;code&amp;gt;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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;nielsenApi.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 begin from 0 at ad start.  When content has resumed following an ad break, playhead position must continue from where 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;
For iOS, background/foreground detection is handled by the app lifecylce APIs which are provided by [https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html Apple:]&lt;br /&gt;
&lt;br /&gt;
Foreground/Background state measurement is a requirement of Nielsen AppSDK implementation which is especially crucial for static measurement.&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;
* Start sending API calls – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are three primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Limit Ad Tracking'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen iOS SDK (&amp;lt; 5.1.1.18)&lt;br /&gt;
# '''[[#App_Level_Opt_Out|App Level Opt-Out]]''' - Where [https://developer.apple.com/documentation/adsupport Ad Framework] cannot be leveraged&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen iOS '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the iOS's ''Limit Ad Tracking'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Limit Ad Tracking&amp;quot;'' setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen iOS '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen iOS SDK 5.1.1.17 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the legacy 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 close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=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;
==== Legacy Opt-out example code ====&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)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {&lt;br /&gt;
&lt;br /&gt;
    NSURLRequest *request = [navigationAction request];&lt;br /&gt;
    NSString *url = [[request URL]absoluteString];&lt;br /&gt;
    &lt;br /&gt;
    if([url isEqualToString:self.NIELSEN_URL_OPT_OUT] || [url isEqualToString:self.NIELSEN_URL_OPT_IN]){&lt;br /&gt;
        [self.nielsenApi userOptOut:url];&lt;br /&gt;
        decisionHandler(WKNavigationActionPolicyAllow);&lt;br /&gt;
    }else{&lt;br /&gt;
        decisionHandler(WKNavigationActionPolicyCancel);&lt;br /&gt;
    }        &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var webView: WKWebView!&lt;br /&gt;
var NIELSEN_URL_OPT_OUT : String = &amp;quot;nielsenappsdk://1&amp;quot;&lt;br /&gt;
var NIELSEN_URL_OPT_IN : String = &amp;quot;nielsenappsdk://0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -&amp;gt; Void) {&lt;br /&gt;
&lt;br /&gt;
       let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
            decisionHandler(.allow)&lt;br /&gt;
&lt;br /&gt;
        }else{&lt;br /&gt;
           decisionHandler(.cancel)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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 App-level 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;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/pl/pl/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
- (void)viewDidLoad {&lt;br /&gt;
&lt;br /&gt;
    [super viewDidLoad];&lt;br /&gt;
    &lt;br /&gt;
    //Setting background image&lt;br /&gt;
    UIImage *backgroundImage = [UIImage imageNamed:@&amp;quot;new_ios_bg.png&amp;quot;];&lt;br /&gt;
    UIImageView *backgroundImageView=[[UIImageView alloc]initWithFrame:self.view.frame];&lt;br /&gt;
    backgroundImageView.image=backgroundImage;&lt;br /&gt;
    [self.view insertSubview:backgroundImageView atIndex:0];&lt;br /&gt;
&lt;br /&gt;
    self.nielsenApi = [NielsenInit createNielsenAppApiWithDelegate:nil];&lt;br /&gt;
&lt;br /&gt;
    //Initialising the webview&lt;br /&gt;
    WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];&lt;br /&gt;
    _wkwebView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration];&lt;br /&gt;
    _wkwebView.navigationDelegate = self;&lt;br /&gt;
&lt;br /&gt;
     //Getting the optPut URL from SDK&lt;br /&gt;
    NSURL *nsurl=[NSURL URLWithString:[self.nielsenApi optOutURL]];&lt;br /&gt;
&lt;br /&gt;
    //Setting url request in webview&lt;br /&gt;
    NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];&lt;br /&gt;
&lt;br /&gt;
     //Setting url request in webview&lt;br /&gt;
    [_wkwebView loadRequest:nsrequest];&lt;br /&gt;
&lt;br /&gt;
      //Adding webview to the controller view &lt;br /&gt;
    [self.view addSubview:_wkwebView];   &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Swift = &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;
    &lt;br /&gt;
    var webView: WKWebView!&lt;br /&gt;
    var nielsenApi: NielsenAppApi!&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;
        self.view.backgroundColor = UIColor(patternImage: UIImage(named: &amp;quot;new_ios_bg.png&amp;quot;)!) &lt;br /&gt;
        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&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;
    }&lt;br /&gt;
    &lt;br /&gt;
}&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;
=== App Level Opt Out ===&lt;br /&gt;
This is only used if the Ad Framework is not available.  The Opt-Out occurs by opening a Nielsen-defined web page and passing the user choice from the 'WebView'. In order to do this, the application needs to:&lt;br /&gt;
* Implement the UIWebView delegate method to open the Nielsen Privacy web page&lt;br /&gt;
* Capture user's selection&lt;br /&gt;
* Pass the selection back to the SDK via the &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Capture and forward user selection ====&lt;br /&gt;
{{ExampleCode|&lt;br /&gt;
|Objective C = &amp;lt;syntaxhighlight lang=&amp;quot;objective-c&amp;quot;&amp;gt;&lt;br /&gt;
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType&lt;br /&gt;
{&lt;br /&gt;
    NSString *command = [NSString stringWithFormat:@&amp;quot;%@&amp;quot;,request.URL];&lt;br /&gt;
    if ([command isEqualToString:kNielsenWebClose]) {&lt;br /&gt;
        // Close the WebView&lt;br /&gt;
        [self performSelector:@selector(closeOptOutView) withObject:nil afterDelay:0];&lt;br /&gt;
        return NO;&lt;br /&gt;
    }&lt;br /&gt;
    // Retrieve next URL if it’s not opt-in/out selection&lt;br /&gt;
    return (![nAppApiObject userOptOut:command]);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt; with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.&lt;br /&gt;
**&amp;lt;code&amp;gt;[nAppApiObject userOptOut:command]&amp;lt;/code&amp;gt; passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When 'WebView' is closed, pass the status returned from 'WebView' to the SDK within the app. The App SDK manages the user's choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
|Swift = &amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -&amp;gt; Bool {&lt;br /&gt;
&lt;br /&gt;
        let command = request.url?.absoluteString&lt;br /&gt;
        if  command ==  &amp;quot;kNielsenWebClose&amp;quot;{&lt;br /&gt;
&lt;br /&gt;
            self.perform(#selector(closeOptOutView), with: nil, afterDelay: 0)&lt;br /&gt;
&lt;br /&gt;
            return false&lt;br /&gt;
        }    &lt;br /&gt;
        return NielsenAppApi.optOutURL&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes &amp;lt;code&amp;gt;userOptOut&amp;lt;/code&amp;gt; with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.&lt;br /&gt;
**&amp;lt;code&amp;gt;[nAppApiObject userOptOut:command]&amp;lt;/code&amp;gt; passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' When 'WebView' is closed, pass the status returned from 'WebView' to the SDK within the app. The App SDK manages the user's choice (Opt-Out / Opt-In), the app does not need to manage this status.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== AirPlay ==&lt;br /&gt;
To implement OTT measurement, report OTT changes to the SDK using 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;
== 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;
&amp;lt;br/&amp;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;br /&gt;
&lt;br /&gt;
== Removing Simulators (Dynamic Framework Only)==&lt;br /&gt;
&lt;br /&gt;
Simulator slices are needed to let clients build and debug their app on the simulators, but they should be removed before sending the app to the AppStore.  Here is an example Shell script that could be added as a Run Script phase in the application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='bash'&amp;gt;&lt;br /&gt;
&lt;br /&gt;
APP_PATH=&amp;quot;${TARGET_BUILD_DIR}/${WRAPPER_NAME}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This script loops through the frameworks embedded in the application and&lt;br /&gt;
# removes unused architectures.&lt;br /&gt;
find &amp;quot;$APP_PATH&amp;quot; -name '*.framework' -type d | while read -r FRAMEWORK&lt;br /&gt;
do&lt;br /&gt;
FRAMEWORK_EXECUTABLE_NAME=$(defaults read &amp;quot;$FRAMEWORK/Info.plist&amp;quot; CFBundleExecutable)&lt;br /&gt;
FRAMEWORK_EXECUTABLE_PATH=&amp;quot;$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
echo &amp;quot;Executable is $FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
EXTRACTED_ARCHS=()&lt;br /&gt;
&lt;br /&gt;
for ARCH in $ARCHS&lt;br /&gt;
do&lt;br /&gt;
echo &amp;quot;Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME&amp;quot;&lt;br /&gt;
lipo -extract &amp;quot;$ARCH&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot; -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;&lt;br /&gt;
EXTRACTED_ARCHS+=(&amp;quot;$FRAMEWORK_EXECUTABLE_PATH-$ARCH&amp;quot;)&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Merging extracted architectures: ${ARCHS}&amp;quot;&lt;br /&gt;
lipo -o &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; -create &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
rm &amp;quot;${EXTRACTED_ARCHS[@]}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Replacing original executable with thinned version&amp;quot;&lt;br /&gt;
rm &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
mv &amp;quot;$FRAMEWORK_EXECUTABLE_PATH-merged&amp;quot; &amp;quot;$FRAMEWORK_EXECUTABLE_PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the Simplified API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen Simplified API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen Simplified API integrated into a custom video player.&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Swift 4.0 Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Objective-C Sample]&lt;br /&gt;
** [https://engineeringportal.nielsen.com/docs/Special:Downloads Java/Android Studio Sample]&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Android_SDK&amp;diff=4151</id>
		<title>DCR Poland Video Android SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Android_SDK&amp;diff=4151"/>
		<updated>2020-02-28T20:38:19Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|International}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc.&lt;br /&gt;
The App SDK is the framework for mobile application developers to integrate Nielsen Measurement into their media player applications. It supports a variety of Nielsen Measurement Products like Digital in TV Ratings, Digital Content Ratings ([[DCR &amp;amp; DTVR]]), 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;
To start using the App SDK, the following details are required:&lt;br /&gt;
* '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
* '''sfcode:''' Unique identifier for the environment that the SDK should point to.&lt;br /&gt;
* '''Nielsen SDK:''' The Nielsen SDK package contains a variety of sample players for your reference.&lt;br /&gt;
If you do not have any of these prerequisites or if you have any questions, please contact our SDK sales support team.&lt;br /&gt;
Refer to [[Digital Measurement Onboarding]] guide for information on how to get a Nielsen App SDK and appid.&lt;br /&gt;
&lt;br /&gt;
==  Implementation ==&lt;br /&gt;
This guide covers implementation steps for Android Studio utilizing the Standard Nielsen SDK for DCR.&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;
&lt;br /&gt;
== Setting up your  Development Environment  ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring Android Development Environment ===&lt;br /&gt;
*The Nielsen App SDK (located in the [https://engineeringportal.nielsen.com/docs/Special:Downloads Downloads section] of the website) class is the primary application interface to the Nielsen App SDK on Android.&lt;br /&gt;
*The Nielsen App SDK class is defined as the only public class belonging to the com.nielsen.app.sdk package.&lt;br /&gt;
&lt;br /&gt;
'''Nielsen App SDK is compatible with Android OS versions 2.3+. Clients can control / configure the protocol to be used – HTTPS or HTTP to suit their needs.'''&lt;br /&gt;
&lt;br /&gt;
The requirement for the Java ''AppSdk.jar'' library and the ''libAppSdk.so'' native library will depend on the type of host application that will make use of them.&lt;br /&gt;
* '''For Video player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should use a media player supporting HLS streaming (Android 3.0 and later will support it natively).&lt;br /&gt;
** If the player application uses a 3rd party media player implementing its own HLS, then the minimum Android version will be limited to version 2.3, since the SDK depends on Google Play support to work properly.&lt;br /&gt;
* '''For Audio player applications'''&lt;br /&gt;
** The Android OS hosting the App SDK should be at version 2.3 and later since the SDK depends on the Google Play support to work properly.&lt;br /&gt;
Once SDK is downloaded ensure to unzip the Nielsen SDK and copy the AppSdk.jar in your app (Android Studio) libs folder, then right click the AppSdk.jar and select '''Add As Library'''.&lt;br /&gt;
Ensure the AppSdk.jar file is added in 'build.grade (App Level) file.&lt;br /&gt;
* App SDK 1.2 provides support for x86, mips, and armeabi-7a architecture.&lt;br /&gt;
&lt;br /&gt;
==== Google Play Services ====&lt;br /&gt;
Add the Google Play Services in the project,&lt;br /&gt;
Steps: Android Studio -&amp;gt; File -&amp;gt; Project Structure -&amp;gt;(In module selection) select App -&amp;gt; Dependencies (tab) -&amp;gt; Click &amp;quot;+&amp;quot; button and select &amp;lt;code&amp;gt;&amp;quot;com.google.android.gms:play-services&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Ensure it is added in build.gradle (App level) file&lt;br /&gt;
&lt;br /&gt;
==== Manifest File ==== &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 to handle runtime permissions in Android versions, please visit [https://developer.android.com/training/permissions/requesting.html].   &lt;br /&gt;
&lt;br /&gt;
* In &amp;lt;code&amp;gt;AndroidManifest.xml &amp;lt;/code&amp;gt;under &amp;lt;application&amp;gt; node add the following metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;lt;meta-data &lt;br /&gt;
android:name=&amp;quot;com.google.android.gms.version&amp;quot; &lt;br /&gt;
android:value=&amp;quot;@integer/google_play_services_version&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* App SDK checks to see if there is a Google service available and updated.&lt;br /&gt;
* If not available or updated, App SDK will not use this service when executing its functions and will make reference to missing imports and the app will not be compiled.&lt;br /&gt;
&lt;br /&gt;
==== Library ====&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;
==== Classes/package ====&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;
== SDK Initialization ==&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
* A maximum of four SDK instances per appid are supported. &lt;br /&gt;
* When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
The following table contains the list of arguments that can be passed via the AppInfo JSON schema.&lt;br /&gt;
&lt;br /&gt;
* The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter / Argument !! Description !! Source !! Required? !! Example&lt;br /&gt;
|-&lt;br /&gt;
| appid || Unique id for the application assigned by Nielsen. It is GUID data type.|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
| appname || Name of the application || Client-defined || Optional; automatically detected in SDK 6.0.0.4 and above || Nielsen Sample App&lt;br /&gt;
|-&lt;br /&gt;
| sfcode || Nielsen collection facility to which the SDK should connect.&lt;br /&gt;
* &amp;quot;pl&amp;quot;&lt;br /&gt;
|| Nielsen-specified || Yes || pl&lt;br /&gt;
|-&lt;br /&gt;
| nol_devDebug || Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|| Nielsen-specified || Optional || &amp;quot;DEBUG&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debug flag for development environment ==&lt;br /&gt;
Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,&lt;br /&gt;
Pass the argument &amp;lt;code&amp;gt;@&amp;quot;nol_devDebug&amp;quot;:@&amp;quot;INFO&amp;quot;&amp;lt;/code&amp;gt;, in the JSON string . The permitted values are:&lt;br /&gt;
&lt;br /&gt;
* '''INFO''': Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.&lt;br /&gt;
* '''WARN''': Indicates potential integration / configuration errors or SDK issues.&lt;br /&gt;
* '''ERROR''': Indicates important integration errors or non-recoverable SDK issues.&lt;br /&gt;
* '''DEBUG''': Debug logs, used by the developers to debug more complex issues.&lt;br /&gt;
&lt;br /&gt;
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note''': DO NOT activate the Debug flag in a production environment.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sample SDK Initialization Code ====&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;
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;pl&amp;quot;)&lt;br /&gt;
          .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;DEBUG&amp;quot;); // only for debug builds&lt;br /&gt;
&lt;br /&gt;
// Pass appSdkConfig to the AppSdk constructor&lt;br /&gt;
mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&lt;br /&gt;
}&lt;br /&gt;
catch (JSONException e)&lt;br /&gt;
{&lt;br /&gt;
  Log.e(TAG, &amp;quot;Couldn’t prepare JSONObject for appSdkConfig&amp;quot;, e);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;appContext&amp;lt;/code&amp;gt; is the App context object and &amp;lt;code&amp;gt;appSdkConfig&amp;lt;/code&amp;gt; is JSON object for holding the parameters (&amp;lt;code&amp;gt;appid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sfcode&amp;lt;/code&amp;gt;) the App passes to the Nielsen App SDK via a JSON string. The appid is obtained from Nielsen operational support and is unique to the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integration of Nielsen App SDK will depend on type of client app.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Ensure that SDK files (AppSdk.jar and libAppSdk.so [App SDK 1.2 Only]) are included under the App’s project and the App SDK is linked to the App (the setting to link App SDK to the App can be found on property page of the App’s project).&lt;br /&gt;
&lt;br /&gt;
== 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;
== Configure Payload ==&lt;br /&gt;
=== Handling JSON Metadata ===&lt;br /&gt;
All metadata needs to passed to the SDK using JSONObject instances.&lt;br /&gt;
* JSON values must be string value.&lt;br /&gt;
** This includes boolean and numeric values. For example, a value of true should be represented with &amp;quot;true&amp;quot;, number value 123 should be &amp;quot;123&amp;quot;.&lt;br /&gt;
* All the variable names like appid, appname, sfcode, title, type etc. are case-sensitive. Use the correct variable name as specified in the documentation.&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject contentMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&lt;br /&gt;
    .put(&amp;quot;type&amp;quot;, &amp;quot;content&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;assetid&amp;quot;, &amp;quot;vid345-67483&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;program&amp;quot;, &amp;quot;Program Name&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;title&amp;quot;, &amp;quot;Program S3, EP1&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;length&amp;quot;, &amp;quot;3600&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;segB&amp;quot;, &amp;quot;CustomSegmentValueB&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;segC&amp;quot;, &amp;quot;CustomSegmentValueC&amp;quot;)  //optional&lt;br /&gt;
    .put(&amp;quot;isfullepisode&amp;quot;, &amp;quot;yes&amp;quot;)&lt;br /&gt;
    .put(&amp;quot;airdate&amp;quot;, &amp;quot;20161013 20:00:00&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ChannelName metadata === &lt;br /&gt;
channelName should remain constant throughout the completion of an episode or live stream.&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	|| ChannelInfo refers to the Channel name. This can be a free-form value&lt;br /&gt;
value such as a friendly name for the content being played. the SDK&amp;lt;br/&amp;gt;&lt;br /&gt;
will pass the application name automatically.&lt;br /&gt;
|| custom	|| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Content Metadata ====&lt;br /&gt;
Content metadata should remain constant throughout the completion of an episode / clip including the ads play.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Description !!	Values	 !! Required&lt;br /&gt;
|-&lt;br /&gt;
| type || type of asset	|| &amp;quot;content&amp;quot; || ✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid	|| unique ID assigned to asset (max 64 characters; only characters 0-9, a-z, A-Z underscore and minus are allowed - no special characters or vowel mutations) || custom (no [[Special Characters]])|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| program	|| (string) name of program (max 254 characters)	|| custom	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| title	|| (string) episode title (max 254 characters)	|| custom - no backslash allowed in string (because of 3rd party data processing) || ✓&lt;br /&gt;
|-&lt;br /&gt;
| length	|| (int) length of content in seconds	|| 86400 seconds for live stream. For Event-Livestreams planned length. For VoD video length||	✓&lt;br /&gt;
|-&lt;br /&gt;
| airdate || The airdate in the linear TV. Original (local) air date and time (hh:mm:ss as 24h time stamp); if not known set it to eg. &amp;quot;19700101 00:00:00&amp;quot;	||	YYYY-MM-DDTHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS+xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYY-MM-DDTHH:MI:SS-xx:xx&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDDHH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
YYYYMMDD HH:MI:SS&amp;lt;br&amp;gt;&lt;br /&gt;
MM-DD-YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
MM/DD/YYYY&amp;lt;br&amp;gt;&lt;br /&gt;
 (pass beginning of epoch if unknown)&lt;br /&gt;
	|| ✓&lt;br /&gt;
|-&lt;br /&gt;
| isfullepisode || full episode flag	||	&amp;quot;y&amp;quot;- full episode, &amp;quot;n&amp;quot;- non full episode	||&lt;br /&gt;
|-&lt;br /&gt;
| progen || program genre	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segB || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| segC || custom segment	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| crossId1 || standard episode ID	||	custom	||&lt;br /&gt;
|-&lt;br /&gt;
| clientid	|| &lt;br /&gt;
parent ID – value is automatically populated through provided AppID.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to override the brand configured to the AppID, pass parent &amp;lt;br/&amp;gt;&lt;br /&gt;
value here and the sub-brand ID associated to that brand in the subbrand &amp;lt;br/&amp;gt;&lt;br /&gt;
key (e.g. multiple brands in App)	&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen	&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
| subbrand	|| vcid/sub-brand ID – value is automatically populated through provided&amp;lt;br/&amp;gt;&lt;br /&gt;
AppID. In order to override the sub-brand configured to the AppID, value can &amp;lt;br/&amp;gt;&lt;br /&gt;
be passed here (e.g. multiple sub-brands in App)&lt;br /&gt;
||&lt;br /&gt;
provided by Nielsen&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ad Metadata ===&lt;br /&gt;
The ad metadata (if applicable) should be passed for each individual ad, if ads are available during or before the stream begins.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys	!! Description	!! Values	!! Required&lt;br /&gt;
|-&lt;br /&gt;
| type	|| type of ad	|| 'preroll', 'midroll', or 'postroll' ||	✓&lt;br /&gt;
|-&lt;br /&gt;
| assetid ||	unique ID assigned to ad	|| custom	|| ✓&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Ad Object ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
JSONObject adMetadata = new JSONObject()&lt;br /&gt;
//SDK Metadata&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;AD-ID123&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== Nielsen API Documentation ==&lt;br /&gt;
=== play ===&lt;br /&gt;
Use [[DCR_Video_APP_SDK#play|play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player. Pass in channelName metadata as described above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void play(JSONObject channelInfo);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== loadMetadata ===&lt;br /&gt;
Call to inform SDK about asset being played. Pass in metadata as described here [[#Configure Payload]], [[#Content Metadata]]&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void loadMetadata(JSONObject contentMetadata);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setPlayheadPosition ===&lt;br /&gt;
Call to inform Nielsen SDK about position in video asset (for VOD pass second within video, for livestreams UTC timestamp in seconds).&lt;br /&gt;
&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;
=== stop ===&lt;br /&gt;
Call to indicate interruption during playback, e.g. pause. (more on interruption scenarios here: [[#Interruptions during playback]] )&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void stop()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== end ===&lt;br /&gt;
When content has finished playback and content cannot be resumed from the same position (it can only be restarted from the beginning of stream).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;public void end()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Call Nielsen APIs ==&lt;br /&gt;
&lt;br /&gt;
=== Sample API Sequence ===&lt;br /&gt;
A Sample API sequence could follow this flow:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Sample code !! Description&lt;br /&gt;
|-&lt;br /&gt;
|On App Start||&amp;lt;code&amp;gt;mAppSdk = new AppSdk(appContext, appSdkConfig, appSdkListener);&amp;lt;/code&amp;gt; || // contentMetadata Object contains the JSON metadata for the impression&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Start of stream || &amp;lt;code&amp;gt;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(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;mAppSdk.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 is processing playing information. The &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; 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;
## &amp;lt;code&amp;gt;'''setplayheadPosition'''&amp;lt;/code&amp;gt; – Call this API every one second when playhead position timer is fired.  If a LIVE event, use the current Unix timestamp (seconds since Jan-1-1970 UTC).&lt;br /&gt;
## &amp;lt;code&amp;gt;'''stop'''&amp;lt;/code&amp;gt; – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.&lt;br /&gt;
## &amp;lt;code&amp;gt;'''end'''&amp;lt;/code&amp;gt; – 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 set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Note:''' For API Version 5.1 and above, App SDK will fire data pings and continue measurement even after the user has opted out from Nielsen measurement on a device. The data ping will be marked as opted-out ping.&lt;br /&gt;
&lt;br /&gt;
'''Note''': In case of any interruptions during playback due to alarm, calendar, call, flight mode, Wi-Fi toggle, channel change, etc., call [[stop]] to stop the measurement.&lt;br /&gt;
* As soon as the playback resumes, call &amp;lt;code&amp;gt;'''play'''&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'''loadMetadata''' &amp;lt;/code&amp;gt; and   &amp;lt;code&amp;gt;'''playheadPosition'''&amp;lt;/code&amp;gt; &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;
&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 [[setPlayheadPosition()]] every one second until a pause / stop.&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;
&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;
}&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 [[setPlayheadPosition()]] every one second until a pause / stop / another [[loadMetadata()]] is called. 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 (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;
| &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. When content has resumed following an ad break, playhead position must continue from where 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;
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;
* Enable the Nielsen SDK to measure background/foreground state by makingthe 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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;application android:name=&amp;quot;com.nielsen.app.sdk.AppSdkApplication&amp;quot;&amp;gt;&lt;br /&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 background/foreground state is implemented using the  [https://engineeringportal.nielsen.com/docs/Android_Background_Foreground SdkBgFgDetectionUtility class].  The  [https://engineeringportal.nielsen.com/docs/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   [https://engineeringportal.nielsen.com/docs/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;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
AppLaunchMeasurementManager.appInForeground(getApplicationContext());&lt;br /&gt;
AppLaunchMeasurementManager.appInBackground(getApplicationContext());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Within the lifecycle of individual activities, onResume() and onPause() are best suited to providing indication of the app state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Correct measurement of the foreground/background state is crucial to Static App measurement within Nielsen Digital Content Ratings (DCR).&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;
* Start sending pings – &amp;lt;code&amp;gt;'loadMetadata'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'playheadPosition'&amp;lt;/code&amp;gt; for the new viewing session, once the playback resumes.&lt;br /&gt;
Please see the [https://engineeringportal.nielsen.com/docs/Digital_Measurement_Interruption_Scenarios Interruption Scenarios Page] for more details&lt;br /&gt;
&lt;br /&gt;
== Pre-Certification Checklists ==&lt;br /&gt;
After the application is ready to be sent for Nielsen Certification, please go through the [[Digital Pre-Certification Checklist App SDK]] and ensure the app behaves as expected, before submitting to Nielsen.&lt;br /&gt;
&lt;br /&gt;
== Privacy and Opt-Out ==&lt;br /&gt;
There are two primary methods for implementing user Opt-out preferences:&lt;br /&gt;
# '''[[#OS-level_Opt-out|OS-level Opt-out]]''' - managed by ''Opt out of Ads Personalization'' setting on device ('''preferred approach''').&lt;br /&gt;
# '''[[#Legacy_Opt-out|Legacy Opt-out]]''' - Direct call to SDK; used only for older versions of Nielsen Android SDK versions (&amp;lt; 5.1.1.18)&lt;br /&gt;
&lt;br /&gt;
=== OS-level Opt-out ===&lt;br /&gt;
''OS-level Opt-out'' method available on Nielsen Android '''SDK Versions 5.1.1.18 and above'''.&lt;br /&gt;
&lt;br /&gt;
The Nielsen SDK automatically leverages the Android's ''Opt out of Ads Personalization'' setting. The user is opted out of demographic measurement if the OS-level ''&amp;quot;Opt out of Ads Personalization&amp;quot;'' (&amp;quot;Limit Ad Tracking&amp;quot; for iOS) setting is ''enabled''. As a publisher, you cannot override this setting.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Opt-out ===&lt;br /&gt;
The ''Legacy opt-out'' method is only necessary for Nielsen Android '''SDK versions less than 5.1.1.18'''.&lt;br /&gt;
&lt;br /&gt;
Nielsen Android SDK 5.1.1.18 and above will check for ''OS-level opt-out'' first, if available. The user will be opted out if indicated at the OS-level '''OR''' the App-level.&lt;br /&gt;
&lt;br /&gt;
==== The legacy opt-out method works as follows: ====&lt;br /&gt;
* Get the current Nielsen opt-out URL via [[userOptOutURLString()]]&lt;br /&gt;
* Display a WebView element whose loadUrl is set to the value obtained from [[userOptOutURLString()]]&lt;br /&gt;
* Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView&lt;br /&gt;
** Opt-out if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://1&amp;lt;/code&amp;gt;&lt;br /&gt;
** Opt-in if the WebView URL = &amp;lt;code&amp;gt;nielsenappsdk://0&amp;lt;/code&amp;gt;&lt;br /&gt;
* Pass the detected URL to the [[userOptOut()]] function&lt;br /&gt;
** Example: &amp;lt;syntaxhighlight lang=java&amp;gt;appSdk.userOptOut(&amp;quot;nielsenappsdk://1&amp;quot;);  // User opt-out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Legacy Opt Out example code ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
WebView webView;&lt;br /&gt;
AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_OUT = &amp;quot;nielsenappsdk://1&amp;quot;;&lt;br /&gt;
  private static final String NIELSEN_URL_OPT_IN = &amp;quot;nielsenappsdk://0&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
//  Within your app you would provide your User the option to Opt Out.&lt;br /&gt;
//  Perhaps via a toggle or button&lt;br /&gt;
//  This is separate from Limit Ad Tracking &lt;br /&gt;
&lt;br /&gt;
      let urlStr = navigationAction.request.url?.absoluteString&lt;br /&gt;
&lt;br /&gt;
        if(urlStr == NIELSEN_URL_OPT_OUT || urlStr == NIELSEN_URL_OPT_IN){&lt;br /&gt;
            let appApi = self.nielsenApi&lt;br /&gt;
            appApi?.userOptOut(urlStr)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Retrieve current Opt-Out preference ===&lt;br /&gt;
Whether the user is opted out viaOS-level Opt-out or via App-level Opt-out, the current Opt-Out status as detected by the SDK is available via the [[getOptOutStatus()]] property in the Nielsen Android SDK API,&lt;br /&gt;
&lt;br /&gt;
=== Required Privacy Links ===&lt;br /&gt;
Users must either have access to the &amp;quot;About Nielsen Measurement&amp;quot; page, or have similar text available within the native app. Include &amp;quot;About Nielsen Measurement&amp;quot; and &amp;quot;Your Choices&amp;quot; link in the Privacy Policy / EULA or as a button near the link to the app's Privacy Policy.&lt;br /&gt;
&lt;br /&gt;
In addition, the following text must be included in your app store description.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
'''&amp;quot;Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see http://priv-policy.imrworldwide.com/priv/mobile/pl/pl/optout.html for more information&amp;quot;'''&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
==== Webview Example  ====&lt;br /&gt;
The below code is an example of displaying the Nielsen Privacy page to the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class OptOutActivity extends AppCompatActivity implements IAppNotifier {&lt;br /&gt;
&lt;br /&gt;
    WebView webView;&lt;br /&gt;
    AppSdk appSdk;&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public void onCreate(@Nullable Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.activity_optout);&lt;br /&gt;
        webView = (WebView) findViewById(R.id.webView);&lt;br /&gt;
&lt;br /&gt;
        webView.getSettings().setJavaScriptEnabled(true);&lt;br /&gt;
&lt;br /&gt;
        webView.setWebViewClient(new WebViewClient() {&lt;br /&gt;
            @SuppressWarnings(&amp;quot;deprecation&amp;quot;)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {&lt;br /&gt;
                Toast.makeText(OptOutActivity.this, description, Toast.LENGTH_SHORT).show();&lt;br /&gt;
            }&lt;br /&gt;
            @TargetApi(android.os.Build.VERSION_CODES.M)&lt;br /&gt;
            @Override&lt;br /&gt;
            public void onReceivedError(WebView view, WebResourceRequest req, WebResourceError rerr) {&lt;br /&gt;
                // Redirect to deprecated method, so you can use it in all SDK versions&lt;br /&gt;
                onReceivedError(view, rerr.getErrorCode(), rerr.getDescription().toString(), req.getUrl().toString());&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
        //Getting the optPut URL from eventTracker&lt;br /&gt;
        String url = appSdk.userOptOutURLString();&lt;br /&gt;
        webView.loadUrl(url);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;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;
'''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;br /&gt;
&lt;br /&gt;
== Sample Applications ==&lt;br /&gt;
The below sample applications have been designed to show the API's functionality and are broken into two distinct categories:&lt;br /&gt;
* '''Basic''' - To show the functionality of the Nielsen  API using a standard no-frills player.&lt;br /&gt;
** [[Swift Basic Sample|Swift 4.0 Sample]]&lt;br /&gt;
** [[Objective-c Basic example|Objective-C Sample]]&lt;br /&gt;
** [[Android Basic example|Android Studio Example]]&lt;br /&gt;
&lt;br /&gt;
* '''Advanced''' - Nielsen API integrated into a custom video player is bundled with the SDK.&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=4150</id>
		<title>DCR Poland Video Browser SDK</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Poland_Video_Browser_SDK&amp;diff=4150"/>
		<updated>2020-02-28T20:32:57Z</updated>

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

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

		<summary type="html">&lt;p&gt;MarkTufano: /* Infinite Scrolling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|800px]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4141</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4141"/>
		<updated>2020-02-06T16:55:34Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Data Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4140</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4140"/>
		<updated>2020-02-06T16:55:15Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Vendor Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4139</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4139"/>
		<updated>2020-02-06T16:55:02Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|icon]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4138</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4138"/>
		<updated>2020-02-06T16:54:41Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Vendor Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|icon]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4137</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4137"/>
		<updated>2020-02-06T16:54:26Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4136</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4136"/>
		<updated>2020-02-06T16:54:14Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Data Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4135</id>
		<title>DCR &amp; DTVR</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4135"/>
		<updated>2020-02-06T16:20:39Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK - Static */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|Digital Content Ratings (DCR) &amp;amp; Digital in TV Ratings (DTVR)}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 42%;&amp;quot; | General Reference&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| '''[[Implementing Viewability with AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Video ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Maintaining an existing ''DCR'' or ''DTVR'' App integration? Continue to reference the API you're already using with the guides below.&lt;br /&gt;
|-&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: 30%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
! style=&amp;quot;width: 25%;&amp;quot; | DTVR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Video iOS SDK]]'''&lt;br /&gt;
| '''[[DTVR iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Video Android SDK]]'''&lt;br /&gt;
| '''[[DTVR Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Video Browser SDK]]'''&lt;br /&gt;
| '''[[DTVR Browser SDK]]'''&lt;br /&gt;
| [[Browser SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Static ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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: 55%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Static iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Static Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Static Lite Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|FacebookIcon.png|alt=Facebook Instant Articles}}&lt;br /&gt;
| '''[[DCR Static Facebook Instant Articles Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|Tealium_Icon.png|alt=Tealium}}&lt;br /&gt;
| '''[[DCR Static Tealium]]'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|  {{OSIcon|AMPIcon.png|alt=Google AMP}}&lt;br /&gt;
| '''[[DCR Static Google AMP Cloud API]]'''&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Cloud API ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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;
!| DCR Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|CloudAPIIcon.png|alt=Cloud API}} &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
{{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Cloud API ]]''' &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Mobile Cloud API ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|RokuIcon.png|alt=Roku}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Roku Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adobe Launch Extensions ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Leverage Launch by Adobe? The guides below describe how to integrate DCR and DTVR with Nielsen's Adobe Launch extension&lt;br /&gt;
|-&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;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[Digital Measurement Onboarding Adobe ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR iOS Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Android Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Browser Adobe Launch Extension]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_Icon.png&amp;diff=4134</id>
		<title>File:Tealium Icon.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_Icon.png&amp;diff=4134"/>
		<updated>2020-02-06T15:59:55Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4133</id>
		<title>DCR &amp; DTVR</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4133"/>
		<updated>2020-02-05T20:50:19Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK - Static */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|Digital Content Ratings (DCR) &amp;amp; Digital in TV Ratings (DTVR)}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 42%;&amp;quot; | General Reference&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| '''[[Implementing Viewability with AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Video ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Maintaining an existing ''DCR'' or ''DTVR'' App integration? Continue to reference the API you're already using with the guides below.&lt;br /&gt;
|-&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: 30%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
! style=&amp;quot;width: 25%;&amp;quot; | DTVR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Video iOS SDK]]'''&lt;br /&gt;
| '''[[DTVR iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Video Android SDK]]'''&lt;br /&gt;
| '''[[DTVR Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Video Browser SDK]]'''&lt;br /&gt;
| '''[[DTVR Browser SDK]]'''&lt;br /&gt;
| [[Browser SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Static ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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: 55%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Static iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Static Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Static Lite Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|FacebookIcon.png|alt=Facebook Instant Articles}}&lt;br /&gt;
| '''[[DCR Static Facebook Instant Articles Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|TealiumLogo.png|alt=Tealium}}&lt;br /&gt;
| '''[[DCR Static Tealium]]'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|  {{OSIcon|AMPIcon.png|alt=Google AMP}}&lt;br /&gt;
| '''[[DCR Static Google AMP Cloud API]]'''&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Cloud API ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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;
!| DCR Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|CloudAPIIcon.png|alt=Cloud API}} &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
{{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Cloud API ]]''' &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Mobile Cloud API ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|RokuIcon.png|alt=Roku}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Roku Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adobe Launch Extensions ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Leverage Launch by Adobe? The guides below describe how to integrate DCR and DTVR with Nielsen's Adobe Launch extension&lt;br /&gt;
|-&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;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[Digital Measurement Onboarding Adobe ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR iOS Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Android Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Browser Adobe Launch Extension]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4132</id>
		<title>DCR &amp; DTVR</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4132"/>
		<updated>2020-02-05T20:47:53Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK - Static */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|Digital Content Ratings (DCR) &amp;amp; Digital in TV Ratings (DTVR)}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 42%;&amp;quot; | General Reference&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| '''[[Implementing Viewability with AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Video ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Maintaining an existing ''DCR'' or ''DTVR'' App integration? Continue to reference the API you're already using with the guides below.&lt;br /&gt;
|-&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: 30%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
! style=&amp;quot;width: 25%;&amp;quot; | DTVR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Video iOS SDK]]'''&lt;br /&gt;
| '''[[DTVR iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Video Android SDK]]'''&lt;br /&gt;
| '''[[DTVR Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Video Browser SDK]]'''&lt;br /&gt;
| '''[[DTVR Browser SDK]]'''&lt;br /&gt;
| [[Browser SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Static ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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: 55%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Static iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Static Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Static Lite Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|FacebookIcon.png|alt=Facebook Instant Articles}}&lt;br /&gt;
| '''[[DCR Static Facebook Instant Articles Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{SmallIcon|TealiumLogo.png|alt=Tealium}}&lt;br /&gt;
| '''[[DCR Static Tealium]]'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|  {{OSIcon|AMPIcon.png|alt=Google AMP}}&lt;br /&gt;
| '''[[DCR Static Google AMP Cloud API]]'''&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Cloud API ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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;
!| DCR Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|CloudAPIIcon.png|alt=Cloud API}} &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
{{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Cloud API ]]''' &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Mobile Cloud API ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|RokuIcon.png|alt=Roku}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Roku Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adobe Launch Extensions ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Leverage Launch by Adobe? The guides below describe how to integrate DCR and DTVR with Nielsen's Adobe Launch extension&lt;br /&gt;
|-&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;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[Digital Measurement Onboarding Adobe ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR iOS Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Android Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Browser Adobe Launch Extension]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4131</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4131"/>
		<updated>2020-02-05T20:45:38Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Infinite Scrolling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium-onPaginate.png|icon]]&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4126</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4126"/>
		<updated>2020-02-05T19:59:45Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Reporting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits: For standard accounts, 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4125</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4125"/>
		<updated>2020-02-05T19:59:28Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Data Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This is passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4124</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4124"/>
		<updated>2020-02-05T19:59:00Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter 'Nielsen' in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Data Mapping.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4109</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4109"/>
		<updated>2020-02-05T16:11:01Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Infinite Scrolling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Capture-209.jpg|icon|Tealium]] &lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continuous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4107</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4107"/>
		<updated>2020-02-04T20:06:10Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Data Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Capture-209.jpg|icon|Tealium]]&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4106</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4106"/>
		<updated>2020-02-04T20:05:50Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Data Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Capture-209.jpg|icon|Tealium]]&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4105</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4105"/>
		<updated>2020-02-04T20:05:22Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Capture-209.jpg|icon|Tealium]]&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Data%20Mapping.png|thumb|none|alt=Tealium - Data Mapping|Tealium - Data Mapping]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4104</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4104"/>
		<updated>2020-02-04T20:04:51Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Capture-209.jpg|icon|Tealium]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium Data Mapping.png|icon]]&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Data%20Mapping.png|thumb|none|alt=Tealium - Data Mapping|Tealium - Data Mapping]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_Data_Mapping.png&amp;diff=4102</id>
		<title>File:Tealium Data Mapping.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_Data_Mapping.png&amp;diff=4102"/>
		<updated>2020-02-04T20:03:35Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tealium Data Mapping&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4098</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4098"/>
		<updated>2020-02-04T20:00:20Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* Tag Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Tag Marketplace.png|500px|icon]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Data%20Mapping.png|thumb|none|alt=Tealium - Data Mapping|Tealium - Data Mapping]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4097</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4097"/>
		<updated>2020-02-04T19:08:01Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium - Tag Marketplace.png|500px|thumb]]&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Data%20Mapping.png|thumb|none|alt=Tealium - Data Mapping|Tealium - Data Mapping]]&lt;br /&gt;
&lt;br /&gt;
[[File:Tealium_-_Vendor_Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_-_Vendor_Configuration.png&amp;diff=4096</id>
		<title>File:Tealium - Vendor Configuration.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_-_Vendor_Configuration.png&amp;diff=4096"/>
		<updated>2020-02-04T19:00:10Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tealium - Vendor Configuration&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_-_Tag_Marketplace.png&amp;diff=4095</id>
		<title>File:Tealium - Tag Marketplace.png</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=File:Tealium_-_Tag_Marketplace.png&amp;diff=4095"/>
		<updated>2020-02-04T18:51:36Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Search for &amp;quot;Nielsen&amp;quot; integration in Tag Marketplace&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4094</id>
		<title>DCR Static Tealium</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_Static_Tealium&amp;diff=4094"/>
		<updated>2020-02-04T18:48:27Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: Created page with &amp;quot;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}} Category:Digital   == Prerequisites == Before you add the Nielsen Integration, you...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
Before you add the Nielsen Integration, you will need a Nielsen App ID. The Nielsen App ID (&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt;) is a Unique ID assigned to the player/site and configured by product.&lt;br /&gt;
&lt;br /&gt;
If you have not already received an App ID, please contact your Nielsen account manager.&lt;br /&gt;
&lt;br /&gt;
== Tag Configuration ==&lt;br /&gt;
First, go to Tealium’s Tag Marketplace and add the Nielsen Digital Content Ratings (DCR) - Static Browser SDK to your profile. You can follow the steps below to add the Nielsen tag:&lt;br /&gt;
&lt;br /&gt;
# Log in to Tealium IQ&lt;br /&gt;
# Select ‘Tags’&lt;br /&gt;
# Click the ‘Add a Tag’ button&lt;br /&gt;
# In the Tag Marketplace, Enter “Nielsen” in the search box&lt;br /&gt;
# Find the “Nielsen Digital Content Ratings (DCR) - Static Browser SDK” tag and click add&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Tag%20Marketplace.png|thumb|none|alt=Tealium - Tag Marketplace|Tealium - Tag Marketplace]]&lt;br /&gt;
&lt;br /&gt;
[[File:StaticPageEvent35.jpg|center|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details on adding Tags in Tealium, refer to: [https://community.tealiumiq.com/t5/iQ-Tag-Management/Tags/ta-p/5016 how to add a Tag?].&lt;br /&gt;
== Vendor Configuration ==&lt;br /&gt;
&lt;br /&gt;
After adding the Tag, configure the below settings:&lt;br /&gt;
&lt;br /&gt;
# '''App ID:''' Unique Nielsen ID assigned to player/site. This is passed to Nielsen in the&amp;lt;code&amp;gt;apid&amp;lt;/code&amp;gt; key. Refer to the Prerequisites section for more details.&lt;br /&gt;
# '''Instance Name''': Name of Nielsen SDK Instance. You can leave the default name, &amp;lt;code&amp;gt;nlsnInstance&amp;lt;/code&amp;gt; as is or use any string value.&lt;br /&gt;
# '''Enable Debug''': Set value to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to enable Nielsen console logging during testing. When you move to production, the value should be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# '''Use Path for Site Section:''' When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the first folder in the web page’s path is used for Site Section reporting. If the first folder is absent or not available, the Site Section value will default to “home”. The Site Section value can also be configured through Data Mappings (see below). Note: For standard accounts, there is a limit to 25 unique values.&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Vendor%20Configuration.png|thumb|none|alt=Tealium - Vendor Configuration|Tealium - Vendor Configuration]]&lt;br /&gt;
&lt;br /&gt;
== Load Rules ==&lt;br /&gt;
[https://community.tealiumiq.com/t5/1-Getting-Started-Documentation/Load-Rules-Creation/ta-p/9422 Load Rules] determine when and where to load an instance of this Tag on your site.&lt;br /&gt;
&lt;br /&gt;
Recommended Load Rule: Load on all pages.&lt;br /&gt;
&lt;br /&gt;
== Data Mapping ==&lt;br /&gt;
&lt;br /&gt;
Mapping is the process of sending data from a [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Layer-Variables/ta-p/9427 Data Layer Variable] to the corresponding destination variable of the vendor Tag. For instructions on how to map a Variable to a Tag destination, see [https://community.tealiumiq.com/t5/iQ-Tag-Management/Data-Mappings/ta-p/10645#mapping_data_sources Data Mappings].&lt;br /&gt;
&lt;br /&gt;
[[File:screenshots/Tealium%20-%20Data%20Mapping.png|thumb|none|alt=Tealium - Data Mapping|Tealium - Data Mapping]]&lt;br /&gt;
&lt;br /&gt;
The destination variables for the Nielsen Digital Content Ratings (DCR) - Static Browser SDK are built into its Data Mapping tab. The available keys are:&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;
| &amp;lt;code&amp;gt;assetid&amp;lt;/code&amp;gt; || unique ID for each article || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || Allows you to send custom site sections (limited to a maximum of 25 unique values). This is passed to Nielsen in the &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; key. If the mapping returns an empty value, then Site Section will be set to the default value of “home”. NOTE: If you are mapping to this destination, be sure to turn off the “Use Path for Site Section” toggle in the Tag settings. || custom || ✓ &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segb&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;segc&amp;lt;/code&amp;gt; || Custom Segment reporting is limited to a maximum of 25 unique values across custom segments A, B, and C (segA + segB + segC &amp;amp;lt;= 25). This passed to Nielsen in the&amp;lt;code&amp;gt;segA&amp;lt;/code&amp;gt; key. || custom ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reporting ==&lt;br /&gt;
The values passed through the Nielsen keys will determine the breakouts that are seen in reporting. The custom segments (A, B &amp;amp;amp; C) will roll into the sub-brand. To not use custom segments A, B and C, do not pass any value in these keys.&lt;br /&gt;
&lt;br /&gt;
Aggregation Limits 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keys !! Aggregation Limits&lt;br /&gt;
|-&lt;br /&gt;
| section || maximum of 25 unique values (section &amp;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;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;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;amp;lt;= 25) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Infinite Scrolling ==&lt;br /&gt;
&lt;br /&gt;
If your site has infinite or continous scrolling, you will need to configure the Nielsen &amp;lt;code&amp;gt;onPaginate&amp;lt;/code&amp;gt; event by:&lt;br /&gt;
&lt;br /&gt;
# Create Data Layer Variable with y-scroll position&lt;br /&gt;
# Select “Edit” Tag&lt;br /&gt;
# Navigate to Data Mappings Tab&lt;br /&gt;
# Select y-scroll position variable in Data Mappings drop-down&lt;br /&gt;
# Click “Destination” button&lt;br /&gt;
# Select “onPaginate” category in left-side navigation&lt;br /&gt;
# Map y-scroll position variable to Scroll Offset by clicking checkbox for &amp;lt;code&amp;gt;scroll_offset&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click “Done” button&lt;br /&gt;
&lt;br /&gt;
{{Template:Browser_Privacy_and_Opt-Out}}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
	<entry>
		<id>https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4093</id>
		<title>DCR &amp; DTVR</title>
		<link rel="alternate" type="text/html" href="https://nielsentest.mywikis.net/w/index.php?title=DCR_%26_DTVR&amp;diff=4093"/>
		<updated>2020-02-04T17:53:41Z</updated>

		<summary type="html">&lt;p&gt;MarkTufano: /* SDK - Static */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|Digital Content Ratings (DCR) &amp;amp; Digital in TV Ratings (DTVR)}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 42%;&amp;quot; | General Reference&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|DigitalIcon.png}}&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| '''[[Implementing Viewability with AppSDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Video ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Maintaining an existing ''DCR'' or ''DTVR'' App integration? Continue to reference the API you're already using with the guides below.&lt;br /&gt;
|-&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: 30%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
! style=&amp;quot;width: 25%;&amp;quot; | DTVR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Video iOS SDK]]'''&lt;br /&gt;
| '''[[DTVR iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Video Android SDK]]'''&lt;br /&gt;
| '''[[DTVR Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Video Browser SDK]]'''&lt;br /&gt;
| '''[[DTVR Browser SDK]]'''&lt;br /&gt;
| [[Browser SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Static ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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: 55%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Static iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Static Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Static Lite Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|FacebookIcon.png|alt=Facebook Instant Articles}}&lt;br /&gt;
| '''[[DCR Static Facebook Instant Articles Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Tealium]]'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|  {{OSIcon|AMPIcon.png|alt=Google AMP}}&lt;br /&gt;
| '''[[DCR Static Google AMP Cloud API]]'''&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Cloud API ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&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;
!| DCR Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|CloudAPIIcon.png|alt=Cloud API}} &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
{{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Cloud API ]]''' &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Mobile Cloud API ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|RokuIcon.png|alt=Roku}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Roku Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adobe Launch Extensions ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Leverage Launch by Adobe? The guides below describe how to integrate DCR and DTVR with Nielsen's Adobe Launch extension&lt;br /&gt;
|-&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;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[Digital Measurement Onboarding Adobe ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR iOS Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Android Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Browser Adobe Launch Extension]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MarkTufano</name></author>
	</entry>
</feed>