Instream tracking module allows Analytics Adapters and Bid Adapters to track BID_WON events for Instream video bids.
This module uses window.performance.getEntriesByType('resource') to check the presence of Video Cache URL.
| Field | Scope | Type | Description | 
|---|---|---|---|
| instreamTracking | Required | Object | Configuration object for instream tracking | 
| instreamTracking.enabled | Required | Boolean | Enable/disable the instream tracking feature. Default: false. | 
| instreamTracking.maxWindow | Optional | Integer | The time in ms after which polling for instream delivery stops. Default: 60000i.e. 60 seconds | 
| instreamTracking.pollingFreq | Optional | Integer | The frequency of polling. Default: 500ms | 
| instreamTracking.urlPattern | Optional | RegExp | Regex for cache url patterns, to avoid false positives. | 
pbjs.setConfig({
        'instreamTracking': {
            enabled: true,
        }
});While checking for URLs having videoCacheKey, there are chances of false positives. To avoid those cases, we can set instreamTracking.urlPattern: /REGEX_PATTERN/.
pbjs.setConfig({
        'instreamTracking': {
            enabled: true,
            urlPattern: /(prebid\.adnxs\.com\/pbc\/v1\/cache\.*)|(search\.spotxchange\.com\/ad\/vast\.html\?key=\.*)/
        }
});To install the module, follow these instructions:
Option 1: Use Prebid Download page to build the prebid package. Ensure that you do check Instream Tracking module
Option 2: From the command line, run gulp build --modules=instreamTracking,...
Enable instreamTracking using pbjs.setConfig
pbjs.setConfig({
        'instreamTracking': {
            enabled: true,
        }
});