iOS SDK API Reference

From Engineering Client Portal

(Redirected from Category:iOS SDK API Reference)

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png iOS SDK API Reference


The Nielsen SDK is one of multiple framework SDKs that Nielsen provides to enable measuring linear (live) and on-demand TV viewing using TVs, mobile devices, etc. The 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 & 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:

  • Application launch events and how long app was running


To start using the App SDK, the following items are required:

Item Description Source
App ID (appid) Unique ID assigned to the player/site and configured by product. Contact Nielsen
sfcode Environment that the SDK must point to Contact Nielsen
Nielsen SDK Includes SDK frameworks and sample implementation; See iOS SDK Release Notes Download

If you do not have any of these pre-requisites or if you have any questions, please contact our SDK sales support team. Refer to Digital Measurement Onboarding guide for information on how to get a Nielsen App SDK and appid.

SDK Implementation

Information on how to obtain, how to configure your development environment, and how to Initialize the Nielsen SDK is located in either the DCR Implementation Guide, or the DTVR Implementation Guide depending on your requirements.



Nielsen iOS App SDK Application Life Cycle

initialization appcycle.png

Life cycle of SDK instance includes four general states:

  1. 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.
  2. 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.
  3. Processing state – The SDK instance is processing playing information. The play and loadMetadata calls move the SDK instance into this state. In this state, the SDK instance will be able to process the following calls.
    1. playheadPosition – 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).
    2. stop – Call this API when the playback is paused, switches between content and ad (within the same content playback) or encounters interruptions.
    3. end – SDK instance exits from Processing state when this API is called.
  4. Disabled state – The SDK instance is disabled and is not processing playing information.
    1. appDisableApi is set to true

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.

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.

  • As soon as the playback resumes, call play, loadMetadata and playheadPosition


Finite-state machine table

This table provides the possible changes of state for the SDK instance, when it is in a specific state and receives an API call.

API call received Initial State Idle State Processing State Disabled State
initWithAppInfo:delegate: IDLE STATE (OR)


play & loadMetadata - PROCESSING


- -
playheadPosition - - PROCESSING




stop - - IDLE STATE -
end - - IDLE STATE -
appDisableApi: YES - DISABLED


- -
appDisableApi: NO - - - IDLE STATE (OR)


userOptOut: YES - - IDLE STATE -


- -
'-' indicates that no API call is expected.

Handling JSON Metadata

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.

  • NSDictionary object
    • If an object of unexpected type is passed to the method, the error message will be logged.
    • If string has invalid JSON format, the error message will be logged.
  • JSON value must be string value.
    • This includes boolean and numeric values. For example, a value of true should be represented with "true", number value 123 should be "123".
    • 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.
  • JSON string can be prepared using either raw NSString or serialized NSDictionary.

The below is a sample - detailed information on the metadata requirements are located in either the DCR Implementation Guide, or the DTVR Implementation Guide


