You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nielsen Digital Content Ratings (DCR) respond to the shifting and complex multi-platform, multi-device, and multi-distribution landscape by providing comprehensive measurement of digital content consumption—including streaming video, static web pages and mobile apps—across all major devices and platforms. The [Analytics-Swift Nielsen-DCR Plugin](https://github.com/segment-integrations/analytics-swift-nielsen-dcr){:target="_blank”} tracks sessions via for [Analytics-Swift](https://github.com/segmentio/analytics-swift){:target="_blank”}.
6
6
7
-
Nielsen Digital Content Ratings (DCR) respond to the shifting, complex multi-platform, multi-device and multi-distribution landscape by providing comprehensive measurement of digital content consumption—including streaming video, static web pages and mobile apps—across all major devices and platforms. The [Analytics-Swift Nielsen-DCR Plugin](https://github.com/segment-integrations/analytics-swift-nielsen-dcr) tracks sessions via for [Analytics-Swift](https://github.com/segmentio/analytics-swift).
7
+
## Getting started
8
8
9
-
## Getting Started
9
+
To get started with Nielsen-DCR and retrieve an appid to configure this integration, you must complete the following prerequisite steps with Nielsen:
10
+
- Fill out your company info and work with a Nielsen representative.
11
+
- Sign a license agreement on the Nielsen engineering portal.
12
+
- Sign an NDA to sign prior to accessing the download.
13
+
- Complete a pre-certification process with your Nielsen representative before shipping this implementation to production.
10
14
11
-
In order to get started with Nielsen-DCR and retrieve an appid to configure this integration, you must sign a license agreement on the Nielsen engineering portal.
12
-
13
-
There will be an NDA to sign prior to accessing the download. Nielsen requires you fill out your company info and have a Nielsen representative before getting started.
14
-
15
-
You must also go through a pre-certification process with your Nielsen representative before shipping this implementation to production.
15
+
> success ""
16
+
> This plugin simply adds session data for Nielsen-DCR, and events are sent via Cloud Mode.
16
17
17
18
## Adding the dependency
18
19
19
20
### via Xcode
20
21
In the Xcode `File` menu, click `Add Packages`. You'll see a dialog where you can search for Swift packages. In the search field, enter the URL to this repo.
You'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button.
27
+
You then have the option to pin to a version or specific branch and select which project in your workspace to add the package to. Once you've made your selections, click the **Add Package** button.
25
28
26
29
### via Package.swift
27
30
28
-
Open your Package.swift file and add the following do your the `dependencies` section:
31
+
Open your Package.swift file and add the following to the `dependencies` section:
29
32
30
33
```
31
34
.package(
@@ -37,7 +40,7 @@ Open your Package.swift file and add the following do your the `dependencies` se
37
40
38
41
## Using the Plugin in your App
39
42
40
-
Open the file where you setup and configure the Analytics-Swift library. Add this plugin to the list of imports.
43
+
Open the file where you set up and configured the Analytics-Swift library. Add this plugin to the list of imports.
41
44
42
45
```
43
46
import Segment
@@ -52,4 +55,187 @@ let analytics = Analytics(configuration: Configuration(writeKey: "<YOUR WRITE KE
52
55
.trackApplicationLifecycleEvents(true))
53
56
analytics.add(plugin: NielsenDCRDestination())
54
57
```
55
-
Your events will now be given Nielsen-DCR session data and start flowing to Nielsen-DCR via Device Mode.
58
+
59
+
Your events now contain Nielsen-DCR session data and flow to Nielsen-DCR in device-mode.
60
+
61
+
## Screen / Page
62
+
63
+
Segment supports translating `screen` or `page` to Nielsen as a Static App Measurement event. We will translate the following properties to the expected Nielsen metadata:
64
+
65
+
| Segment Property Name | Nielsen | Nielsen Description |
| integration option |`segB`| Required (optional for web). Segment A. |
70
+
| integration option |`segC`| Required (optional for web). Segment B. |
71
+
| integration option |`crossId1`| Standard episode ID (mobile only) |
72
+
73
+
\* On web and mobile, you can map a custom property to `section` using the **Custom Page/Screen Section Property Name** setting. If this setting is left blank, Segment will fallback on the top-level `name`.
74
+
75
+
## Track
76
+
77
+
Segment only supports sending `track` events as outlined in our [Video Spec](/docs/connections/spec/video/). To get started tracking video content through Segment, make sure you are using a media player that has an API which allows you to detect the player state such as video or ad plays. For example, you would not be able to collect ad plays using YouTube since their YouTube SDK does not expose any hooks into player states during ad plays.
78
+
79
+
**IMPORTANT**: If you do not implement the Segment [Video Spec](/docs/connections/spec/video/) properly with key lifecycle events, this integration will not behave properly.
80
+
81
+
Again, also refer to our [Video Spec](/docs/connections/spec/video/) and implement video tracking as outlined there. We will map the semantic events and properties to Nielsen's relevant methods and metadata.
82
+
83
+
### Heartbeats
84
+
85
+
Nielsen expects a heartbeat called with `playheadPosition` during session play every second until the stream is completed, paused or interrupted (due to ad breaks or buffering). The playhead position is the current location in seconds of the playhead from the beginning of the asset. For livestream, Segment expects a negative integer that represents the offset in seconds in relation to the current timestamp. For example, if content is being livestreamed at 8PM but the viewer is 30 seconds behind, the value of this property should be -30. You can override this and pass the current time in seconds to Nielsen by toggling the `Enable Default to Current Time for Livestream Playhead Position` setting.
86
+
87
+
Segment will set a timer to call this heartbeat event (`–(void) playheadPosition: (long long) playheadPos)`, `setTimeout (web)`) every second in background. You do **NOT** have to call the Segment equivalent heartbeat event (`Video Content/Ad Playing`) each second. You should follow our spec and call the Segment heartbeat event every 10 seconds (recommended). While we will keep state of our own playhead position for these background hearbeats, when we do receive an explicit Segment heartbeat event, we will respect its `properties.position` and restart the background heartbeats from that position.
88
+
89
+
### Playback Events
90
+
91
+
When you call `Video Playback Started` and `Video Playback Resumed`, Segment will call the Nielsen-DCR `play` method with the relevant `channelInfo`:
92
+
93
+
```
94
+
NSDictionary *channelInfo = @{
95
+
// channelName is optional for DCR, if not present Nielsen asks to set default
|`-(void) end` and Heartbeat timer stopped |`Video Playback Completed`|
115
+
116
+
117
+
For playback events, Segment's video spec expects either `ad_asset_id` or `content_asset_id` depending on whether the video is an ad or content. Segment will default to mapping `ad_asset_id` to Nielsen's ad metadata `assetid` and `content_asset_id` to Nielsen's content metadata. The default Segment property can be overridden in your integration settings: `Custom Content Asset Id Property Name` or `Custom Ad Asset Id Property Name`.
The Segment-Nielsen-DCR integration has logic to check for `type` in case of a preroll ad. If the `type` is `preroll`, Segment calls Nielsen's `loadMetadata` method with metadata values for content followed by loadMetadata with ad (preroll) metadata. Otherwise, Segment simply calls `loadMetadata` with the ad metadata.
See the following example for passing destination specific values in Swift:
186
+
187
+
```swift
188
+
let options: [String: Any] = [
189
+
"integrations": [
190
+
"nielsen-dcr": [
191
+
"pipmode":"2017-05-22",
192
+
"adLoadType":"c3 value",
193
+
"channelName":"c4 value",
194
+
"mediaUrl":"c6 value",
195
+
"hasAds":true,
196
+
"crossId1":"cross id1 value",
197
+
"crossId2":"cross id2 value"
198
+
]
199
+
]
200
+
]
201
+
```
202
+
203
+
#### Pipmode
204
+
205
+
Current state of picture-in-picture (PIP) mode on device. Pass in `true` if the video measurement is displayed in PIP mode. Otherwise, Segment defaults to `false` if no value is present.
206
+
207
+
#### Ad load type
208
+
209
+
Type of ad load. Pass in `dynamic` to indicate Dynamic Ad Insertion (DAI). Otherwise, Segment defaults to linear.
210
+
211
+
#### Channel Name and Media URL
212
+
213
+
The SDK is started by calling the play API with the `channelName` and `mediaURL` parameters. If no value is passed in, Segment defaults to `defaultChannelName` for `channelName` and an empty String for `mediaURL`.
214
+
215
+
#### Cross Id 1
216
+
217
+
Standard episode ID.
218
+
219
+
#### Cross Id 2
220
+
221
+
Content originator ID. This value is only required for distributors.
222
+
223
+
## FAQ
224
+
225
+
#### How do you determine App Name?
226
+
227
+
For Android, we retrieve the name of the application package from the [PackageManager](https://developer.android.com/reference/android/content/Context.html#getPackageManager()){:target="_blank"}.
228
+
229
+
#### How do you determine App Version?
230
+
231
+
Segment-Nielsen-DCR retrieves the application version from your app's `Info.plist` application bundle name as returned by `CFBundleVersion`.
232
+
233
+
For Android, we retrieve the version of the application package from the [PackageManager](https://developer.android.com/reference/android/content/Context.html#getPackageManager()){:target="_blank"}.
234
+
235
+
#### What are the Nielsen-DCR `clientId` and `subbrand` values?
236
+
237
+
The Parent Client ID and Sub-Brand (VCID) values are automatically populated through the AppID, which is Nielsen Supplied. By default, `clientid` and `subbrand` are set up in Nielsen backend configuration to capture brand and sub-brand information. The fields get populated from backend for a registered client `appid`.
238
+
239
+
#### Can I override the Nielsen-DCR `clientId` and `subbrand` values?
240
+
241
+
In the event that your app contains multiple brands and sub-brands, Segment lets you override the `clientId` and `subbrand` values, to give credit to another brand or sub-brand. In your Segment dashboard, under "Client Id Property Name", indicate a payload property to be mapped to the Nielsen `clientId`. To override a `subbrand`, indicate a payload property to mapped to Nielsen `subbrand` under "Subbrand Property Name".
0 commit comments