prebid.js 6.24.0 → 6.26.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 (178) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adgenerationBidAdapter.js +1 -1
  5. package/dist/adrelevantisBidAdapter.js +1 -1
  6. package/dist/adtelligentBidAdapter.js +1 -1
  7. package/dist/adxcgBidAdapter.js +1 -1
  8. package/dist/adyoulikeBidAdapter.js +1 -1
  9. package/dist/ajaBidAdapter.js +1 -1
  10. package/dist/amxBidAdapter.js +1 -1
  11. package/dist/amxIdSystem.js +1 -1
  12. package/dist/appierAnalyticsAdapter.js +1 -1
  13. package/dist/appnexusBidAdapter.js +1 -1
  14. package/dist/asoBidAdapter.js +1 -1
  15. package/dist/audiencerunBidAdapter.js +1 -1
  16. package/dist/axonixBidAdapter.js +1 -1
  17. package/dist/beopBidAdapter.js +1 -1
  18. package/dist/bidglassBidAdapter.js +1 -1
  19. package/dist/big-richmediaBidAdapter.js +1 -1
  20. package/dist/bluebillywigBidAdapter.js +1 -1
  21. package/dist/bridgewellBidAdapter.js +1 -1
  22. package/dist/brightMountainMediaBidAdapter.js +1 -1
  23. package/dist/concertBidAdapter.js +1 -1
  24. package/dist/connectadBidAdapter.js +1 -1
  25. package/dist/consumableBidAdapter.js +1 -1
  26. package/dist/conversantBidAdapter.js +1 -1
  27. package/dist/cpexIdSystem.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/currency.js +1 -1
  31. package/dist/dfpAdServerVideo.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gravitoIdSystem.js +1 -0
  38. package/dist/gridBidAdapter.js +1 -1
  39. package/dist/gridNMBidAdapter.js +1 -1
  40. package/dist/gumgumBidAdapter.js +1 -1
  41. package/dist/h12mediaBidAdapter.js +1 -1
  42. package/dist/id5IdSystem.js +1 -1
  43. package/dist/impactifyBidAdapter.js +1 -1
  44. package/dist/improvedigitalBidAdapter.js +1 -1
  45. package/dist/inmarBidAdapter.js +1 -1
  46. package/dist/insticatorBidAdapter.js +1 -1
  47. package/dist/invibesBidAdapter.js +1 -1
  48. package/dist/ixBidAdapter.js +1 -1
  49. package/dist/jixieBidAdapter.js +1 -1
  50. package/dist/justpremiumBidAdapter.js +1 -1
  51. package/dist/kargoBidAdapter.js +1 -1
  52. package/dist/konduitAnalyticsAdapter.js +1 -1
  53. package/dist/liveIntentIdSystem.js +1 -1
  54. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  55. package/dist/logicadBidAdapter.js +1 -1
  56. package/dist/loglyliftBidAdapter.js +1 -1
  57. package/dist/malltvAnalyticsAdapter.js +1 -1
  58. package/dist/marsmediaBidAdapter.js +1 -1
  59. package/dist/mediafuseBidAdapter.js +1 -1
  60. package/dist/mediakeysBidAdapter.js +1 -1
  61. package/dist/mediasquareBidAdapter.js +1 -1
  62. package/dist/mgidBidAdapter.js +1 -1
  63. package/dist/minutemediaBidAdapter.js +1 -1
  64. package/dist/not-for-prod/prebid.js +123 -121
  65. package/dist/oguryBidAdapter.js +1 -1
  66. package/dist/oneVideoBidAdapter.js +1 -1
  67. package/dist/onetagBidAdapter.js +1 -1
  68. package/dist/ooloAnalyticsAdapter.js +1 -1
  69. package/dist/outbrainBidAdapter.js +1 -1
  70. package/dist/parrableIdSystem.js +1 -1
  71. package/dist/pixfutureBidAdapter.js +1 -1
  72. package/dist/prebid-core.js +3 -3
  73. package/dist/publinkIdSystem.js +1 -1
  74. package/dist/pubmaticBidAdapter.js +1 -1
  75. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  76. package/dist/pxyzBidAdapter.js +1 -1
  77. package/dist/quantcastBidAdapter.js +1 -1
  78. package/dist/readpeakBidAdapter.js +1 -1
  79. package/dist/relaidoBidAdapter.js +1 -1
  80. package/dist/rhythmoneBidAdapter.js +1 -1
  81. package/dist/riseBidAdapter.js +1 -1
  82. package/dist/rubiconAnalyticsAdapter.js +1 -1
  83. package/dist/rubiconBidAdapter.js +1 -1
  84. package/dist/seedingAllianceBidAdapter.js +1 -1
  85. package/dist/seedtagBidAdapter.js +1 -1
  86. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  87. package/dist/sharethroughBidAdapter.js +1 -1
  88. package/dist/smaatoBidAdapter.js +1 -1
  89. package/dist/smartadserverBidAdapter.js +1 -1
  90. package/dist/smartxBidAdapter.js +1 -1
  91. package/dist/smilewantedBidAdapter.js +1 -1
  92. package/dist/sonobiBidAdapter.js +1 -1
  93. package/dist/sortableBidAdapter.js +1 -1
  94. package/dist/sovrnAnalyticsAdapter.js +1 -1
  95. package/dist/sovrnBidAdapter.js +1 -1
  96. package/dist/sspBCBidAdapter.js +1 -1
  97. package/dist/sublimeBidAdapter.js +1 -1
  98. package/dist/synacormediaBidAdapter.js +1 -1
  99. package/dist/targetVideoBidAdapter.js +1 -1
  100. package/dist/teadsBidAdapter.js +1 -1
  101. package/dist/trionBidAdapter.js +1 -1
  102. package/dist/tripleliftBidAdapter.js +1 -1
  103. package/dist/trustpidSystem.js +1 -1
  104. package/dist/trustxBidAdapter.js +1 -1
  105. package/dist/ttdBidAdapter.js +1 -1
  106. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  107. package/dist/underdogmediaBidAdapter.js +1 -1
  108. package/dist/undertoneBidAdapter.js +1 -1
  109. package/dist/userId.js +1 -1
  110. package/dist/vidazooBidAdapter.js +1 -1
  111. package/dist/videobyteBidAdapter.js +1 -1
  112. package/dist/videoheroesBidAdapter.js +1 -0
  113. package/dist/vidoomyBidAdapter.js +1 -1
  114. package/dist/visxBidAdapter.js +1 -1
  115. package/dist/vuukleBidAdapter.js +1 -1
  116. package/dist/weboramaRtdProvider.js +1 -1
  117. package/dist/widespaceBidAdapter.js +1 -1
  118. package/dist/winrBidAdapter.js +1 -1
  119. package/dist/yahoosspBidAdapter.js +1 -1
  120. package/dist/yieldmoBidAdapter.js +1 -1
  121. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  122. package/dist/zeta_global_sspBidAdapter.js +1 -1
  123. package/integrationExamples/gpt/userId_example.html +3 -0
  124. package/integrationExamples/gpt/weboramaRtdProvider_example.html +65 -11
  125. package/modules/.submodules.json +2 -1
  126. package/modules/adagioBidAdapter.js +2 -0
  127. package/modules/adtelligentBidAdapter.js +3 -1
  128. package/modules/alkimiBidAdapter.md +10 -4
  129. package/modules/appnexusBidAdapter.js +13 -2
  130. package/modules/beopBidAdapter.js +51 -6
  131. package/modules/cpexIdSystem.js +1 -2
  132. package/modules/currency.js +4 -13
  133. package/modules/dacIdSystem.md +4 -4
  134. package/modules/dfpAdServerVideo.js +8 -0
  135. package/modules/gravitoIdSystem.js +57 -0
  136. package/modules/gravitoIdSystem.md +28 -0
  137. package/modules/improvedigitalBidAdapter.js +100 -43
  138. package/modules/invibesBidAdapter.js +55 -34
  139. package/modules/ixBidAdapter.js +62 -26
  140. package/modules/ixBidAdapter.md +42 -42
  141. package/modules/jixieBidAdapter.js +2 -0
  142. package/modules/kargoBidAdapter.js +23 -8
  143. package/modules/oguryBidAdapter.js +27 -1
  144. package/modules/trustpidSystem.js +9 -28
  145. package/modules/trustpidSystem.md +11 -34
  146. package/modules/userId/eids.js +6 -0
  147. package/modules/userId/index.js +30 -55
  148. package/modules/userId/userId.md +3 -11
  149. package/modules/videoheroesBidAdapter.js +267 -0
  150. package/modules/videoheroesBidAdapter.md +134 -0
  151. package/modules/vidoomyBidAdapter.js +2 -6
  152. package/modules/weboramaRtdProvider.js +515 -241
  153. package/modules/weboramaRtdProvider.md +488 -51
  154. package/modules/zeta_global_sspBidAdapter.js +1 -1
  155. package/package.json +4 -4
  156. package/src/adserver.js +7 -0
  157. package/src/hook.js +19 -1
  158. package/src/utils/promise.js +36 -0
  159. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  160. package/test/spec/modules/appnexusBidAdapter_spec.js +37 -10
  161. package/test/spec/modules/beopBidAdapter_spec.js +15 -2
  162. package/test/spec/modules/dfpAdServerVideo_spec.js +45 -0
  163. package/test/spec/modules/gravitoIdSystem_spec.js +51 -0
  164. package/test/spec/modules/improvedigitalBidAdapter_spec.js +289 -72
  165. package/test/spec/modules/invibesBidAdapter_spec.js +98 -7
  166. package/test/spec/modules/ixBidAdapter_spec.js +132 -26
  167. package/test/spec/modules/jixieBidAdapter_spec.js +17 -0
  168. package/test/spec/modules/kargoBidAdapter_spec.js +45 -3
  169. package/test/spec/modules/liveIntentIdSystem_spec.js +2 -2
  170. package/test/spec/modules/loglyliftBidAdapter_spec.js +8 -0
  171. package/test/spec/modules/oguryBidAdapter_spec.js +181 -3
  172. package/test/spec/modules/trustpidSystem_spec.js +42 -19
  173. package/test/spec/modules/userId_spec.js +18 -0
  174. package/test/spec/modules/videoheroesBidAdapter_spec.js +363 -0
  175. package/test/spec/modules/weboramaRtdProvider_spec.js +2333 -266
  176. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +37 -24
  177. package/test/spec/unit/utils/promise_spec.js +49 -0
  178. package/test/spec/modules/medianetRtdProvider_spec.js +0 -146
