DCR Static Browser SDK (5.1.1): Difference between revisions

From Engineering Client Portal

No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Digital Content Ratings}}  {{CurrentBreadcrumb}}
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR & DTVR}}  {{CurrentBreadcrumb}}
[[Category:Digital]]
[[Category:Digital]]


'''Latest Version Guide:''' [[DCR Static Browser SDK (6.0.0)|6.0.0]]
'''Latest Version Guide:''' [[DCR Static Browser SDK (6.0.0)]]


== Prerequisites ==
== Prerequisites ==
Line 18: Line 18:
   var _nolggGlobalParams =
   var _nolggGlobalParams =
     {
     {
       sfcode: "dcr-cert",
       sfcode: "dcr",
       apid: "TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
       apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
       apn: "test-setup",
       apn: "test-setup",
       nol_sdkdebug: "console"
       nol_sdkdebug: "console"
Line 39: Line 39:
! Parameters !! Description !! Value !! Required? (Y/N)
! Parameters !! Description !! Value !! Required? (Y/N)
|-
|-
| apid || UniqueID assigned to player/site. There are two IDs provided for
| apid || UniqueID assigned to player/site. || Nielsen assigned || Yes
# Test: begins with ‘T’ and is used for testing, and
# Production: begins with ‘P’ and is used when testing is completed in live environment.
|| Nielsen assigned || Yes
|-
|-
| apn || User-defined string value for describing the player/site || Client-specified || Yes
| apn || User-defined string value for describing the player/site || Client-specified || Yes
|-
|-
| sfcode || Location of collection environment. During testing, all traffic should be directed to <code>dcr-cert</code>. || "dcr-cert" – testing
| sfcode || Location of collection environment. || "dcr" || Yes
"dcr" – production || Yes
|-
|-
| nsdkv || Nielsen SDK Version currently being used. || Nielsen assigned (‘511’ for Browser SDK 5.1.0, etc.) || Yes
| nsdkv || Nielsen SDK Version currently being used. || Nielsen assigned ('511' for Browser SDK 5.1.0, etc.) || Yes
|-
|-
| nol_sdkdebug || Enables Debug Mode which allows output to be viewed in console. || <code>"console"</code> || No
| nol_sdkdebug || Enables Debug Mode which allows output to be viewed in console. || "console" || No
|}
|}


Line 79: Line 75:
| type || Type of audio / video Measurement content (content, etc.). || "static" || No
| type || Type of audio / video Measurement content (content, etc.). || "static" || No
|-
|-
| assetid || Unique ID assigned to content || custom || No
| assetid || Unique ID assigned to content || custom <br>(no [[Special Characters]]) || No
|-
|-
| assetName || Unique name for the asset || custom || No
| assetName || Unique name for the asset || custom || No
Line 102: Line 98:
     var _nolggGlobalParams =
     var _nolggGlobalParams =
     {
     {
         sfcode: "dcr-cert",
         sfcode: "dcr",
         apid: "TXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
         apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
         apn: "test-static"
         apn: "test-static"
     };
     };
Line 122: Line 118:


== Tagging a Page ==
== Tagging a Page ==
Refer to the [[BSDK_Tagging|sample code]] for Tagging a page with static <Page Measurement> content.
Example code for tagging a page:
<syntaxhighlight lang="html">
<!DOCTYPE html>
<html>
<head>
<title>DCR Test Page </title>
  <style>
  body
  {
                        background: black;
                        color: #CCCCCC;
                      }
              </style>
<script type="text/javascript" src="http://cdn-gl.imrworldwide.com/novms/js/2/ggcmb510.js"></script>
<script type="text/javascript" src="ggjw500.js"></script>
<script type="text/javascript" src="jwplayer.js"></script>
<script type="text/javascript">
jwplayer.key="HN8uVEIEiazsf/S3SSu6m4YzbFFCdHv3ioMAgg==";
</script>
        <script type="text/javascript">
                var _nolggGlobalParams = {
                                            sfcode: "dcr",
                                            apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
                                            apn: "test-jw7",
                                            nol_sdkDebug: "console"
                                          };
        </script>
