prebid.js 6.7.0 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/.eslintrc.js +8 -1
  2. package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
  3. package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
  4. package/integrationExamples/gpt/userId_example.html +2 -2
  5. package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
  6. package/integrationExamples/gpt/x-domain/creative.html +63 -29
  7. package/modules/.submodules.json +3 -0
  8. package/modules/adagioBidAdapter.js +0 -8
  9. package/modules/adagioBidAdapter.md +1 -1
  10. package/modules/adkernelBidAdapter.js +2 -1
  11. package/modules/adnuntiusRtdProvider.js +96 -0
  12. package/modules/adnuntiusRtdProvider.md +41 -0
  13. package/modules/adotBidAdapter.js +516 -567
  14. package/modules/adotBidAdapter.md +6 -44
  15. package/modules/adpod.js +12 -14
  16. package/modules/adyoulikeBidAdapter.js +2 -0
  17. package/modules/appnexusBidAdapter.js +14 -2
  18. package/modules/asealBidAdapter.js +58 -0
  19. package/modules/asealBidAdapter.md +52 -0
  20. package/modules/brandmetricsRtdProvider.js +168 -0
  21. package/modules/brandmetricsRtdProvider.md +40 -0
  22. package/modules/conversantBidAdapter.js +7 -0
  23. package/modules/criteoBidAdapter.js +9 -0
  24. package/modules/currency.js +27 -5
  25. package/modules/displayioBidAdapter.js +157 -0
  26. package/modules/displayioBidAdapter.md +148 -0
  27. package/modules/dspxBidAdapter.js +69 -29
  28. package/modules/dspxBidAdapter.md +2 -1
  29. package/modules/e_volutionBidAdapter.js +158 -0
  30. package/modules/gridBidAdapter.js +15 -1
  31. package/modules/gumgumBidAdapter.js +52 -38
  32. package/modules/hadronIdSystem.js +96 -0
  33. package/modules/hadronIdSystem.md +35 -0
  34. package/modules/hadronRtdProvider.js +254 -0
  35. package/modules/hadronRtdProvider.md +126 -0
  36. package/modules/haloIdSystem.md +4 -35
  37. package/modules/haloRtdProvider.md +3 -126
  38. package/modules/imRtdProvider.js +10 -0
  39. package/modules/improvedigitalBidAdapter.js +5 -0
  40. package/modules/interactiveOffersBidAdapter.js +9 -6
  41. package/modules/iqzoneBidAdapter.js +10 -3
  42. package/modules/iqzoneBidAdapter.md +16 -0
  43. package/modules/ixBidAdapter.js +2 -6
  44. package/modules/kubientBidAdapter.js +50 -19
  45. package/modules/lunamediahbBidAdapter.js +32 -4
  46. package/modules/malltvBidAdapter.js +7 -3
  47. package/modules/malltvBidAdapter.md +64 -51
  48. package/modules/mass.js +3 -5
  49. package/modules/mediakeysBidAdapter.js +0 -5
  50. package/modules/medianetAnalyticsAdapter.js +1 -1
  51. package/modules/mediasquareBidAdapter.js +9 -1
  52. package/modules/nextMillenniumBidAdapter.js +1 -0
  53. package/modules/oguryBidAdapter.js +7 -14
  54. package/modules/prebidServerBidAdapter/index.js +61 -39
  55. package/modules/priceFloors.js +20 -12
  56. package/modules/pubmaticBidAdapter.js +1 -1
  57. package/modules/richaudienceBidAdapter.js +8 -3
  58. package/modules/riseBidAdapter.js +17 -6
  59. package/modules/rtbhouseBidAdapter.js +2 -0
  60. package/modules/rubiconAnalyticsAdapter.js +5 -0
  61. package/modules/rubiconBidAdapter.js +2 -2
  62. package/modules/sizeMappingV2.js +1 -8
  63. package/modules/sortableAnalyticsAdapter.js +5 -4
  64. package/modules/sovrnBidAdapter.js +93 -18
  65. package/modules/sovrnBidAdapter.md +80 -2
  66. package/modules/sspBCBidAdapter.js +53 -20
  67. package/modules/telariaBidAdapter.js +22 -29
  68. package/modules/trustpidSystem.js +197 -0
  69. package/modules/trustpidSystem.md +45 -0
  70. package/modules/undertoneBidAdapter.js +17 -1
  71. package/modules/userId/eids.js +16 -1
  72. package/modules/userId/eids.md +10 -2
  73. package/modules/userId/userId.md +17 -2
  74. package/modules/vibrantmediaBidAdapter.js +220 -0
  75. package/modules/vibrantmediaBidAdapter.md +92 -0
  76. package/modules/vidoomyBidAdapter.js +8 -0
  77. package/modules/vidoomyBidAdapter.md +4 -2
  78. package/modules/weboramaRtdProvider.js +264 -34
  79. package/modules/weboramaRtdProvider.md +110 -40
  80. package/modules/yahoosspBidAdapter.js +3 -1
  81. package/modules/yieldoneBidAdapter.js +6 -0
  82. package/package.json +2 -1
  83. package/src/adRendering.js +38 -0
  84. package/src/adapterManager.js +24 -19
  85. package/src/adapters/bidderFactory.js +14 -11
  86. package/src/adloader.js +2 -1
  87. package/src/auction.js +138 -115
  88. package/src/auctionIndex.js +85 -0
  89. package/src/auctionManager.js +3 -0
  90. package/src/bidderSettings.js +69 -0
  91. package/src/bidfactory.js +18 -6
  92. package/src/native.js +29 -21
  93. package/src/prebid.js +3 -19
  94. package/src/secureCreatives.js +128 -45
  95. package/src/targeting.js +11 -2
  96. package/src/utils.js +14 -17
  97. package/src/video.js +10 -11
  98. package/src/videoCache.js +10 -9
  99. package/test/fixtures/fixtures.js +2 -1
  100. package/test/helpers/indexStub.js +28 -0
  101. package/test/helpers/syncPromise.js +71 -0
  102. package/test/spec/auctionmanager_spec.js +268 -89
  103. package/test/spec/config_spec.js +24 -1
  104. package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
  105. package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
  106. package/test/spec/modules/adotBidAdapter_spec.js +294 -3124
  107. package/test/spec/modules/adpod_spec.js +91 -156
  108. package/test/spec/modules/adyoulikeBidAdapter_spec.js +4 -0
  109. package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
  110. package/test/spec/modules/asealBidAdapter_spec.js +144 -0
  111. package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
  112. package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
  113. package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
  114. package/test/spec/modules/currency_spec.js +36 -15
  115. package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
  116. package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
  117. package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
  118. package/test/spec/modules/eids_spec.js +2 -2
  119. package/test/spec/modules/gridBidAdapter_spec.js +18 -0
  120. package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
  121. package/test/spec/modules/hadronIdSystem_spec.js +57 -0
  122. package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
  123. package/test/spec/modules/imRtdProvider_spec.js +30 -1
  124. package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
  125. package/test/spec/modules/iqzoneBidAdapter_spec.js +1 -0
  126. package/test/spec/modules/ixBidAdapter_spec.js +1 -1
  127. package/test/spec/modules/kubientBidAdapter_spec.js +182 -84
  128. package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
  129. package/test/spec/modules/mass_spec.js +2 -14
  130. package/test/spec/modules/mediakeysBidAdapter_spec.js +9 -5
  131. package/test/spec/modules/mediasquareBidAdapter_spec.js +25 -1
  132. package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
  133. package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
  134. package/test/spec/modules/priceFloors_spec.js +83 -24
  135. package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
  136. package/test/spec/modules/riseBidAdapter_spec.js +30 -4
  137. package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +31 -1
  138. package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
  139. package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
  140. package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
  141. package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
  142. package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
  143. package/test/spec/modules/trustpidSystem_spec.js +232 -0
  144. package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
  145. package/test/spec/modules/userId_spec.js +39 -39
  146. package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
  147. package/test/spec/modules/vidoomyBidAdapter_spec.js +7 -1
  148. package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
  149. package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
  150. package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
  151. package/test/spec/native_spec.js +62 -40
  152. package/test/spec/unit/core/adapterManager_spec.js +22 -0
  153. package/test/spec/unit/core/auctionIndex_spec.js +129 -0
  154. package/test/spec/unit/core/bidderFactory_spec.js +65 -12
  155. package/test/spec/unit/core/bidderSettings_spec.js +123 -0
  156. package/test/spec/unit/core/targeting_spec.js +93 -0
  157. package/test/spec/unit/pbjs_api_spec.js +80 -42
  158. package/test/spec/unit/secureCreatives_spec.js +143 -24
  159. package/test/spec/videoCache_spec.js +18 -19
  160. package/test/spec/video_spec.js +51 -61