@@ -1,9 +1,10 @@
1
1
  <!DOCTYPE html
2
2
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
4
4
 
5
5
  <head>
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>weborama rtd submodule example</title>
7
8
  </head>
8
9
 
9
10
  <body>
@@ -26,9 +27,8 @@
26
27
  params: {
27
28
  setPrebidTargeting: true, // optional
28
29
  sendToBidders: true, // optional
29
- onData: function (data, site) { // optional
30
- var kind = (site) ? 'site' : 'user';
31
- console.log('onData', kind, data);
30
+ onData: function (data, meta) { // optional
31
+ console.log('onData', data, meta);
32
32
  },
33
33
  weboCtxConf: {
34
34
  token: "to-be-defined", // mandatory
@@ -36,21 +36,30 @@
36
36
  setPrebidTargeting: true, // override param.setPrebidTargeting or default true
37
37
  sendToBidders: true, // override param.sendToBidders or default true
38
38
  defaultProfile: { // optional
39
- webo_ctx: ['moon'],
39
+ webo_ctx: ["Rugby_Renault_c11495", "Sport_c11893"],
40
40
  webo_ds: ['bar']
41
41
  },
42
- //, onData: function (data, ...) { ...}
42
+ // enabled: false,
43
+ //, onData: function (data,...) { ...}
43
44
  },
44
45
  weboUserDataConf: {
45
- accountId: 12345, // optional
46
+ accountId: 12345, // recommended
46
47
  setPrebidTargeting: true, // override param.setPrebidTargeting or default true
47
- sendToBidders: true, // override param.sendToBidders or default true
48
+ sendToBidders: ['smartadserver'], // specify the bidder to share data
48
49
  defaultProfile: { // optional
49
- webo_cs: ['Red'],
50
+ webo_cs: ['red'],
50
51
  webo_audiences: ['bam']
51
52
  },
52
53
  localStorageProfileKey: 'webo_wam2gam_entry', // default
54
+ // enabled: false,
53
55
  //, onData: function (data,...) { ...}
56
+ },
57
+ sfbxLiteDataConf: {
58
+ enabled: true,
59
+ defaultProfile: { // optional
60
+ lite_occupation: ['gérant', 'bénévole'],
61
+ lite_hobbies: ['sport', 'cinéma'],
62
+ },
54
63
  }
55
64
  }
56
65
  }]