</head>
<body>
<div id="myElement">Loading the player…</div>
<script type="text/javascript">
var canUseSWF = false;
var uid = 0;
var detectBrowser = true;
</script>
<script type="text/javascript">
    jwplayer("myElement").setup({
        playlist: "myfeed.rss.xml",
        image: "WelcomeScan.jpeg",
                width: 692,
                height: 389
    });
var gg = NOLCMB.getInstance(_nolggGlobalParams.apid);
gg.ggInitialize(_nolggGlobalParams);
jwplayer("myElement").onReady(function(){
                bindEvents(gg, jwplayer("myElement"));
gg.ggPM("staticstart",{type:"static",assetid:"static123″,assetName:"Page-Asset",section:"/folder1/jw7/",segA:"Test Site",segB:"Videos",segC:"Comedy"});
});
</script>
</body>
</html>
</syntaxhighlight>


== Nielsen Measurement Opt-Out Implementation ==
== Nielsen Measurement Opt-Out Implementation ==
Line 129: Line 185:
When the user wants to opt in or opt out of Nielsen measurement, a new dynamic page (with content similar to http://secure-us.imrworldwide.com/nielsen_app_optout.html) should be displayed.
When the user wants to opt in or opt out of Nielsen measurement, a new dynamic page (with content similar to http://secure-us.imrworldwide.com/nielsen_app_optout.html) should be displayed.


For more details, refer to [[Opt-Out Implementation]] and Nielsen Digital Privacy.
For more details, refer to [[Browser_SDK_API_Reference#Opt-Out_Implementation|Opt-Out Implementation]] and Nielsen Digital Privacy.
* Use [[getOptOutStatus]] to retrieve the user’s current Opt-Out status.
* Use [[getOptOutStatus (Browser)]] to retrieve the user’s current Opt-Out status.


== Pre-Certification Checklists ==
== Pre-Certification Checklists ==
Line 136: Line 192:


== Testing an Implementation - Browser ==
== Testing an Implementation - Browser ==
[[Testing App Implementation | Click here]] for information on Testing the Browser Implementation.
See [[Digital Measurement Testing#Testing Browser Implementation|Digital Measurement Testing - Testing Browser Implementation]].

Latest revision as of 21:21, 14 March 2018

Engineering Portal / Digital / DCR & DTVR / DCR Static Browser SDK (5.1.1)

Latest Version Guide: DCR Static Browser SDK (6.0.0)

Prerequisites

To start using the Browser SDK, the following details are required:

  • App ID (apid): Unique ID assigned to the player/site and configured by product.
  • sfcode: Unique identifier for the environment that the SDK should point to. During testing, please use the sfcode as "dcr-cert".

If you do not have any of these pre-requisites or if you have any questions, please contact our SDK sales support team.

Import Library

In the HTML head section of each page, call the Nielsen library using the script tag, as shown below.

   <script type="javascript" src="http://secure-dcr-cert.imrworldwide.com/novms/js/2/ggcmb510.js"></script>

Define GlobalParams

  <script type="javascript">
   var _nolggGlobalParams =
     {
       sfcode: "dcr",
       apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
       apn: "test-setup",
       nol_sdkdebug: "console"
     };
    </script>

Initialize SDK

Initialize Browser SDK as soon as the Parent / Main Page is loaded. During the initialization, custom parameters can be appended to the global parameter object. These custom (extended) parameters are optional. Use them only if the player application can handle the custom parameter data.

The Nielsen Browser SDK supports multiple processing instances. To create an instance, call the getInstance() function

    var nSdkInstance=NOLCMB.getInstance(instanceName);

All subsequent calls to getInstance with the same instanceName will return an already created SDK instance with that name. This will allow accessing the same object from different parts of the code.

The "instanceName" parameter is optional and will be set to "default" if missing. To use a single default SDK instance, call

    var nSdkInstance=NOLCMB.getInstance();

In order to initialize the SDK, parameters must be passed when calling the initialization function (ggInitialize). The available parameters are listed in the table below.

Parameters Description Value Required? (Y/N)
apid UniqueID assigned to player/site. Nielsen assigned Yes
apn User-defined string value for describing the player/site Client-specified Yes
sfcode Location of collection environment. "dcr" Yes
nsdkv Nielsen SDK Version currently being used. Nielsen assigned ('511' for Browser SDK 5.1.0, etc.) Yes
nol_sdkdebug Enables Debug Mode which allows output to be viewed in console. "console" No
    var gg = window.NOLCMB.getInstance(instanceName /*optional*/);
    gg.ggInitialize(window._nolggGlobalParams);

Fire Event: staticStart

Use staticStart to pass details about content section. The CMS data must be passed as a JSON string (before closing <body>).

    ggPM(staticStart, metadataObject);

Trigger staticStart, as below, for the static content when the page is loaded.

    gg.ggPM("staticstart",
    {
        type:"static",
        assetid:"static123",
        section:"siteSection",
        segA:"segmentA",
        segB:"segmentB",
        segC:"segmentC"
    }
    );


Key Description Values Reported for Static?
type Type of audio / video Measurement content (content, etc.). "static" No
assetid Unique ID assigned to content custom
(no Special Characters)
No
assetName Unique name for the asset custom No
section Section of the site custom No
segA Custom Segment A custom Yes
segB Custom Segment B custom Yes
segC Custom Segment C custom Yes

DCR Static API Sequence.png

Dynamic Metadata

An alternative method for passing in assetid, section, segA-segC (if used), is to pass these values dynamically instead of hardcoding these values per site section. The code below provides an example of how this can be achieved.

    <script type="text/JavaScript">
    var temp =
    $("meta[property='og:url']").attr("content").replace("https://xyz.com/discover/","");
 
    var _nolggGlobalParams =
    {
        sfcode: "dcr",
        apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        apn: "test-static"
    };
    var gg = NOLCMB.getInstance(_nolggGlobalParams);
    gg.ggInitialize(_nolggGlobalParams);
    var staticmeta =
    {
        type: "static",
        assetid: "temp",
        section: "temp",
        segA: "Test Site",
        segB: "Videos",
        segC: "Comedy"
    };
    staticmeta.section = temp;
    gg.ggPM("staticstart",staticmeta);
    </script>

Tagging a Page

Example code for tagging a page:

<!DOCTYPE html>
<html>
<head>
	<title>DCR Test Page </title>
			   <style>
					  body 
					  {
                        background: black;
                        color: #CCCCCC;
                      }
               </style>
<script type="text/javascript" src="http://cdn-gl.imrworldwide.com/novms/js/2/ggcmb510.js"></script>
 
<script type="text/javascript" src="ggjw500.js"></script>
 
<script type="text/javascript" src="jwplayer.js"></script>
 
<script type="text/javascript">
 
jwplayer.key="HN8uVEIEiazsf/S3SSu6m4YzbFFCdHv3ioMAgg==";
</script>
         <script type="text/javascript">
                 var _nolggGlobalParams = {
                                             sfcode: "dcr",
                                             apid: "PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
                                             apn: "test-jw7",
                                             nol_sdkDebug: "console"
                                           };
         </script>
 
</head>
 
<body>
<div id="myElement">Loading the player…</div>
<script type="text/javascript">
var canUseSWF = false;
var uid = 0;
var detectBrowser = true;
</script>
<script type="text/javascript">
    jwplayer("myElement").setup({
        playlist: "myfeed.rss.xml",
        image: "WelcomeScan.jpeg",
                width: 692,
                height: 389
    });
 
var gg = NOLCMB.getInstance(_nolggGlobalParams.apid);
gg.ggInitialize(_nolggGlobalParams);
jwplayer("myElement").onReady(function(){
 
                 bindEvents(gg, jwplayer("myElement"));
gg.ggPM("staticstart",{type:"static",assetid:"static123″,assetName:"Page-Asset",section:"/folder1/jw7/",segA:"Test Site",segB:"Videos",segC:"Comedy"});
});
 
</script>
</body>
</html>

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 user wants to opt in or opt out of Nielsen measurement, a new dynamic page (with content similar to http://secure-us.imrworldwide.com/nielsen_app_optout.html) should be displayed.

For more details, refer to Opt-Out Implementation and Nielsen Digital Privacy.

Pre-Certification Checklists

After the website is ready to be sent for Nielsen Certification, please go through the Pre-Certification Checklist and ensure the webpage behaves as expected, before submitting to Nielsen.

Testing an Implementation - Browser

See Digital Measurement Testing - Testing Browser Implementation.