This module loads a dynamically generated JavaScript from Cloud API hosted at cloud.51degrees.com (or your self-hosted domain) based on the evidence (HTTP headers and API results) available. The external resource is used to handle constant platform and browser evolution without requiring frequent changes to the Prebid source code.

The Cloud API is free to integrate and use. To increase limits please check 51Degrees pricing.

51Degrees RTD Submodule

Description

51Degrees module enriches an OpenRTB request with 51Degrees Device Data.

51Degrees module sets the following fields of the device object: make, model, os, osv, h, w, ppi, pxratio - interested bidder adapters may use these fields as needed. In addition the module sets device.ext.fiftyonedegrees_deviceId to a permanent device ID which can be rapidly looked up in on premise data exposing over 250 properties including the device age, chip set, codec support, and price, operating system and app/browser versions, age, and embedded features.

The module supports on premise and cloud device detection services with free options for both.

A free resource key for use with 51Degrees cloud service can be obtained from 51Degrees cloud configuration. This is the simplest approach to trial the module.

An interface compatible self hosted service can be used with .NET, Java, Node, PHP, and Python. See 51Degrees examples.

Free cloud and on premise solutions can be expanded to support unlimited requests, additional properties, and automatic daily on premise data updates via a subscription.

Usage

Integration

Compile the 51Degrees RTD Module with other modules and adapters into your Prebid.js build:

gulp build --modules="rtdModule,51DegreesRtdProvider,appnexusBidAdapter,..."  

Note that the 51Degrees RTD module is dependent on the global real-time data module, rtdModule.

Prerequisites

Resource Key

In order to use the module please first obtain a Resource Key using the Configurator tool - choose the following properties:

  • DeviceId
  • DeviceType
  • HardwareVendor
  • HardwareName
  • HardwareModel
  • PlatformName
  • PlatformVersion
  • ScreenPixelsHeight
  • ScreenPixelsWidth
  • ScreenPixelsPhysicalHeight
  • ScreenPixelsPhysicalWidth
  • ScreenInchesHeight
  • ScreenInchesWidth
  • PixelRatio

The Cloud API is free to integrate and use. To increase limits please check 51Degrees pricing.

User Agent Client Hint (UA-CH) Permissions

Some UA-CH headers are not available to third parties. To allow 51Degrees cloud service to access these headers for more accurate detection and lower latency, it is highly recommended to set Permissions-Policy in one of two ways:

In the HTML of the publisher’s web page where Prebid.js wrapper is integrated:

<meta http-equiv="Delegate-CH" content="sec-ch-ua-arch https://cloud.51degrees.com; sec-ch-ua-full-version https://cloud.51degrees.com; sec-ch-ua-full-version-list https://cloud.51degrees.com; sec-ch-ua-model https://cloud.51degrees.com; sec-ch-ua-platform https://cloud.51degrees.com; sec-ch-ua-platform-version https://cloud.51degrees.com"/>

Or in the Response Headers of the publisher’s web server:

Permissions-Policy: ch-ua-arch=(self "https://cloud.51degrees.com"), ch-ua-full-version=(self "https://cloud.51degrees.com"), ch-ua-full-version-list=(self "https://cloud.51degrees.com"), ch-ua-model=(self "https://cloud.51degrees.com"), ch-ua-platform=(self "https://cloud.51degrees.com"), ch-ua-platform-version=(self "https://cloud.51degrees.com")

Accept-CH: sec-ch-ua-arch, sec-ch-ua-full-version, sec-ch-ua-full-version-list, sec-ch-ua-model, sec-ch-ua-platform, sec-ch-ua-platform-version

See the 51Degrees documentation for more information concerning UA-CH and permissions.

Why not use GetHighEntropyValues API instead?

Thanks for asking.

The script this module injects has a fall back to the GetHighEntropyValues API, but does not rely on it as a first (or only) choice route - please see the illustrative cases below. Albeit it seems easier, GHEV API is not supported by all browsers (so the decision to call it should be conditional) and also even in Chrome this API will likely be a subject to the Privacy Budget in the future.

In summary we recommend using Delegate-CH http-equiv as the preferred method of obtaining the necessary evidence because it is the fastest and future proof method.

Illustrative Cases
  • if the device is iPhone/iPad then there is no point checking for or calling GetHighEntropyValues at the moment because iOS does not support this API. However this might change in the future. Platforms like iOS require additional techniques to identify the model which are not covered via a single API call, and change from version to version of the operating system and browser rendering engine. When used with iOS 51Degrees resolves the iPhone/iPad model groups using these techniques. That is one of the benefits the module brings to the Prebid community as most solutions do not resolve iPhone/iPad model groups. More on Apple Device Detection here.

  • if the browser is Firefox on Android or desktop then there is similarly no point requesting GHEV as the API is not supported.

  • if the browser is Chrome then the Delegate-CH if enabled by the publisher would enable the browser to provide the necessary evidence. However if this is not implemented - then the dynamic script would fall back to GHEV which is slower.

Configuration

This module is configured as part of the realTimeData.dataProviders. We recommend setting auctionDelay to at least 250 ms and make sure waitForIt is set to true for the 51Degrees RTD provider.

pbjs.setConfig({
    debug: true, // we recommend turning this on for testing as it adds more logging
    realTimeData: {
        auctionDelay: 250,
        dataProviders: [
            {
                name: '51Degrees',
                waitForIt: true, // should be true, otherwise the auctionDelay will be ignored
                params: {
                    resourceKey: '<YOUR_RESOURCE_KEY>',
                    // Get your resource key from https://configure.51degrees.com/HNZ75HT1
                    // alternatively, you can use the on-premise version of the 51Degrees service and connect to your chosen end point
                    // onPremiseJSUrl: 'https://localhost/51Degrees.core.js'
                },
            },
        ],
    },
});

Parameters

Note that resourceKey and onPremiseJSUrl are mutually exclusive parameters. Use strictly one of them: either a resourceKey for cloud integration and onPremiseJSUrl for the on-premise self-hosted integration.

Name Type Description Default
name String Real time data module name Always ‘51Degrees’
waitForIt Boolean Should be true if there’s an auctionDelay defined (mandatory) false
params Object    
params.resourceKey String Your 51Degrees Cloud Resource Key  
params.onPremiseJSUrl String Direct URL to your self-hosted on-premise JS file (e.g. https://your.domain/51Degrees.core.js)  

Example

Note: you need to have a valid resource key to run the example.
It should be set in the configuration instead of <YOUR_RESOURCE_KEY>.
It is located in the integrationExamples/gpt/51DegreesRtdProvider_example.html file.

If you want to see an example of how the 51Degrees RTD module works,
run the following command:

gulp serve --modules=rtdModule,51DegreesRtdProvider,appnexusBidAdapter

and then open the following URL in your browser:

http://localhost:9999/integrationExamples/gpt/51DegreesRtdProvider_example.html

Open the browser console to see the logs.

Customer Notices

When using the 51Degrees cloud service publishers need to reference the 51Degrees client services privacy policy in their customer notices.