@@ -62,6 +71,9 @@
62
71
  var div_1_sizes = [
63
72
  [300, 300]
64
73
  ];
74
+ var div_2_sizes = [
75
+ [600, 100]
76
+ ];
65
77
 
66
78
  var PREBID_TIMEOUT = 3000;
67
79
  var FAILSAFE_TIMEOUT = 5000;
@@ -106,6 +118,46 @@
106
118
  networkId: 456456,
107
119
  },
108
120
  }]
121
+ },
122
+ {
123
+ code: '/1056029/webo-wam-prebid',
124
+ mediaTypes: {
125
+ banner: {
126
+ sizes: div_2_sizes
127
+ }
128
+ },
129
+ bids: [{
130
+ bidder: 'smartadserver',
131
+ params: {
132
+ siteId: 1234,
133
+ pageId: 1234,
134
+ formatId: 1234,
135
+ }
136
+ }, {
137
+ bidder: 'pubmatic',
138
+ params: {
139
+ publisherId: '32572',
140
+ }
141
+ }, {
142
+ bidder: 'appnexus',
143
+ params: {
144
+ placementId: 234234,
145
+ }
146
+ }, {
147
+ bidder: 'rubicon',
148
+ params: {
149
+ accountId: '14062',
150
+ siteId: '70608',
151
+ zoneId: '335918',
152
+ userId: '12346',
153
+ }
154
+ }, {
155
+ bidder: 'criteo',
156
+ params: {
157
+ zoneId: 234234,
158
+ networkId: 456456,
159
+ },
160
+ }]
109
161
  }