@@ -1,35 +1,4 @@
1
- ## Audigent Halo User ID Submodule
2
-
3
- Audigent Halo ID Module. For assistance setting up your module please contact us at [prebid@audigent.com](prebid@audigent.com).
4
-
5
- ### Prebid Params
6
-
7
- Individual params may be set for the Audigent Halo ID Submodule. At least one identifier must be set in the params.
8
-
9
- ```
10
- pbjs.setConfig({
11
- usersync: {
12
- userIds: [{
13
- name: 'haloId',
14
- storage: {
15
- name: 'haloId',
16
- type: 'html5'
17
- }
18
- }]
19
- }
20
- });
21
- ```
22
- ## Parameter Descriptions for the `usersync` Configuration Section
23
- The below parameters apply only to the HaloID User ID Module integration.
24
-
25
- | Param under usersync.userIds[] | Scope | Type | Description | Example |
26
- | --- | --- | --- | --- | --- |
27
- | name | Required | String | ID value for the HaloID module - `"haloId"` | `"haloId"` |
28
- | storage | Required | Object | The publisher must specify the local storage in which to store the results of the call to get the user ID. This can be either cookie or HTML5 storage. | |
29
- | storage.type | Required | String | This is where the results of the user ID will be stored. The recommended method is `localStorage` by specifying `html5`. | `"html5"` |
30
- | storage.name | Required | String | The name of the cookie or html5 local storage where the user ID will be stored. | `"haloid"` |
31
- | storage.expires | Optional | Integer | How long (in days) the user ID information will be stored. | `365` |
32
- | value | Optional | Object | Used only if the page has a separate mechanism for storing the Halo ID. The value is an object containing the values to be sent to the adapters. In this scenario, no URL is called and nothing is added to local storage | `{"haloId": "eb33b0cb-8d35-4722-b9c0-1a31d4064888"}` |
33
- | params | Optional | Object | Used to store params for the id system |
34
- | params.url | Optional | String | Set an alternate GET url for HaloId with this parameter |
35
- | params.urlArg | Optional | Object | Optional url parameter for params.url |
1
+ ## Audigent Halo has been rebranded as Hadron
2
+ ## Use the Hadron Id Submodule
3
+ ## The Halo modules will be removed from Prebid 7
4
+ ## Contact prebid@audigent.com for more info.
@@ -1,126 +1,3 @@
1
- ## Audigent Halo Real-time Data Submodule
2
-
3
- Audigent is a next-generation, 1st party data management platform and the
4
- world’s first "data agency", powering the programmatic landscape and DTC
5
- eCommerce with actionable 1st party audience and contextual data from the
6
- world’s most influential retailers, lifestyle publishers, content creators,
7
- athletes and artists.
8
-
9
- The Halo real-time data module in Prebid has been built so that publishers
10
- can maximize the power of their first-party audiences and contextual data.
11
- This module provides both an integrated cookieless Halo identity with real-time
12
- contextual and audience segmentation solution that seamlessly and easily
13
- integrates into your existing Prebid deployment.
14
-
15
- Users, devices, content, cohorts and other features are identified and utilized
16
- to augment every bid request with targeted, 1st party data-derived segments
17
- before being submitted to supply-side platforms. Enriching the bid request with
18
- robust 1st party audience and contextual data, Audigent's Halo RTD module
19
- optimizes targeting, increases the number of bids, increases bid value,
20
- and drives additional incremental revenue for publishers.
21
-
22
- ### Publisher Usage
23
-
24
- Compile the Halo RTD module into your Prebid build:
25
-
26
- `gulp build --modules=userId,unifiedIdSystem,rtdModule,haloRtdProvider,appnexusBidAdapter`
27
-
28
- Add the Halo RTD provider to your Prebid config. In this example we will configure
29
- publisher 1234 to retrieve segments from Audigent. See the
30
- "Parameter Descriptions" below for more detailed information of the
31
- configuration parameters. Please work with your Audigent Prebid support team
32
- (prebid@audigent.com) on which version of Prebid.js supports different bidder
33
- and segment configurations.
34
-
35
- ```
36
- pbjs.setConfig(
37
- ...
38
- realTimeData: {
39
- auctionDelay: 5000,
40
- dataProviders: [
41
- {
42
- name: "halo",
43
- waitForIt: true,
44
- params: {
45
- segmentCache: false,
46
- requestParams: {
47
- publisherId: 1234
48
- }
49
- }
50
- }
51
- ]
52
- }
53
- ...
54
- }
55
- ```
56
-
57
- ### Parameter Descriptions for the Halo Configuration Section
58
-
59
- | Name |Type | Description | Notes |
60
- | :------------ | :------------ | :------------ |:------------ |
61
- | name | String | Real time data module name | Always 'halo' |
62
- | waitForIt | Boolean | Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false |
63
- | params | Object | | |
64
- | params.handleRtd | Function | A passable RTD handler that allows custom adunit and ortb2 logic to be configured. The function signature is (bidConfig, rtd, rtdConfig, pbConfig) => {}. | Optional |
65
- | params.segmentCache | Boolean | This parameter tells the Halo RTD module to attempt reading segments from a local storage cache instead of always requesting them from the Audigent server. | Optional. Defaults to false. |
66
- | params.requestParams | Object | Publisher partner specific configuration options, such as optional publisher id and other segment query related metadata to be submitted to Audigent's backend with each request. Contact prebid@audigent.com for more information. | Optional |
67
- | params.haloIdUrl | String | Parameter to specify alternate haloid endpoint url. | Optional |
68
-
69
- ### Publisher Customized RTD Handling
70
- As indicated above, it is possible to provide your own bid augmentation
71
- functions rather than simply merging supplied data. This is useful if you
72
- want to perform custom bid augmentation and logic with Halo real-time data
73
- prior to the bid request being sent. Simply add your custom logic to the
74
- optional handleRtd parameter and provide your custom RTD handling logic there.
75
-
76
- Please see the following example, which provides a function to modify bids for
77
- a bid adapter called adBuzz and perform custom logic on bidder parameters.
78
-
79
- ```
80
- pbjs.setConfig(
81
- ...
82
- realTimeData: {
83
- auctionDelay: auctionDelay,
84
- dataProviders: [
85
- {
86
- name: "halo",
87
- waitForIt: true,
88
- params: {
89
- handleRtd: function(bidConfig, rtd, rtdConfig, pbConfig) {
90
- var adUnits = bidConfig.adUnits;
91
- for (var i = 0; i < adUnits.length; i++) {
92
- var adUnit = adUnits[i];
93
- for (var j = 0; j < adUnit.bids.length; j++) {
94
- var bid = adUnit.bids[j];
95
- if (bid.bidder == 'adBuzz' && rtd['adBuzz'][0].value != 'excludeSeg') {
96
- bid.params.adBuzzCustomSegments.push(rtd['adBuzz'][0].id);
97
- }
98
- }
99
- }
100
- },
101
- segmentCache: false,
102
- requestParams: {
103
- publisherId: 1234
104
- }
105
- }
106
- }
107
- ]
108
- }
109
- ...
110
- }
111
- ```
112
-
113
- The handleRtd function can also be used to configure custom ortb2 data
114
- processing. Please see the examples available in the haloRtdProvider_spec.js
115
- tests and work with your Audigent Prebid integration team (prebid@audigent.com)
116
- on how to best configure your own Halo RTD & Open RTB data handlers.
117
-
118
- ### Testing
119
-
120
- To view an example of available segments returned by Audigent's backends:
121
-
122
- `gulp serve --modules=userId,unifiedIdSystem,rtdModule,haloRtdProvider,appnexusBidAdapter`
123
-
124
- and then point your browser at:
125
-
126
- `http://localhost:9999/integrationExamples/gpt/haloRtdProvider_example.html`
1
+ ## Audigent Halo has been rebranded as Hadron
2
+ ## Use the Hadron Rtd Submodule
3
+ ## The Halo modules will be removed from Prebid 7
@@ -60,6 +60,16 @@ export function getBidderFunction(bidderName) {
60
60
  );
