DCR & DTVR Browser Static Adobe Launch Extension: Difference between revisions
From Engineering Client Portal
No edit summary |
No edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
Line 35: | Line 35: | ||
[[File:Browser6.jpg|icon]] | [[File:Browser6.jpg|icon]] | ||
= BDSK Adobe Launch Extension = | = BDSK Adobe Launch Extension = | ||
Line 71: | Line 50: | ||
The extension listens to the following custom events: | The extension listens to the following custom events: | ||
=== " | === "window.NSDKAPI.initInstance" === | ||
Format of input object is the following: | Format of input object is the following: | ||
<syntaxhighlight lang="Javascript"> | <syntaxhighlight lang="Javascript"> | ||
{ | window.NSDKAPI.initInstance({ | ||
{ | "ext_opt": { | ||
"debug": "DEBUG", | |||
"sdk_instance_name": sdk_instance_name, | |||
"apid": sdkPluginParams.apid | |||
"opt_params": { | |||
"apn": sdkPluginParams.apn, | |||
"sfcode": sdkPluginParams.sfcode, | |||
"nol_sdkDebug": sdkPluginParams.nol_sdkDebug | |||
} | } | ||
} | |||
} | |||
}); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
All parameters and supported values are described below. | All parameters and supported values are described below. | ||
{| class="wikitable" | {| class="wikitable" | ||
!Parameter!! Description !! Required !! Values !! Example !! | !Parameter!! Description !! Required !! Values !! Example !! | ||
|- | |||
||debug||Debug flag. If set to "DEBUG", the extension prints <br> debug messages to the browser console. || No ||string ||<syntaxhighlight lang="Javascript">"debug": "DEBUG"</syntaxhighlight>|| | |||
|- | |- | ||
||sdk_instance_name||Name of the BSDK instance. It's used to bind <br> BSDK and other extensions. If it's not <br> provided, the extension generates the name. <br> It can be obtained in the callback function.|| No ||string ||<syntaxhighlight lang="Javascript">"sdk_instance_name": "myPlayer1"</syntaxhighlight>|| | ||sdk_instance_name||Name of the BSDK instance. It's used to bind <br> BSDK and other extensions. If it's not <br> provided, the extension generates the name. <br> It can be obtained in the callback function.|| No ||string ||<syntaxhighlight lang="Javascript">"sdk_instance_name": "myPlayer1"</syntaxhighlight>|| | ||
|- | |- | ||
||apid||APID that is used in Browser SDK|| Yes|| string|| <syntaxhighlight lang="Javascript">"apid": "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"</syntaxhighlight>|| | ||apid||APID that is used in Browser SDK|| Yes|| string|| <syntaxhighlight lang="Javascript">"apid": "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"</syntaxhighlight>|| | ||
Line 99: | Line 84: | ||
"nol_sdkDebug": "DEBUG" | "nol_sdkDebug": "DEBUG" | ||
}</syntaxhighlight>|| | }</syntaxhighlight>|| | ||
|} | |} | ||
==== Example ==== | ==== Example ==== | ||
Line 113: | Line 94: | ||
"debug": "DEBUG", | "debug": "DEBUG", | ||
"sdk_instance_name": sdk_instance_name, | "sdk_instance_name": sdk_instance_name, | ||
"apid": | "apid": "P00BEB680-1F1A-47BB-922D-1BXXXXXXXXXX" | ||
"opt_params": { | "opt_params": { | ||
"containerID": playerId, | "containerID": playerId, | ||
"apn": | "apn": "StaticPageTest", | ||
"sfcode": | "sfcode": "dcr", | ||
"nol_sdkDebug": | "nol_sdkDebug": "DEBUG" | ||
} | } | ||
Line 126: | Line 106: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== " | === "window.NSDKAPI.trackEvent" === | ||
Format of input object is the following: | Format of input object is the following: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="json"> | ||
window.NSDKAPI.trackEvent( | |||
{ | sdk_instance_name: < name > , | ||
var obj = { | |||
"event": < event identifier > , | |||
"type": < type of metadata > , | |||
"metadata": { | |||
"content": < content metadata object > , | |||
"ad": < ad metadata object > , | |||
"static": < static metadata object > | |||
}, | |||
"playheadPosition": < playhead value | Unix Timestamp > , | |||
"id3Data": < id3 payload > , | |||
} | } | ||
} | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
All parameters and supported values are described below. | All parameters and supported values are described below. | ||
Line 208: | Line 198: | ||
|} | |} | ||
<br> | <br> | ||
<!-- | |||
=== Handling JSON Metadata === | === Handling JSON Metadata === | ||
Parameter “data” is a JSON object with many key-value pairs that holds all information required by SDK. | Parameter “data” is a JSON object with many key-value pairs that holds all information required by SDK. | ||
Line 1,174: | Line 1,164: | ||
<script>_satellite.pageBottom();</script> | <script>_satellite.pageBottom();</script> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
--> |
Latest revision as of 08:13, 22 February 2019
Engineering Portal Digital DCR & DTVR DCR & DTVR Browser Static Adobe Launch Extension
Adobe Launch Extensions
Adobe Launch Extensions are building blocks for mobile application development that reside on Adobe Servers for client utilization. Nielsen provides three Adobe Launch Extensions that can be integrated to an html page containing any number of video players. It allows clients to add the reporting functionality to their site by putting several lines of JavaScript code into the page. This guide focuses on Static Page Measurement only. For detailed information on how to use with Video, please select this link: BSDK Adobe Launch Extension for Video
Extension Installation and Configuration
Nielsen has developed Extensions to simplify adding Nielsen measurement into your video stream. The first step is to create and publish a property which is outlined in the Getting Started Guide.
Install the Extension
When you sign in to the Launch you’ll see the Properties screen first. A property is a container for the tags that you want to deploy and it can be used on one or many sites. Click New Property and enter a name. You will now be able to add an extension.
BSDK extension
BSDK extension integrates the Nielsen BSDK, initializes BSDK instances that can be used by any other extension or from the client’s page directly.
Build the Extension
After the Extension is configured, it can be “built” under the “library” on the Publishing page with other “libraries”.
Add a New library
Select to add a new library
Set the name, chose Environment (Production, Staging, Development):
Save and Build
Add all changed resources. When you get the Extension configured, it will appear in the list of changed resources. Select the Latest revision and press “Select & Create a New Revision” button:
Confirm
Once built, it will appear in the list of Development libraries:
BDSK Adobe Launch Extension
The following events and API calls are supported:
Event | API Function | Description | |
---|---|---|---|
"nls-sdk-init-instance" | window.NSDKAPI.initInstance | requests BSDK extension to initialize a new SDK instance | |
"nls-sdk-trackevent" | window.NSDKAPI.trackEvent | sends data for trackEvent function of the SDK |
Event based API
The extension listens to the following custom events:
"window.NSDKAPI.initInstance"
Format of input object is the following:
window.NSDKAPI.initInstance({
"ext_opt": {
"debug": "DEBUG",
"sdk_instance_name": sdk_instance_name,
"apid": sdkPluginParams.apid
"opt_params": {
"apn": sdkPluginParams.apn,
"sfcode": sdkPluginParams.sfcode,
"nol_sdkDebug": sdkPluginParams.nol_sdkDebug
}
}
});
All parameters and supported values are described below.
Parameter | Description | Required | Values | Example | |
---|---|---|---|---|---|
debug | Debug flag. If set to "DEBUG", the extension prints debug messages to the browser console. |
No | string | "debug": "DEBUG"
|
|
sdk_instance_name | Name of the BSDK instance. It's used to bind BSDK and other extensions. If it's not provided, the extension generates the name. It can be obtained in the callback function. |
No | string | "sdk_instance_name": "myPlayer1"
|
|
apid | APID that is used in Browser SDK | Yes | string | "apid": "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
|
|
opt_params | Optional parameters that are passed to initialization function of Browser SDK |
No | object | "opt_params":
{
"apn": "myApn",
"sfcode": "code1",
"nol_sdkDebug": "DEBUG"
}
|
Example
function createStatic(playerId) {
var sdk_instance_name = playerId;
window.NSDKAPI.initInstance({
"ext_opt": {
"debug": "DEBUG",
"sdk_instance_name": sdk_instance_name,
"apid": "P00BEB680-1F1A-47BB-922D-1BXXXXXXXXXX"
"opt_params": {
"containerID": playerId,
"apn": "StaticPageTest",
"sfcode": "dcr",
"nol_sdkDebug": "DEBUG"
}
}
});
"window.NSDKAPI.trackEvent"
Format of input object is the following:
window.NSDKAPI.trackEvent(
sdk_instance_name: < name > ,
var obj = {
"event": < event identifier > ,
"type": < type of metadata > ,
"metadata": {
"content": < content metadata object > ,
"ad": < ad metadata object > ,
"static": < static metadata object >
},
"playheadPosition": < playhead value | Unix Timestamp > ,
"id3Data": < id3 payload > ,
}
}
}
All parameters and supported values are described below.
Parameter | Description | Required | Values | Example | |
---|---|---|---|---|---|
sdk_instance_name | Name of the BSDK instance that should receive the data. |
Yes | string | "sdk_instance_name": "myPlayer1"
|
|
obj | Object containing data that is passed to trackEvent function of Browser SDK |
Yes | string | "obj": {
"event": 'playhead',
"type": 'static',
"playheadPosition": '1',
"metadata": {
"static": {
"type": 'static',
"assetid": 'AID885-9984'
}
}}
|
|
callback | Function that is called by the extension to provide the result value. It's true if success. |
function | "callback": function (ret) {
var result = ret.result;
}
|
Example
var obj = {
"event": 'playhead', // playhead,pause,complete,adstop
"type": 'static',
"playheadPosition": '1',
"metadata": {
"content": {},
"ad": {},
"static": {
type: 'static',
section: 'TrackEvent Homepage',
assetid: 'AID885-9984',
segA: 'NielsenEnt',
segB: 'CustomSegB',
segC: 'CustomSegC',
crossId1 : 'Reference'
}
}
};
window.NSDKAPI.trackEvent({
sdk_instance_name: sdk_instance_name,
obj: obj
});
Tracking the SDK Event
Event Types
The following event types are supported:
Key | Description |
---|---|
playhead |
It is used to pass content, ad or static metadata, the current playhead value, |
pause |
This event should be used when
content playback is paused. |
complete |
It is called when session is completed or ends. |
adStop |
This event should be called at the end of each ad and is required when advertisements have the same assetId. |