|
|
Line 1: |
Line 1: |
| {{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR & DTVR}} {{CurrentBreadcrumb}}
| | [[File:TrackEventTimeline-DCR-Browser3.svg]] |
| [[Category:Digital]] | |
| | |
| == Prerequisites ==
| |
| To start using the App SDK, the following details are required:
| |
| * '''App ID (appid):''' Unique ID assigned to the player/site and configured by product.
| |
| * '''sfcode:''' Unique identifier for the environment that the SDK should point to.
| |
| * '''Nielsen SDK''' and '''Sample Player''': A part of the downloaded package
| |
| 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.
| |
| | |
| == Import Library ==
| |
| Refer to [[iOS SDK API Reference#Importing Frameworks|iOS SDK API Reference - Importing Frameworks]] for information on importing libraries.
| |
| * The latest version of App SDK allows instantiating multiple instances of App SDK object and can be used simultaneously without any issues.
| |
| | |
| == Initialize SDK ==
| |
| Initialize App SDK as soon as the application is launched. Refer to [[iOS SDK API Reference#Initialization|iOS SDK API Reference - Initialization]] for details on initializing an AppSDK object and the parameters required.
| |
| | |
| == Configure API calls ==
| |
| === play ===
| |
| Use [[play]] to pass the channel descriptor information through channelName parameter when the user taps the '''Play''' button on the player.
| |
| | |
| === loadMetadata ===
| |
| Use [[loadMetadata]] to pass 'content' and 'ad' [[Digital Measurement Metadata]]. The CMS data must be passed as a JSON object.
| |
| <syntaxhighlight lang="objective-c"> – (void) loadMetadata :(id)metadata;</syntaxhighlight>
| |
| Refer to [[loadMetadata]] for the list of parameters to be passed in the JSON object.
| |
| <blockquote>'''Note:''' The [[loadMetadata]] call after the first [[play]] call must have ‘content’ details ("type": "content"). This call should occur before any preroll ad starts playing.</blockquote>
| |
| | |
| === playheadPosition (Cotent) ===
| |
| Use [[playheadPosition]] to pass the position of the playhead while the content is being played.
| |
| <syntaxhighlight lang="objective-c"> – (void) playheadPosition: (long long) playheadPos</syntaxhighlight>
| |
| {| class="wikitable"
| |
| |-
| |
| ! # !! Key !! Description !! Values !! Required? (Y/N) !! Example
| |
| |-
| |
| | 1 || Live** || UTC of the live content || Client-defined || Yes || Seconds since 1970
| |
| |-
| |
| | 2 || Video On Demand (VOD)** || Position taken from beginning of the content in seconds. || Client-defined || Yes || Current player position from beginning of the content.
| |
| |}
| |
| <nowiki>**</nowiki>''Only one of these parameters is mandatory''
| |
| <blockquote>'''Note:''' If playhead is not available from audio / video measurement, allow the app to start a timer (1-5 seconds) and send playhead position to SDK based on the timer event. Once the actual playhead is available, let the app send the proper playhead position. This allows the SDK to calculate and provide a closer value for duration.</blockquote>
| |
| | |
| '''Buffering state'''
| |
| * Do not supply playhead position while the content is being buffered.
| |
| * If the content is in buffering state continuously for more than 30 seconds, call [[stop]] API.
| |
| | |
| | |
| '''Live Content'''
| |
| <syntaxhighlight lang="objective-c"> long long pos = [[NSDate date] timeIntervalSince1970];
| |
| [nAppApiObject playheadPosition:pos];</syntaxhighlight>
| |
| | |
| | |
| '''On-demand Content'''
| |
| <syntaxhighlight lang="objective-c"> CMTime curTime=[player currentTime];
| |
| long pos=CMTimeGetSeconds(curTime);
| |
| [nAppApiObject playheadPosition:pos];</syntaxhighlight>
| |
| | |
| === playheadPosition (Ad) ===
| |
| Use [[playheadPosition]] to pass the position of the playhead while the advertisement is being played.
| |
| <syntaxhighlight lang="objective-c"> – (void) playheadPosition: (long long) playheadPos</syntaxhighlight>
| |
| | |
| {| class="wikitable"
| |
| |-
| |
| ! Key !! Description !! Values !! Required? (Y/N) !! Example
| |
| |-
| |
| | Ad || Position taken from beginning of the ad in seconds || Client-defined || Yes || Seconds since tart of the ad
| |
| |}
| |
| | |
| '''Ad Content'''
| |
| <syntaxhighlight lang="objective-c"> CMTime curTime=[adplayer currentTime];
| |
| long pos=CMTimeGetSeconds(curTime);
| |
| [nAppApiObject playheadPosition:pos];</syntaxhighlight>
| |
| <blockquote>'''Note:''' The playhead positions for ad and content should be maintained separately.</blockquote>
| |
| | |
| === stop ===
| |
| Call [[stop]] only at the end of ad or in case of interruptions during playback like flight mode, Wi-Fi toggle, etc. Call [[loadMetadata]] and [[playheadPosition]] when the stream resumes. Call [[play]] when starting the new stream.
| |
| | |
| === end ===
| |
| Call [[end]] only at the end of playback.
| |
| | |
| === API Call sequence ===
| |
| ==== Use Case 1: Content has no Advertisements ====
| |
| Use the sample API sequence below as a reference to identify the specific events that need to be called during content playback without ads.
| |
| | |
| Call [[play]] with channelName JSON as below.
| |
| <syntaxhighlight lang="json">{
| |
| "channelName": "TheMovieTitle"
| |
| }</syntaxhighlight>
| |
| Call [[loadMetadata]] with JSON metadata for content as below.
| |
| <syntaxhighlight lang="json">{
| |
| "type": "content",
| |
| "assetid": "vid345-67483",
| |
| "program": "ProgramName",
| |
| "title": "Program S3, EP1",
| |
| "length": "3600",
| |
| "segB": "CustomSegmentValueB",
| |
| "segC": "CustomSegmentValueC",
| |
| "crossId1": "Reference11",
| |
| "crossId2": "Reference22",
| |
| "isfullepisode": "y",
| |
| "airdate": "20161013 20:00:00",
| |
| "adloadtype": "2"
| |
| }</syntaxhighlight>
| |
| Call [[playheadPosition]] every one second until a pause / stop.
| |
| | |
| {| class="wikitable"
| |
| |-
| |
| ! Type !! Sample code !! Description
| |
| |-
| |
| | rowspan="2" | Start of stream || <code>[nielsenMeter play: channelName];</code> || // channelName contains JSON metadata of channel/video name being played
| |
| |-
| |
| | <code>[nielsenMeter loadMetadata: contentMetadataObject];</code> || // contentMetadataObject contains the JSON metadata for the content being played
| |
| |-
| |
| | Content || <code>[nielsenMeter playheadPosition: position];</code> || // playheadPosition is position of the playhead while the content is being played
| |
| |-
| |
| | End of Stream || <code>[nielsenMeter end];</code> || // Content playback is completed.
| |
| |}
| |
| | |
| ==== Use Case 2: Content has Advertisements ====
| |
| Call [[play]] with channelName JSON as below.
| |
| <syntaxhighlight lang="json">{
| |
| "channelName": "TheMovieTitle"
| |
| }</syntaxhighlight>
| |
| Call [[loadMetadata]] with JSON metadata for ad as below.
| |
| <syntaxhighlight lang="json">{
| |
| "type": "preroll",
| |
| "assetId_ad": "ad=123"
| |
| }</syntaxhighlight>
| |
| <blockquote>Note: In case the individual ad details are not available, send ad pod (presence) details through the [[loadMetadata]] and playhead position through [[playheadPosition]].</blockquote>
| |
| | |
| Call [[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]].
| |
| | |
| 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.
| |
| {| class="wikitable"
| |
| |-
| |
| ! Type !! Sample code !! Description
| |
| |-
| |
| | rowspan="2" | Start of stream || <code>[nielsenMeter play: channelName];</code> || // channelName contains JSON metadata of channel/video name being played
| |
| |-
| |
| | <code>[nielsenMeter loadMetadata: contentMetadataObject];</code> || // contentMetadataObject contains the JSON metadata for the content being played
| |
| |-
| |
| | rowspan="3" | Preroll || <code>[nielsenMeter loadMetadata: prerollMetadataObject];</code> || // prerollMetadataObject contains the JSON metadata for the preroll ad
| |
| |-
| |
| | <code>[nielsenMeter playheadPosition: position];</code> || // position is position of the playhead while the preroll ad is being played
| |
| |-
| |
| | <code>[nielsenMeter stop];</code> || // Call stop after preroll occurs
| |
| |-
| |
| | rowspan="3" | Content || <code>[nielsenMeter loadMetadata: contentMetadataObject];</code> || // contentMetadataObject contains the JSON metadata for the content being played
| |
| |-
| |
| | <code>[nielsenMeter playheadPosition: position];</code> || // position is position of the playhead while the content is being played
| |
| |-
| |
| | <code>[nielsenMeter stop];</code> || // Call stop after the content is paused (ad starts)
| |
| |-
| |
| | rowspan="3" | Midroll || <code>[nielsenMeter loadMetadata: midrollMetadataObject];</code> || // midrollMetadataObject contains the JSON metadata for the midroll ad
| |
| |-
| |
| | <code>[nielsenMeter playheadPosition: position];</code> || // position is position of the playhead while the midroll ad is being played
| |
| |-
| |
| | <code>[nielsenMeter stop];</code> || // Call stop after midroll occurs
| |
| |-
| |
| | rowspan="3" | Content (End of stream) || <code>[nielsenMeter loadMetadata: contentMetadataObject];</code> || // contentMetadataObject contains the JSON metadata for the content being played
| |
| |-
| |
| | <code>[nielsenMeter playheadPosition: position];</code> || // position is position of the playhead while the content is being played
| |
| |-
| |
| | <code>[nielsenMeter end];</code> || // Called at the end of content
| |
| |-
| |
| | rowspan="3" | Postroll || <code>[nielsenMeter loadMetadata: postrollMetadataObject];</code> || // postrollMetadataObject contains the JSON metadata for the postroll ad
| |
| |-
| |
| | <code>[nielsenMeter playheadPosition: position];</code> || // position is position of the playhead while the postroll ad is being played
| |
| |-
| |
| | <code>[nielsenMeter stop];</code> || // Call stop after postroll occurs
| |
| |}
| |
| | |
| <blockquote>'''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.</blockquote>
| |
| | |
| == Interruptions during playback ==
| |
| As part of integrating Nielsen App SDK with the player application, the Audio / Video app developer needs to handle the following possible interruption scenarios:
| |
| * Pause / Play
| |
| * Network Loss (Wi-Fi / Airplane / Cellular)
| |
| * Call Interrupt (SIM or Third party Skype / Hangout call)
| |
| * Alarm Interrupt
| |
| * Content Buffering
| |
| * Device Lock / Unlock (Video players only, not for Audio players)
| |
| * App going in the Background/Foreground (Video players only, not for Audio players)
| |
| * Channel / Station Change Scenario
| |
| * Unplugging of headphone
| |
| In case of encountering one of the above interruptions, the player application needs to
| |
| * Call [[stop]] immediately (except when content is buffering) and withhold sending playhead position.
| |
| * Start sending pings – [[loadMetadata]] and [[playheadPosition]] for the new viewing session, once the playback resumes.
| |
| Please see the [[Digital Measurement FAQ]] for more details
| |
| | |
| == Nielsen Measurement Opt-Out Implementation ==
| |
| As a global information and measurement leader, we are committed to protecting the privacy and security of the data we collect, process and use. Our digital measurement products are not used to identify the consumer in any way, but 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.
| |
| * When the app user wants to opt in or opt out of Nielsen measurement, a new dynamic page (with content string obtained from [[optOutURL]]) should be displayed.
| |
| * Use [[optOutStatus]] to retrieve the device’s Opt-Out status.
| |
| * This Opt-out page should be displayed in a webview (within the app) and not in any external browser.
| |
| * Capture the user’s selection in this page and pass it to the SDK through [[userOptOut]] for Nielsen to save the user’s preference.
| |
| <!-- * For more details, refer to [[iOS SDK API Reference#iOS Opt-Out Implementation|iOS SDK API Reference - iOS Opt-Out Implementation]] and Nielsen Digital Privacy. -->
| |
| | |
| == Pre-Certification Checklists ==
| |
| After the application is ready to be sent for Nielsen Certification, please go through the Pre-Certification Checklist and ensure the app behaves as expected, before submitting to Nielsen.
| |
| | |
| == Testing an Implementation - App ==
| |
| See [[Digital Measurement Testing]].
| |