61
61
  }
62
62
  return bid
63
+ },
64
+ fluct: function (bid, data) {
65
+ if (data.im_segments && data.im_segments.length) {
66
+ deepSetValue(
67
+ bid,
68
+ 'params.kv.imsids',
69
+ data.im_segments
70
+ );
71
+ }
72
+ return bid
63
73
  }
64
74
  }
65
75
  return biddersFunction[bidderName] || null;
@@ -90,6 +90,7 @@ export const spec = {
90
90
  // End of adding first party data
91
91
 
92
92
  requestParameters.schain = bidRequests[0].schain;
93
+ requestParameters.coppa = config.getConfig('coppa') === true;
93
94
 
94
95
  if (bidRequests[0].userId) {
95
96
  const eids = createEidsArray(bidRequests[0].userId);
@@ -652,6 +653,10 @@ export function ImproveDigitalAdServerJSClient(endPoint) {
652
653
  }
653
654
  }
654
655
 
656
+ if (requestParameters.coppa) {
657
+ impressionBidRequestObject.coppa = 1;
658
+ }
659
+
655
660
  return impressionBidRequestObject;
656
661
  };
657
662
 
@@ -83,7 +83,8 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
83
83
  let openRTBRequest = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequest']));
84
84
  openRTBRequest.id = prebidRequest.auctionId;