110
162
  ];
111
163
 
@@ -138,7 +190,6 @@
138
190
  });
139
191
  }
140
192
 
141
-
142
193
  // in case PBJS doesn't load
143
194
  setTimeout(function () {
144
195
  initAdserver();
@@ -146,6 +197,7 @@
146
197
 
147
198
  googletag.cmd.push(function () {
148
199
  googletag.defineSlot('/1056029/webo-ctx-prebid', div_1_sizes, 'div-gpt-ad-1620653642627-0').addService(googletag.pubads());
200
+ googletag.defineSlot('/1056029/webo-wam-prebid', div_2_sizes, 'div-gpt-ad-1645023761875-0').addService(googletag.pubads());
149
201
  googletag.pubads().disableInitialLoad();
150
202
  googletag.enableServices();
151
203
  });
@@ -154,11 +206,12 @@
154
206
 
155
207
  <article>
156
208
  <p>
157
- test webo ctx using prebid.js
209
+ test webo rtd submodule with prebid.js
158
210
  </p>
159
211
  </article>
160
212
  <h2>Basic Prebid.js Example</h2>
161
213
  <h5>Div-1</h5>
214
+ <!-- /1056029/webo-ctx-prebid -->
162
215
  <div id='div-gpt-ad-1620653642627-0' style='width: 300px; height: 300px;'>
163
216
  <script type='text/javascript'>
164
217
  googletag.cmd.push(function () {
@@ -166,6 +219,7 @@
166
219
  });
167
220
  </script>
168
221
  </div>
222
+
169
223
  <button onclick="googletag.cmd.push(function() { googletag.pubads().refresh(); });">
170
224
  Show/Refresh Ad
171
225
  </button>
@@ -43,7 +43,8 @@
43
43
  "unifiedIdSystem",
44
44
  "verizonMediaIdSystem",
45
45
  "zeotapIdPlusIdSystem",
46
- "adqueryIdSystem"
46
+ "adqueryIdSystem",
47
+ "gravitoIdSystem"
47
48
  ],
48
49
  "adpod": [
49
50
  "freeWheelAdserverVideo",
@@ -978,6 +978,8 @@ export const spec = {
978
978
  // remove useless props
979
979
  delete adUnitCopy.floorData;
980
980
  delete adUnitCopy.params.siteId;
981
+ delete adUnitCopy.userId
982
+ delete adUnitCopy.userIdAsEids
981
983
 
982
984
  groupedAdUnits[adUnitCopy.params.organizationId] = groupedAdUnits[adUnitCopy.params.organizationId] || [];
983
985
  groupedAdUnits[adUnitCopy.params.organizationId].push(adUnitCopy);
@@ -21,6 +21,7 @@ const HOST_GETTERS = {
21
21
  bidsxchange: () => 'ghb.hbd.bidsxchange.com',
22
22
  streamkey: () => 'ghb.hb.streamkey.net',
23
23
  janet: () => 'ghb.bidder.jmgads.com',
24
+ pgam: () => 'ghb.pgamssp.com',
24
25
  }
25
26
  const getUri = function (bidderCode) {
26
27
  let bidderWithoutSuffix = bidderCode.split('_')[0];
@@ -37,7 +38,8 @@ export const spec = {
37
38
  code: BIDDER_CODE,
38
39
  gvlid: 410,
39
40
  aliases: ['onefiftytwomedia', 'selectmedia', 'appaloosa', 'bidsxchange', 'streamkey', 'janet',
40
- { code: 'navelix', gvlid: 380 }
41
+ { code: 'navelix', gvlid: 380 },
42
+ 'pgam'
41
43
  ],
42
44
  supportedMediaTypes: [VIDEO, BANNER],
43
45
  isBidRequestValid: function (bid) {
@@ -15,15 +15,21 @@ Alkimi bid adapter supports Banner and Video ads.
15
15
  ```
16
16
  const adUnits = [
17
17
  {
18
- bids: [
18
+ code: 'banner1',
19
+ mediaTypes: {
20
+ banner: { // Media Type can be banner or video or ...
21
+ sizes: [[300, 250]],
22
+ }
23
+ },
24
+ bids: [
19
25
  {
20
26
  bidder: 'alkimi',
21
27
  params: {
22
- bidFloor: 0.1,
23
- token: '?????????????????????', // Publisher Token provided by Alkimi
28
+ bidFloor: 0.5,
29
+ token: 'a6b042a5-2d68-4170-a051-77fbaf00203a', // Publisher Token(Id) provided by Alkimi
24
30
  }
25
31
  }
26
32
  ]
27
33
  }
28
- ];
34
+ ]
29
35
  ```
@@ -394,11 +394,22 @@ export const spec = {
394
394
  }
395
395
  },
396
396
 
397
- transformBidParams: function (params, isOpenRtb) {
397
+ transformBidParams: function (params, isOpenRtb, adUnit, bidRequests) {
398
398
  let conversionFn = transformBidderParamKeywords;
399
399
  if (isOpenRtb === true) {
400
+ let s2sEndpointUrl = null;
400
401
  let s2sConfig = config.getConfig('s2sConfig');
401
- let s2sEndpointUrl = deepAccess(s2sConfig, 'endpoint.p1Consent');
402
+
403
+ if (isPlainObject(s2sConfig)) {
404
+ s2sEndpointUrl = deepAccess(s2sConfig, 'endpoint.p1Consent');
405
+ } else if (isArray(s2sConfig)) {
406
+ s2sConfig.forEach(s2sCfg => {
407
+ if (includes(s2sCfg.bidders, adUnit.bids[0].bidder)) {
408
+ s2sEndpointUrl = deepAccess(s2sCfg, 'endpoint.p1Consent');
409
+ }
410
+ })
411
+ }
412
+
402
413
  if (s2sEndpointUrl && s2sEndpointUrl.match('/openrtb2/prebid')) {
403
414
  conversionFn = convertKeywordsToString;
404
415
  }
@@ -1,4 +1,5 @@
1
1
  import { deepAccess, isArray, logWarn, triggerPixel, buildUrl, logInfo, getValue, getBidIdParameter } from '../src/utils.js';
2
+ import { getRefererInfo } from '../src/refererDetection.js';
2
3
  import { registerBidder } from '../src/adapters/bidderFactory.js';
3
4
  import { config } from '../src/config.js';
4
5
  const BIDDER_CODE = 'beop';
@@ -36,11 +37,11 @@ export const spec = {
36
37
  */
37
38
  buildRequests: function(validBidRequests, bidderRequest) {
38
39
  const slots = validBidRequests.map(beOpRequestSlotsMaker);
39
- let pageUrl = deepAccess(window, 'location.href') || deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl');
40
- let fpd = config.getLegacyFpd(config.getConfig('ortb2'));
41
- let gdpr = bidderRequest.gdprConsent;
42
- let firstSlot = slots[0];
43
- let payloadObject = {
40
+ const pageUrl = getPageUrl(bidderRequest.refererInfo, window);
41
+ const fpd = config.getLegacyFpd(config.getConfig('ortb2'));
42
+ const gdpr = bidderRequest.gdprConsent;
43
+ const firstSlot = slots[0];
44
+ const payloadObject = {
44
45
  at: new Date().toString(),
45
46
  nid: firstSlot.nid,
46
47
  nptnid: firstSlot.nptnid,
@@ -100,6 +101,7 @@ export const spec = {
100
101
 
101
102
  function buildTrackingParams(data, info, value) {
102
103
  const accountId = data.params.accountId;
104
+ const pageUrl = getPageUrl(null, window);
103
105
  return {
104
106
  pid: accountId === undefined ? data.ad.match(/account: \“([a-f\d]{24})\“/)[1] : accountId,
105
107
  nid: data.params.networkId,
@@ -110,7 +112,7 @@ function buildTrackingParams(data, info, value) {
110
112
  se_ca: 'bid',
111
113
  se_ac: info,
112
114
  se_va: value,
113
- url: window.location.href
115
+ url: pageUrl
114
116
  };
115
117
  }
116
118
 
@@ -141,4 +143,47 @@ function beOpRequestSlotsMaker(bid) {
141
143
  }
142
144
  }
143
145
 
146
+ const protocolRelativeRegExp = /^\/\//
147
+ function isProtocolRelativeUrl(url) {
148
+ return url && url.match(protocolRelativeRegExp) != null;
149
+ }
150
+
151
+ const withProtocolRegExp = /[a-z]{1,}:\/\//
152
+ function isNoProtocolUrl(url) {
153
+ return url && url.match(withProtocolRegExp) == null;
154
+ }
155
+
156
+ function ensureProtocolInUrl(url, defaultProtocol) {
157
+ if (isProtocolRelativeUrl(url)) {
158
+ return `${defaultProtocol}${url}`;
159
+ } else if (isNoProtocolUrl(url)) {
160
+ return `${defaultProtocol}//${url}`;
161
+ }
162
+ return url;
163
+ }
164
+
165
+ /**
166
+ * sometimes trying to access a field (protected?) triggers an exception
167
+ * Ex deepAccess(window, 'top.location.href') might throw if it crosses origins
168
+ * so here is a lenient version
169
+ */
170
+ function safeDeepAccess(obj, path) {
171
+ try {
172
+ return deepAccess(obj, path)
173
+ } catch (_e) {
174
+ return null;
175
+ }
176
+ }
177
+
178
+ function getPageUrl(refererInfo, window) {
179
+ refererInfo = refererInfo || getRefererInfo();
180
+ let pageUrl = refererInfo.canonicalUrl || safeDeepAccess(window, 'top.location.href') || deepAccess(window, 'location.href');
181
+ // Ensure the protocol is present (looks like sometimes the extracted pageUrl misses it)
182
+ if (pageUrl != null) {
183
+ const defaultProtocol = safeDeepAccess(window, 'top.location.protocol') || deepAccess(window, 'location.protocol');
184
+ pageUrl = ensureProtocolInUrl(pageUrl, defaultProtocol);
185
+ }
186
+ return pageUrl;
187
+ }
188
+
144
189
  registerBidder(spec);
@@ -8,8 +8,6 @@
8
8
  import { submodule } from '../src/hook.js'
9
9
  import { getStorageManager } from '../src/storageManager.js'
10
10
 
11
- window.top.cpexIdVersion = '0.0.3'
12
-
13
11
  // Returns StorageManager
14
12
  export const storage = getStorageManager({ gvlid: 570, moduleName: 'cpexId' })
15
13
 
@@ -18,6 +16,7 @@ const getId = () => { return storage.getCookie('caid') || storage.getDataFromLoc
18
16
 
19
17
  /** @type {Submodule} */
20
18
  export const cpexIdSubmodule = {
19
+ version: '0.0.4',
21
20
  /**
22
21
  * used to link submodule with config
23
22
  * @type {string}
@@ -5,6 +5,7 @@ import CONSTANTS from '../src/constants.json';
5
5
  import { ajax } from '../src/ajax.js';
6
6
  import { config } from '../src/config.js';
7
7
  import { getHook } from '../src/hook.js';
8
+ import {promiseControls} from '../src/utils/promise.js';
8
9
 
9
10
  const DEFAULT_CURRENCY_RATE_URL = 'https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json?date=$$TODAY$$';
10
11
  const CURRENCY_RATE_PRECISION = 4;
@@ -21,22 +22,12 @@ var bidderCurrencyDefault = {};
21
22
  var defaultRates;
22
23
 
23
24
  export const ready = (() => {
24
- let isDone, resolver, promise;
25
+ let ctl;
25
26
  function reset() {
26
- isDone = false;
27
- resolver = null;
28
- promise = new Promise((resolve) => {
29
- resolver = resolve;
30
- if (isDone) resolve();
31
- })
32
- }
33
- function done() {
34
- isDone = true;
35
- if (resolver != null) { resolver() }
27
+ ctl = promiseControls();
36
28
  }
37
29
  reset();
38
-
39
- return {done, reset, promise: () => promise}
30
+ return {done: () => ctl.resolve(), reset, promise: () => ctl.promise}
40
31
  })();
41
32
 
42
33
  /**
@@ -1,11 +1,11 @@
1
- ## DAC User ID Submodule
1
+ ## AudienceOne User ID Submodule
2
2
 
3
- DAC ID, provided by [D.A.Consortium Inc.](https://www.dac.co.jp/), is ID for ad targeting by using 1st party cookie.
3
+ AudienceOne ID, provided by [D.A.Consortium Inc.](https://www.dac.co.jp/), is ID for ad targeting by using 1st party cookie.
4
4
  Please contact D.A.Consortium Inc. before using this ID.
5
5
 
6
- ## Building Prebid with DAC ID Support
6
+ ## Building Prebid with AudienceOne ID Support
7
7
 
8
- First, make sure to add the DAC ID submodule to your Prebid.js package with:
8
+ First, make sure to add the AudienceOne ID submodule to your Prebid.js package with:
9
9
 
10
10
  ```
11
11
  gulp build --modules=dacIdSystem
@@ -11,6 +11,7 @@ import { auctionManager } from '../src/auctionManager.js';
11
11
  import { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js';
12
12
  import * as events from '../src/events.js';
13
13
  import CONSTANTS from '../src/constants.json';
14
+ import {getPPID} from '../src/adserver.js';
14
15
 
15
16
  /**
16
17
  * @typedef {Object} DfpVideoParams
@@ -118,6 +119,13 @@ export function buildDfpVideoUrl(options) {
118
119
  const uspConsent = uspDataHandler.getConsentData();
119
120
  if (uspConsent) { queryParams.us_privacy = uspConsent; }
120
121
 
122
+ if (!queryParams.ppid) {
123
+ const ppid = getPPID();
124
+ if (ppid != null) {
125
+ queryParams.ppid = ppid;
126
+ }
127
+ }
128
+
121
129
  return buildUrl(Object.assign({
122
130
  protocol: 'https',
123
131
  host: 'securepubads.g.doubleclick.net',
@@ -0,0 +1,57 @@
1
+ /**
2
+ * This module adds gravitompId to the User ID module
3
+ * The {@link module:modules/userId} module is required
4
+ * @module modules/gravitoIdSystem
5
+ * @requires module:modules/userId
6
+ */
7
+
8
+ import { submodule } from '../src/hook.js';
9
+ import { getStorageManager } from '../src/storageManager.js';
10
+
11
+ export const storage = getStorageManager();
12
+
13
+ export const cookieKey = 'gravitompId';
14
+
15
+ export const gravitoIdSystemSubmodule = {
16
+ /**
17
+ * used to link submodule with config
18
+ * @type {string}
19
+ */
20
+ name: 'gravitompId',
21
+
22
+ /**
23
+ * performs action to obtain id
24
+ * @function
25
+ * @returns { {id: {gravitompId: string}} | undefined }
26
+ */
27
+ getId: function() {
28
+ const newId = storage.getCookie(cookieKey);
29
+ if (!newId) {
30
+ return undefined;
31
+ }
32
+ const result = {
33
+ gravitompId: newId
34
+ }
35
+ return {id: result};
36
+ },
37
+
38
+ /**
39
+ * decode the stored id value for passing to bid requests
40
+ * @function
41
+ * @param { {gravitompId: string} } value
42
+ * @returns { {gravitompId: {id: string} } | undefined }
43
+ */
44
+ decode: function(value) {
45
+ if (value && typeof value === 'object') {
46
+ const result = {};
47
+ if (value.gravitompId) {
48
+ result.id = value.gravitompId
49
+ }
50
+ return {gravitompId: result};
51
+ }
52
+ return undefined;
53
+ },
54
+
55
+ }
56
+
57
+ submodule('userId', gravitoIdSystemSubmodule);
@@ -0,0 +1,28 @@
1
+ ## Gravito User ID Submodule
2
+
3
+ Gravito ID, provided by [Gravito Ltd.](https://gravito.net), is ID for ad targeting by using 1st party cookie.
4
+ Please contact Gravito Ltd. before using this ID.
5
+
6
+ ## Building Prebid with Gravito ID Support
7
+
8
+ First, make sure to add the Gravito ID submodule to your Prebid.js package with:
9
+
10
+ ```
11
+ gulp build --modules=gravitoIdSystem
12
+ ```
13
+
14
+ The following configuration parameters are available:
15
+
16
+ ```javascript
17
+ pbjs.setConfig({
18
+ userSync: {
19
+ userIds: [{
20
+ name: 'gravitompId'
21
+ }]
22
+ }
23
+ });
24
+ ```
25
+
26
+ | Param under userSync.userIds[] | Scope | Type | Description | Example |
27
+ | --- | --- | --- | --- | --- |
28
+ | name | Required | String | The name of this module. | `"gravitompId"` |