let contentMetadata = [
    "type": "content",
    "assetid": "C77664",
    "title": "Program S2, E3",
    "isfullepisode": "Yes",
    "program": "Program Name",
    "length": "3600",
    "airdate": "20171020 10:05:00",
    "adloadtype": "2",
    "segB": "CustomSegmentValueB", //optional
    "segC": "CustomSegmentValueC", //optional

Objective C

NSDictionary * contentMetadata = @ {
    @ "type": @ "content",
        @ "assetid": @ "C77664",
        @ "title": @ "S2,E3",
        @ "isfullepisode": @ "y",  
        @ "program": @ "Program Name",
        @ "length": @ "3600",
        @ "airdate": @ "20180120 10:00:00",
        @ "adloadtype": @ "2",
        @ "segB": @ "CustomSegmentValueB", //optional
        @ "segC": @ "CustomSegmentValueC", //optional

Retrieving ID3 Tags

Only required for DTVR clients
Not applicable for German Clients

ID3 tags have a payload of about 249 characters and start with "".

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.

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.

Examples of extracting ID3 tags from the iOS Native Player


      //Setting observer to track timedMetadata
            player.addObserver(self, forKeyPath: timedMetadataKey, options:, context: &TimedMetadataObserverContext)

   override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
        if keyPath == timedMetadataKey {
            if(context == &TimedMetadataObserverContext){
                if change != nil {
                    let timedMetadataArray = change![.newKey]
                    if timedMetadataArray != nil && (timedMetadataArray! as AnyObject) is Array<Any> {
                        for item in timedMetadataArray as! [AVMetadataItem]  {
                            //Handling TimedMetadata
                            self.handleTimedMetadata(metadataItem: item)

 func handleTimedMetadata(metadataItem: AVMetadataItem) {
        guard let extraAttributeType = metadataItem.extraAttributes else {
        let info : AVMetadataExtraAttributeKey = AVMetadataExtraAttributeKey(rawValue: "info")
        let extraString = extraAttributeType[info] as AnyObject
        let key = metadataItem.key as! String
        //If tag starts with "", then only sending to SDK
        if key == "PRIV" && extraString.range(of: "").length > 0 {
   .default).async { () -> Void in
                self.nielsenApi?.sendID3(extraString as! String)

Objective C

    //Adding observer to player to track play,pause and reverse
    [player addObserver:self

        //Setting observer to track timedMetadata
        [player addObserver:self
                 forKeyPath: timedMetadataKey
                    options: (NSKeyValueObservingOptionNew)
                    context: &TimedMetadataObserverContext];

- (void)observeValueForKeyPath:(NSString *)keyPath
                        change:(NSDictionary *)change
                       context:(void *)context
    if(keyPath == timedMetadataKey){
        if(context == &TimedMetadataObserverContext){
            id newMetadataArray = [change objectForKey:NSKeyValueChangeNewKey];
            if (newMetadataArray != [NSNull null])
                array = newMetadataArray;
                for (AVMetadataItem *metadataItem in array)
                    //Handling TimedMetadata
                    [self handleTimedMetadata: metadataItem];

- (void)handleTimedMetadata:(AVMetadataItem *)timedMetadata
    // We expect the content to contain plists encoded as timed metadata
    // AVPlayer turns these into NSDictionaries
    id extraAttributeType = [timedMetadata extraAttributes];
    NSString *extraString = nil;
    if ([extraAttributeType isKindOfClass:[NSDictionary class]])
        extraString = [extraAttributeType valueForKey:@"info"];
    else if ([extraAttributeType isKindOfClass:[NSString class]])
        extraString = extraAttributeType;
    NSString *key = [NSString stringWithFormat:@"%@", [timedMetadata key]];
    //If tag starts with "", then only sending to SDK
    if ([key isEqualToString:@"PRIV"] && [extraString rangeOfString:@""].length > 0)
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
            [nielsenApi sendID3:extraString];

Note: ID3 tags are not applicable for International (Germany)

IOS SDK API Methods & Properties

Scenario Method / Property DTVR DAR DCR International (Germany) Description
Initialize initWithAppInfo:delegate: Used to create a new instance of the SDK object
Measurement play Used when there is an ID3 fed product such as DTVR and the client does not want to send in all the CMS metadata that is sent in loadMetadata. This allows the client to send in at least the required “channel name” value associated to the ID3 feed. If this is not called then the “channel name” value populated will be the default value of “defaultChannelName”.
Measurement loadMetadata Used to send ad or content metadata to the SDK in the form of JSON string. Application constructs a JSON hashmap and calls this API.
Measurement sendID3 Used to send the ID3 metadata.
Measurement playheadPosition Used to send the playhead position.
Measurement stop Used when playback is paused and when switching between ad and content or content and ad.
Measurement end Used when content playback is complete. This is triggered 1) at the end of the content stream, 2) if the user switches to another piece of content
Measurement updateOTT Used to notify App SDK that the remote OTT device (like Google ChromeCast, Roku, Amazon FireTV, etc.) is connected / disconnected (change of OTT status).
Opt-out optOutURL Used to fetch the Nielsen opt-out web page URL.
Opt-out userOptOut Used to supply the response message from opt-out webpage to the SDK.
Opt-out optOutStatus Call this API to retrieve the Opt-Out or Opt-In state.
Opt-out appDisableApi

(kill switch)

Used to disable the SDK.
Log lastErrorDict Returns SDK error in the form of dictionary if any error has occurred.
Log lastEventDict Returns SDK event in the form of dictionary if any event has occurred.
Log meterVersion Returns the current SDK version.
Log nielsenId Used to get a string defining the Nielsen ID (NUID) number for the device.
Log demographicId Used to retrieve Demographic ID (Device ID) of the current device.
Log debug Used to enable/disable debug flags. Newly introduced in SDK version 5.0.0 for International (Germany)

NielsenAppApi Class Description

The NielsenAppApi class is the primary application interface to the Nielsen App SDK. For example, after an instance object of the NielsenAppApi class is created and initialized, it can be used by the calling application to collect HLS timed metadata using the SDK’s sendID3: method. These are the public methods and properties exposed by the NielsenAppApi class:

@interface NielsenAppApi: NSObject

  @property (readonly) BOOL optOutStatus;
  @property (assign) BOOL appDisableApi;
  @property (assign) BOOL debug;
  @property (readonly) NSString *nielsenId;
  @property (readonly) NSString *demographicId;
  @property (readonly) NSString *optOutURL;
  @property (readonly) NSString *meterVersion;
  @property (readonly) NSDictionary *lastEventDict;
  @property (readonly) NSDictionary *lastErrorDict;

   (instancetype)initWithAppInfo:(id)appInfo delegate:(id)delegate;

   (void)playheadPosition:(long long)playheadPos;
   (void)sendID3:(NSString *)data;
   (BOOL)userOptOut:(NSString *)optOut;

   (NSString *)getNielsenId _attribute((deprecated((Please use nielsenId property instead.))));
   (NSString *)optOutURLString _attribute((deprecated((Please use optOutURL property instead.))));
   (NSString *)getMeterVersion _attribute((deprecated((Please use meterVersion property instead.))));
   (NSDictionary *)getLastEventDict _attribute((deprecated((Please use lastEventDict property instead.))));
   (NSDictionary *)getLastErrorDict _attribute((deprecated((Please use lastErrorDict property instead.))));

  @protocol NielsenAppApiDelegate<NSObject>

   (void)nielsenAppApi:(NielsenAppApi *)appApi eventOccurred:(NSDictionary *)event;
   (void)nielsenAppApi:(NielsenAppApi *)appApi errorOccurred:(NSDictionary *)error;



An enumeration with predefined App SDK event state transition codes.

typedef NS_ENUM(unsigned int, AppApiEventCode)
     AppApiStartup = 2001,
     AppApiShutdown = 2002,

App SDK Event Codes

Event Code Event Name Event Description
2001 AppApiStartup App SDK has initialized successfully. It will happen only after App SDK has received a valid config file
2002 AppApiShutdown App SDK is shutting down. It will happen just before App SDK is destroyed


iOS contains two types of error codes, 1-15 and 1001-1009.

For, 1-15, an enumeration with predefined error codes which the App SDK object can generate.

typedef NS_ENUM(unsigned int, LogCode) {
    LogCodeFailedParseStartInfo, // 1.
    LogCodeFailedParseMetadata, // 2.
    LogCodeFailedProcessID3, // 3.
    LogCodeFailedReceiveConfig, // 4.
    LogCodeFailedParseConfig, // 5.
    LogCodeFailedStartProcessor, // 6.
    LogCodeFailedCreateUrl, // 7.
    LogCodeFailedCreateRequest, // 8.
    LogCodeFailedSendHttpRequest, // 9.
    LogCodeFailedSendPing, // 10.
    LogCodeFailedSendTSV, // 11.
    LogCodeFailedSendStationRequest, // 12.
    LogCodeFailedAccessDatabase, // 13.
    LogCodeException, // 14.
    LogCodeInvalidPlayheadPosition, // 15.

For, 1001-1009, an enumeration with predefined error codes which the App SDK object can generate.

typedef NS_ENUM(unsigned int, AppApiErrorCode)
   AppApiNetworkConnectionFailure = 1001,
   AppApiFileWriteFailure = 1002,
   AppApiFileReadFailure = 1003,
   AppApiEmptyValue = 1004,
   AppApiEmptyAppName = 1005,
   AppApiEmptyAppVersion = 1006,
   AppApiEmptyAppId = 1007,
   AppApiAnExceptionOccured = 1008,
   AppApiUnknownExceptionOccured = 1009

App SDK Error Codes

Error Code Error Name Error Description
1 LogCodeFailedParseStartInfo Failed to parse the play() JSON string
2 LogCodeFailedParseMetadata Failed to parse the loadMetadata() JSON string
3 LogCodeFailedProcessID3 Failed to process ID3 data on a data processor
4 LogCodeFailedReceiveConfig Failed to receive configuration file from Census
5 LogCodeFailedParseConfig Failed to parse the config file JSON string
6 LogCodeFailedStartProcessor Failed to create SDK processor
7 LogCodeFailedCreateUrl Failed to generate URL due to missing mandatory parameter
8 LogCodeFailedCreateRequest Failed to create request in HTTP client
9 LogCodeFailedSendHttpRequest Failed sending HTTP or HTTPS request
10 LogCodeFailedSendPing Failed to send ping
11 LogCodeFailedSendTSV Failed to send TSV request
12 LogCodeFailedSendStationRequest Failed to send StationId request
13 LogCodeFailedAccessDatabase Failed to read/write from/to database table
14 LogCodeException Any exception handled by SDK code
15 LogCodeInvalidPlayheadPosition Invalid playhead position
Error Code Error Name Error Description
1001 AppApiNetworkConnectionFailure App SDK Could not connect to server
1002 AppApiFileWriteFailure App SDK Could not write to file
1003 AppApiFileReadFailure App SDK Could not read data from file
1004 AppApiEmptyValue Empty value Found.
1005 AppApiEmptyAppName Cannot initialize SDK Object without an AppName(Player Name)
1006 AppApiEmptyAppVersion Cannot initialize API Object without an AppVersion
1007 AppApiEmptyAppId Cannot initialize API Object without an AppId
1008 AppApiAnExceptionOccured Exception occurred
1009 AppApiUnknownExceptionOccured Unknown exception occurred

Nielsen Sample Applications

Nielsen iOS sample player application consists of two sample application based on native Players integrated with SDK framework. The player demonstrates all the supported functions of the SDK.

  • NielsenVideoPlayer
  • NielsenRadioPlayer

Implementation of Video and Audio sample apps is based on native iOS AVPlayer.

The UI components of the iOS App SDK sample applications are common to both as shown below.

  • From the Channel Selection buttons ⬇️ & ⬆️ , the user will be able select the channels to stream.
  • The Info button ℹ️ displays information of the SDK version, current Nielsen ID used for the device, and the option for opt-out/opt-in.
  • The Play ▶️ and Pause ⏸️ buttons will control the streaming of the selected channel.
  • The area at the bottom of the window displays the current stream status.
  • The Clear button 🔃 clears out the status window.
  • The Email button 📧 can be used to email the tags and status in a text file to Nielsen.

If target device supports Picture-in-Picture playing, it could be activated by PIP button in the Video player window.

  • Channel URLs and metadata are obtained from two locations:
    • Channels 1 and 2 are configured from the Settings application. Channel URLs and metadata parameters can be modified.
    • Channels starting from 3 are configured in specific JSON file. URLs to this JSON config file can be changed from the Settings application.

Privacy and Opt-Out

There are currently 3 flavors of the Nielsen SDK:

  1. Global iOS SDK - managed by AppTracking or Limit Ad Tracking setting on device (preferred approach).
  2. Global iOS SDK No Ad Framework - Direct call to SDK. Can be used without the Ad Framework
  3. Global iOS SDK No ID - Direct call to SDK. Should be used for Kids Category.

Global iOS SDK Opt-out

OS-level Opt-out method available on Nielsen iOS

The Nielsen SDK automatically leverages the iOS's Limit Ad Tracking or AppTracking setting.

  • If the User's device is running < iOS 13.x, the Nielsen SDK will check the status of Limit Ad Tracking.
  • iOS14 modifies the way Apple manages the collection of a User's Opt-In status through AppTracking. Starting with Version 8.x+, the Nielsen App SDK will check the iOS version during initialization. If the device is running iOS12 or iOS13, the Limit Ad Tracking setting is requested. If iOS14.x +, then AppTracking is utilized.

Webview Element

It is a requirement to display a WebView element whose loadUrl is set to the value obtained from optOutURL. If using the Global iOS SDK, this optOutURL informs the user how to deactivate/activate “App Tracking/Limit Ad Tracking”.

In addition, The following text must be included in your app store description.

"Please note: This app features Nielsen’s proprietary measurement software which contributes to market research, like Nielsen’s TV Ratings. Please see for more information"

Global iOS SDK No Ad Framework Optout

The User Choice method can be used without the Ad Framework, or in situations where the publisher does not wish to use the App Tracking Transparency Framework. As this flavor of the Nielsen SDK does not use the Ad Framework, so it is necessary to display an Optout Page to the userand capture their selection.

Similar to the Global iOS SDK Flavor, it is a requirement to display a WebView element whose loadUrl is set to the value obtained from optOutURL. This is a special URL that indicates Opt-in, or Opt-out and close the WebView.

This opt-out method works as follows:

  • Get the Nielsen opt-out URL via optOutURL
  • Display a WebView element whose loadUrl is set to the value obtained from optOutURL
  • Detect if the WebView URL changes to a special URL that indicates Opt-in, or Opt-out and close the WebView
    • Opt-out if the WebView URL = nielsenappsdk://1
    • Opt-in if the WebView URL = nielsenappsdk://0
  • Pass the detected URL to the userOptOut function
    • Example:
      NielsenAppApi?.userOptOut("nielsenappsdk://1"); // User opt-out

Global iOS SDK No ID Optout (Kids Category)

If you are building an app that will be listed in the Kids Category:

  1. Ensure that you are using the NoID version of the Nielsen SDK Framework.
  2. Immediately following the initialization of the Nielsen SDK ensure you call the userOptOut API with Opt out selection:
NielsenAppApi?.userOptOut("nielsenappsdk://1"); // User opt-out

Opt-out example code

import UIKit
import WebKit
import NielsenAppApi

class OptOutVC: UIViewController, NielsenAppApiDelegate, WKNavigationDelegate {
    var nielsenApi : NielsenAppApi!
    var webView: WKWebView!
    override func loadView() {
        webView = WKWebView()
        webView.navigationDelegate = self
        view = webView

    override func viewDidLoad() {

        if let appApi = self.nielsenApi {
            //Getting the optPut URL from SDK
            if let url = URL(string: appApi.optOutURL) {
                webView.load(URLRequest(url: url))
                webView.allowsBackForwardNavigationGestures = true

        func closeOptOutView() {
            self.dismiss(animated: true, completion: nil)
// Uncomment below code if you are using the Global iOS SDK No Ad Framework Flavor.  This will receive the user's selection
// From the custom User_Choice opt out page.  Only required for non-ad framework or no-id builds
// of the Nielsen SDK
        func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: 
@escaping (WKNavigationActionPolicy) -> Void) {
            print(navigationAction.request.url?.absoluteString as Any) //For debugging to check what is being passed from webpage.
            if navigationAction.request.url?.absoluteString == "nielsen://close" {
            } else {
                if let url = navigationAction.request.url?.absoluteString, url.hasPrefix("nielsen") {
                    nielsenApi?.userOptOut(url). //either nielsenappsdk://1 or nielsenappsdk://0
                } else {
                    if navigationAction.navigationType == .linkActivated {
                        if let url = navigationAction.request.url?.absoluteString, url.hasSuffix("#") {
                        } else {
                    } else {
#import "OptOutVC.h"
#import "NielsenInit.h"
#import <NielsenAppApi/NielsenAppApi.h>

@interface OptOutVC ()

@property (weak, nonatomic) IBOutlet UIWebView *webView;

@implementation OptOutVC

- (void)viewDidLoad {
    [super viewDidLoad];

- (void)viewDidLoad {
    [super viewDidLoad];
    //Getting the optPut URL from eventTracker
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL

//Uncomment below code if you are using the Global iOS SDK No Ad Framework Flavor.
// From the custom User_Choice opt out page.  Only required for non-ad framework or no-id builds
// of the Nielsen SDK
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
 decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
    if ([navigationAction.request.URL.absoluteString isEqualToString:kNielsenWebClose])
    {   [self performSelector:@selector(closeOptOutView) withObject:nil afterDelay:0];
     } else {
        if ([navigationAction.request.URL.absoluteString hasPrefix:@"nielsen"])
        {[self.nielsenAppApi userOptOut:navigationAction.request.URL.absoluteString];
        } else {
            if (navigationAction.navigationType == WKNavigationTypeLinkActivated) 
            { if ([navigationAction.request.URL.absoluteString hasSuffix:@"#"]) 
                } else {
                    [webView loadRequest:[NSURLRequest requestWithURL:navigationAction.request.URL]];
                }} else {

Retrieve current Opt-Out preference

Whether the user is opted out via OS-level Opt-out or via User Choice Opt-out, the current Opt-Out status as detected by the SDK is available via the optOutStatus property in the Nielsen SDK API

@property (readonly) BOOL optOutStatus

Privacy Protections

Privacy protections that Nielsen ensures to have with each App SDK integration are as follows.

  • Disclosure of viewership data collection in app store description
  • Disclosure of viewership data collection in EULA / Privacy Policy
  • A link in the EULA/Privacy policy, or in another conspicuous location within the App, to a Nielsen-hosted web page outlining what Nielsen is collecting and how it is being used
  • Method for users to opt-out of Nielsen measurement, any time while using the application

Ratings Data Flow

Every view of creditable and watermarked content is measured by Nielsen. RatingsDataFlow.png

Information NOT Shared

  • With Nielsen
    • User's Identity
  • With Data Provider
    • Content information
    • Whether user is viewing an ad or video content
    • Player used to play the streaming (audio / video, etc.)
    • Values being de-duped / aggregating for

Nielsen collects only what it needs for audience measurement. Every view of creditable, watermarked content will be measured by Nielsen.

Data Collected

Type of Information Parameter Transmitted to Nielsen? Sent to Provider?
Nielsen ID3 Watermark
FinalDistributor Timestamp Yes No
Program Content Timestamp Yes No
Mobile Breakout Code Yes No
Commercial Credit Code – Linear or Dynamic Yes No
Time ShiftedViewing Code Yes No
Segment Number Yes No
Segment View Pattern Yes No
Device/App Info
Device OSVersion Yes Yes
Device Model Yes No
Device Advertiser ID (Apple IDFA or Google AdID/Android ID) Yes Yes
Cache Buster Yes Yes
App Version Yes No
App Name Yes No
SDKDisabled Flag Yes No
ServerCode Yes No
Channel or URL Yes No
Nielsen Identifiers
Client ID Yes No
Campaign ID Yes Yes
Nielsen Unique Device ID Yes No
Application ID Yes No
DeviceGroup (ex. Tablet, Smartphone, Desktop) Yes Yes
OS Group (ex. Android, iOS, Windows) Yes Yes
SDKVersion Yes No
IP Address for DMA, Country Code Yes Yes

Note: Data is hashed, and encrypted using AES 128 before transmission to data provider.

Example ping sent to provider


This ping passes the following parameters to the provider:

  • Campaign ID – (campaign, placement, creative)
  • Country Code
  • DMA
  • OS Group (ex. iOS, Android)
  • DeviceOS Version
  • Device Advertiser ID
  • DeviceGroup (ex. Tablet, Smartphone, Desktop)
  • Cache Buster

TVOS Opt-out

To Opt-Out, users must have access to “About Nielsen Measurement” page.

TVOS does not support creating instances of UIWebView and display web pages. Instead it makes use of a TVML page (built on TVML template) which displays information in a specific order.

Opt-Out page is built on descriptiveAlertTemplate and appears as follows:

TVOs OptOut LimitAdTracking1.png

TVOs OptOut LimitAdTracking2.png

Opt-out wording

About Nielsen Measurement


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 programs at any time and on multiple devices amplifies the need for exceptionally adept and flexible audience measurement capabilities. Consumers are changing with the times, and the same goes for Nielsen. 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. Nielsen believes that you should have a choice about whether to contribute to our research and insights. To opt out of Nielsen measurement on this device, you need only to activate the “Limit Ad Tracking” option in your device's settings. If you have this app on more than one mobile device, you will need to change the settings on each device. If, after you have opted out, you change your mind and would like to opt back in, please deactivate the “Limit Ad Tracking” option in your device's settings.

To learn more about our digital measurement products and your choices in regard to them, please visit

Users need to toggle the “Limit Ad Tracking” option in order to Opt-In / Opt-Out of Nielsen Measurement.

To retrieve the current Opt-Out status of a device, use the optOutStatus method.

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.

App Level Opt Out

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:

  • Implement the UIWebView delegate method to open the Nielsen Privacy web page
  • Capture user's selection
  • Pass the selection back to the SDK via the userOptOut.

Capture and forward user selection


 func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {

        let command = request.url?.absoluteString
        if  command ==  "kNielsenWebClose"{

            self.perform(#selector(closeOptOutView), with: nil, afterDelay: 0)

            return false
        return NielsenAppApi.optOutURL
  • The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes userOptOut with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.
    • [nAppApiObject userOptOut:command] passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.

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.

Objective C

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    NSString *command = [NSString stringWithFormat:@"%@",request.URL];
    if ([command isEqualToString:kNielsenWebClose]) {
        // Close the WebView
        [self performSelector:@selector(closeOptOutView) withObject:nil afterDelay:0];
        return NO;
    // Retrieve next URL if it’s not opt-in/out selection
    return (![nAppApiObject userOptOut:command]);
  • The app gets the user selection string via webviews shouldStartLoadWithRequest and invokes userOptOut with user selection. The delegate method handles the 'WebView' URL requests, interprets the commands, and calls the SDK accordingly.
    • [nAppApiObject userOptOut:command] passes the user's selection on Nielsen Privacy page to the SDK to allow the SDK to perform the required functions.

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.