85
85
  openRTBRequest.ext = {
86
- auctionstart: Date.now()
86
+ refererInfo: prebidRequest.refererInfo,
87
+ auctionId: prebidRequest.auctionId
87
88
  };
88
89
 
89
90
  openRTBRequest.site = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestSite']));
@@ -111,15 +112,17 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
111
112
  openRTBRequest.user = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestUser']));
112
113
 
113
114
  openRTBRequest.imp = [];
114
- prebidRequest.bids.forEach(function(bid, impId) {
115
- impId++;
115
+ prebidRequest.bids.forEach(function(bid) {
116
116
  if (!ret.partnerId) {
117
117
  ret.partnerId = bid.params.partnerId;
118
118
  }
119
119
  let imp = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestImp']));
120
- imp.id = impId;
120
+ imp.id = bid.bidId;
121
121
  imp.secure = secure;
122
- imp.tagid = bid.bidId;
122
+ imp.tagid = bid.adUnitCode;
123
+ imp.ext = {
124
+ rawdata: bid
125
+ };
123
126
 
124
127
  openRTBRequest.site.publisher.id = openRTBRequest.site.publisher.id || 0;
125
128
  openRTBRequest.tmax = openRTBRequest.tmax || bid.params.tmax || 0;
@@ -152,7 +155,7 @@ function parseResponseOpenRTBToPrebidjs(openRTBResponse) {
152
155
  if (seatbid.bid && seatbid.bid.forEach) {
153
156
  seatbid.bid.forEach(function(bid) {
154
157
  let prebid = JSON.parse(JSON.stringify(DEFAULT['PrebidBid']));
155
- prebid.requestId = bid.ext.tagid;
158
+ prebid.requestId = bid.impid;
156
159
  prebid.ad = bid.adm;
157
160
  prebid.creativeId = bid.crid;
158
161
  prebid.cpm = bid.price;
@@ -27,16 +27,23 @@ function isBidResponseValid(bid) {
27
27
  function getPlacementReqData(bid) {
28
28
  const { params, bidId, mediaTypes } = bid;
29
29
  const schain = bid.schain || {};
30
- const { placementId } = params;
30
+ const { placementId, endpointId } = params;
31
31
  const bidfloor = getBidFloor(bid);
32
32
 
33
33
  const placement = {
34
- placementId,
35
34
  bidId,
36
35
  schain,
37
36
  bidfloor
38
37
  };
39
38
 
39
+ if (placementId) {
40
+ placement.placementId = placementId;
41
+ placement.type = 'publisher';
42
+ } else if (endpointId) {
43
+ placement.endpointId = endpointId;
44
+ placement.type = 'network';
45
+ }
46
+
40
47
  if (mediaTypes && mediaTypes[BANNER]) {
41
48
  placement.adFormat = BANNER;
42
49
  placement.sizes = mediaTypes[BANNER].sizes;
@@ -88,7 +95,7 @@ export const spec = {
88
95
 
89
96
  isBidRequestValid: (bid = {}) => {
90
97
  const { params, bidId, mediaTypes } = bid;
91
- let valid = Boolean(bidId && params && params.placementId);
98
+ let valid = Boolean(bidId && params && (params.placementId || params.endpointId));
92
99
 
93
100
  if (mediaTypes && mediaTypes[BANNER]) {
94
101
  valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
@@ -75,6 +75,22 @@ IQZone bid adapter supports Banner, Video (instream and outstream) and Native.
75
75
  }
76
76
  }
77
77
  ]
78
+ },
79
+ {
80
+ code: 'adunit1',
81
+ mediaTypes: {
82
+ banner: {
83
+ sizes: [ [300, 250], [320, 50] ],
84
+ }
85
+ },
86
+ bids: [
87
+ {
88
+ bidder: 'iqzone',
89
+ params: {
90
+ endpointId: 'testBanner',
91
+ }
92
+ }
93
+ ]
78
94
  }
79
95
  ];
80
96
  ```
@@ -58,22 +58,18 @@ const SOURCE_RTI_MAPPING = {
58
58
  'crwdcntrl.net': '', // Lotame Panorama ID, lotamePanoramaId
59
59
  'epsilon.com': '', // Publisher Link, publinkId
60
60
  'audigent.com': '', // Halo ID from Audigent, haloId
61
- 'pubcid.org': '' // SharedID, pubcid
61
+ 'pubcid.org': '', // SharedID, pubcid
62
+ 'trustpid.com': '' // Trustpid
62
63
  };
63
64
  const PROVIDERS = [
64
65
  'britepoolid',
65
- 'id5id',
66
66
  'lipbid',
67
- 'haloId',
68
67
  'criteoId',
69
- 'lotamePanoramaId',
70
68
  'merkleId',
71
69
  'parrableId',
72
70
  'connectid',
73
71
  'tapadId',
74
72
  'quantcastId',
75
- 'pubcid',
76
- 'TDID',
77
73
  'flocId',
78
74
  'pubProvidedId'
79
75
  ];
@@ -1,6 +1,7 @@
1
1
  import { isArray, deepAccess } from '../src/utils.js';
2
2
  import {registerBidder} from '../src/adapters/bidderFactory.js';
3
3
  import {BANNER, VIDEO} from '../src/mediaTypes.js';
4
+ import { config } from '../src/config.js';
4
5
 
5
6
  const BIDDER_CODE = 'kubient';
6
7
  const END_POINT = 'https://kssp.kbntx.ch/kubprebidjs';
@@ -59,7 +60,11 @@ export const spec = {
59
60
  gdpr: (bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0,
60
61
  consentGiven: kubientGetConsentGiven(bidderRequest.gdprConsent),
61
62
  uspConsent: bidderRequest.uspConsent
62
- };
63
+ }
64
+
65
+ if (config.getConfig('coppa') === true) {
66
+ data.coppa = 1
67
+ }
63
68
 
64
69
  if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
65
70
  data.referer = bidderRequest.refererInfo.referer
@@ -109,31 +114,39 @@ export const spec = {
109
114
  return bidResponses;
110
115
  },
111
116
  getUserSyncs: function (syncOptions, serverResponses, gdprConsent, uspConsent) {
112
- const syncs = [];
113
- let gdprParams = '';
114
- if (gdprConsent && typeof gdprConsent.consentString === 'string') {
115
- gdprParams = `?consent_str=${gdprConsent.consentString}`;
117
+ let kubientSync = kubientGetSyncInclude(config);
118
+
119
+ if (!syncOptions.pixelEnabled || kubientSync.image === 'exclude') {
120
+ return [];
121
+ }
122
+
123
+ let values = {};
124
+ if (gdprConsent) {
116
125
  if (typeof gdprConsent.gdprApplies === 'boolean') {
117
- gdprParams = gdprParams + `&gdpr=${Number(gdprConsent.gdprApplies)}`;
126
+ values['gdpr'] = Number(gdprConsent.gdprApplies);
127
+ }
128
+ if (typeof gdprConsent.consentString === 'string') {
129
+ values['consent'] = gdprConsent.consentString;
118
130
  }
119
- gdprParams = gdprParams + `&consent_given=` + kubientGetConsentGiven(gdprConsent);
120
- }
121
- if (syncOptions.iframeEnabled) {
122
- syncs.push({
123
- type: 'iframe',
124
- url: 'https://kdmp.kbntx.ch/init.html' + gdprParams
125
- });
126
131
  }
127
- if (syncOptions.pixelEnabled) {
128
- syncs.push({
129
- type: 'image',
130
- url: 'https://kdmp.kbntx.ch/init.png' + gdprParams
131
- });
132
+
133
+ if (uspConsent) {
134
+ values['usp'] = uspConsent;
132
135
  }
133
- return syncs;
136
+
137
+ return [{
138
+ type: 'image',
139
+ url: 'https://matching.kubient.net/match/sp?' + encodeQueryData(values)
140
+ }];
134
141
  }
135
142
  };
136
143
 
144
+ function encodeQueryData(data) {
145
+ return Object.keys(data).map(function(key) {
146
+ return [key, data[key]].map(encodeURIComponent).join('=');
147
+ }).join('&');
148
+ }
149
+
137
150
  function kubientGetConsentGiven(gdprConsent) {
138
151
  let consentGiven = 0;
139
152
  if (typeof gdprConsent !== 'undefined') {
@@ -149,4 +162,22 @@ function kubientGetConsentGiven(gdprConsent) {
149
162
  }
150
163
  return consentGiven;
151
164
  }
165
+
166
+ function kubientGetSyncInclude(config) {
167
+ try {
168
+ let kubientSync = {};
169
+ if (config.getConfig('userSync').filterSettings != null && typeof config.getConfig('userSync').filterSettings != 'undefined') {
170
+ let filterSettings = config.getConfig('userSync').filterSettings
171
+ if (filterSettings.iframe !== null && typeof filterSettings.iframe !== 'undefined') {
172
+ kubientSync.iframe = ((isArray(filterSettings.image.bidders) && filterSettings.iframe.bidders.indexOf('kubient') !== -1) || filterSettings.iframe.bidders === '*') ? filterSettings.iframe.filter : 'exclude';
173
+ }
174
+ if (filterSettings.image !== null && typeof filterSettings.image !== 'undefined') {
175
+ kubientSync.image = ((isArray(filterSettings.image.bidders) && filterSettings.image.bidders.indexOf('kubient') !== -1) || filterSettings.image.bidders === '*') ? filterSettings.image.filter : 'exclude';
176
+ }
177
+ }
178
+ return kubientSync;
179
+ } catch (e) {
180
+ return null;
181
+ }
182
+ }
152
183
  registerBidder(spec);
@@ -1,9 +1,11 @@
1
1
  import { logMessage } from '../src/utils.js';
2
2
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
3
  import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
4
+ import { config } from '../src/config.js';
4
5
 
5
6
  const BIDDER_CODE = 'lunamediahb';
6
7
  const AD_URL = 'https://balancer.lmgssp.com/?c=o&m=multi';
8
+ const SYNC_URL = 'https://cookie.lmgssp.com';
7
9
 
8
10
  function isBidResponseValid(bid) {
9
11
  if (!bid.requestId || !bid.cpm || !bid.creativeId ||
@@ -14,7 +16,7 @@ function isBidResponseValid(bid) {
14
16
  case BANNER:
15
17
  return Boolean(bid.width && bid.height && bid.ad);
16
18
  case VIDEO:
17
- return Boolean(bid.vastUrl);
19
+ return Boolean(bid.vastUrl) || Boolean(bid.vastXml);
18
20
  case NATIVE:
19
21
  return Boolean(bid.native && bid.native.impressionTrackers);
20
22
  default:
@@ -74,10 +76,13 @@ export const spec = {
74
76
  if (mediaType && mediaType[BANNER] && mediaType[BANNER].sizes) {
75
77
  placement.sizes = mediaType[BANNER].sizes;
76
78
  placement.traffic = BANNER;
77
- } else if (mediaType && mediaType[VIDEO] && mediaType[VIDEO].playerSize) {
78
- placement.wPlayer = mediaType[VIDEO].playerSize[0];
79
- placement.hPlayer = mediaType[VIDEO].playerSize[1];
79
+ } else if (mediaType && mediaType[VIDEO]) {
80
+ if (mediaType[VIDEO].playerSize) {
81
+ placement.wPlayer = mediaType[VIDEO].playerSize[0];
82
+ placement.hPlayer = mediaType[VIDEO].playerSize[1];
83
+ }
80
84
  placement.traffic = VIDEO;
85
+ placement.videoContext = mediaType[VIDEO].context || 'instream'
81
86
  } else if (mediaType && mediaType[NATIVE]) {
82
87
  placement.native = mediaType[NATIVE];
83
88
  placement.traffic = NATIVE;
@@ -102,6 +107,29 @@ export const spec = {
102
107
  }
103
108
  return response;
104
109
  },
110
+
111
+ getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
112
+ let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
113
+ let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
114
+ if (gdprConsent && gdprConsent.consentString) {
115
+ if (typeof gdprConsent.gdprApplies === 'boolean') {
116
+ syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
117
+ } else {
118
+ syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
119
+ }
120
+ }
121
+ if (uspConsent && uspConsent.consentString) {
122
+ syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
123
+ }
124
+
125
+ const coppa = config.getConfig('coppa') ? 1 : 0;
126
+ syncUrl += `&coppa=${coppa}`;
127
+
128
+ return [{
129
+ type: syncType,
130
+ url: syncUrl
131
+ }];
132
+ }
105
133
  };
106
134
 
107
135
  registerBidder(spec);
@@ -41,7 +41,8 @@ export const spec = {
41
41
  let contents = [];
42
42
  let data = {};
43
43
  let auctionId = bidderRequest ? bidderRequest.auctionId : '';
44
-
44
+ let gdrpApplies = true;
45
+ let gdprConsent = '';
45
46
  let placements = validBidRequests.map(bidRequest => {
46
47
  if (!propertyId) { propertyId = bidRequest.params.propertyId; }
47
48
  if (!pageViewGuid && bidRequest.params) { pageViewGuid = bidRequest.params.pageViewGuid || ''; }
@@ -49,7 +50,8 @@ export const spec = {
49
50
  if (!url && bidderRequest) { url = bidderRequest.refererInfo.referer; }
50
51
  if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; }
51
52
  if (Object.keys(data).length === 0 && bidRequest.params.data && Object.keys(bidRequest.params.data).length !== 0) { data = bidRequest.params.data; }
52
-
53
+ if (bidderRequest && bidRequest.gdprConsent) { gdrpApplies = bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? bidderRequest.gdprConsent.gdprApplies : true; }
54
+ if (bidderRequest && bidRequest.gdprConsent) { gdprConsent = bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString ? bidderRequest.gdprConsent.consentString : ''; }
53
55
  let adUnitId = bidRequest.adUnitCode;
54
56
  let placementId = bidRequest.params.placementId;
55
57
  let sizes = generateSizeParam(bidRequest.sizes);
@@ -75,7 +77,9 @@ export const spec = {
75
77
  requestid: bidderRequestId,
76
78
  placements: placements,
77
79
  contents: contents,
78
- data: data
80
+ data: data,
81
+ gdpr_applies: gdrpApplies,
82
+ gdpr_consent: gdprConsent,
79
83
  }
80
84
 
81
85
  return [{
@@ -1,68 +1,81 @@
1
1
  # Overview
2
+
2
3
  Module Name: MallTV Bidder Adapter Module
3
4
 
4
5
  Type: Bidder Adapter
5
6
 
6
- Maintainer: arditb@gjirafa.com
7
+ Maintainer: myhedin@gjirafa.com
7
8
 
8
9
  # Description
10
+
9
11
  MallTV Bidder Adapter for Prebid.js.
10
12
 
11
13
  # Test Parameters
14
+
12
15
  ```js
13
16
  var adUnits = [
14
- {
15
- code: 'test-div',
16
- mediaTypes: {
17
- banner: {
18
- sizes: [
19
- [300, 250],
20
- [300, 300]
21
- ]
22
- }
17
+ {
18
+ code: "test-div",
19
+ mediaTypes: {
20
+ banner: {
21
+ sizes: [
22
+ [300, 250],
23
+ [300, 300],
24
+ ],
25
+ },
26
+ },
27
+ bids: [
28
+ {
29
+ bidder: "malltv",
30
+ params: {
31
+ propertyId: "105134", //Required
32
+ placementId: "846832", //Required
33
+ data: {
34
+ //Optional
35
+ catalogs: [
36
+ {
37
+ catalogId: 9,
38
+ items: ["193", "4", "1"],
39
+ },
40
+ ],
41
+ inventory: {
42
+ category: ["tech"],
43
+ query: ["iphone 12"],
44
+ },
45
+ },
23
46
  },
24
- bids: [{
25
- bidder: 'malltv',
26
- params: {
27
- propertyId: '105134', //Required
28
- placementId: '846832', //Required
29
- data: { //Optional
30
- catalogs: [{
31
- catalogId: 9,
32
- items: ["193", "4", "1"]
33
- }],
34
- inventory: {
35
- category: ["tech"],
36
- query: ["iphone 12"]
37
- }
38
- }
39
- }
40
- }]
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ code: "test-div",
52
+ mediaTypes: {
53
+ video: {
54
+ context: "instream",
55
+ },
41
56
  },
42
- {
43
- code: 'test-div',
44
- mediaTypes: {
45
- video: {
46
- context: 'instream'
47
- }
57
+ bids: [
58
+ {
59
+ bidder: "malltv",
60
+ params: {
61
+ propertyId: "105134", //Required
62
+ placementId: "846832", //Required
63
+ data: {
64
+ //Optional
65
+ catalogs: [
66
+ {
67
+ catalogId: 9,
68
+ items: ["193", "4", "1"],
69
+ },
70
+ ],
71
+ inventory: {
72
+ category: ["tech"],
73
+ query: ["iphone 12"],
74
+ },
75
+ },
48
76
  },
49
- bids: [{
50
- bidder: 'malltv',
51
- params: {
52
- propertyId: '105134', //Required
53
- placementId: '846832', //Required
54
- data: { //Optional
55
- catalogs: [{
56
- catalogId: 9,
57
- items: ["193", "4", "1"]
58
- }],
59
- inventory: {
60
- category: ["tech"],
61
- query: ["iphone 12"]
62
- }
63
- }
64
- }
65
- }]
66
- }
77
+ },
78
+ ],
79
+ },
67
80
  ];
68
81
  ```