prebid.js 5.19.0 → 6.2.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 (161) hide show
  1. package/.babelrc.js +1 -10
  2. package/README.md +4 -2
  3. package/browsers.json +13 -37
  4. package/gulpfile.js +1 -0
  5. package/karma.conf.maker.js +1 -1
  6. package/modules/adheseBidAdapter.js +7 -2
  7. package/modules/adkernelBidAdapter.js +1 -0
  8. package/modules/adlivetechBidAdapter.md +61 -0
  9. package/modules/admixerBidAdapter.js +2 -1
  10. package/modules/adnuntiusBidAdapter.js +2 -1
  11. package/modules/adomikAnalyticsAdapter.js +10 -4
  12. package/modules/adplusBidAdapter.js +203 -0
  13. package/modules/adplusBidAdapter.md +39 -0
  14. package/modules/adyoulikeBidAdapter.js +7 -2
  15. package/modules/airgridRtdProvider.js +1 -1
  16. package/modules/appnexusBidAdapter.js +28 -5
  17. package/modules/atsAnalyticsAdapter.js +67 -46
  18. package/modules/atsAnalyticsAdapter.md +1 -0
  19. package/modules/beachfrontBidAdapter.js +14 -17
  20. package/modules/betweenBidAdapter.js +2 -1
  21. package/modules/browsiRtdProvider.js +106 -18
  22. package/modules/cleanioRtdProvider.js +192 -0
  23. package/modules/cleanioRtdProvider.md +59 -0
  24. package/modules/codefuelBidAdapter.js +1 -3
  25. package/modules/codefuelBidAdapter.md +3 -3
  26. package/modules/craftBidAdapter.js +5 -3
  27. package/modules/datablocksBidAdapter.js +3 -3
  28. package/modules/dchain.js +149 -0
  29. package/modules/dchain.md +45 -0
  30. package/modules/deepintentBidAdapter.js +1 -1
  31. package/modules/deltaprojectsBidAdapter.js +252 -0
  32. package/modules/deltaprojectsBidAdapter.md +32 -0
  33. package/modules/emx_digitalBidAdapter.js +9 -1
  34. package/modules/engageyaBidAdapter.js +68 -54
  35. package/modules/freewheel-sspBidAdapter.js +6 -0
  36. package/modules/glimpseBidAdapter.js +31 -16
  37. package/modules/goldbachBidAdapter.js +1176 -0
  38. package/modules/goldbachBidAdapter.md +151 -0
  39. package/modules/gptPreAuction.js +11 -5
  40. package/modules/gridBidAdapter.js +1 -0
  41. package/modules/gumgumBidAdapter.js +5 -1
  42. package/modules/id5IdSystem.md +6 -6
  43. package/modules/imRtdProvider.js +31 -0
  44. package/modules/intersectionRtdProvider.js +114 -0
  45. package/modules/invibesBidAdapter.js +15 -9
  46. package/modules/ipromBidAdapter.js +79 -0
  47. package/modules/ixBidAdapter.js +173 -22
  48. package/modules/jixieBidAdapter.js +8 -2
  49. package/modules/justpremiumBidAdapter.js +6 -1
  50. package/modules/limelightDigitalBidAdapter.js +2 -1
  51. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  52. package/modules/luponmediaBidAdapter.js +570 -0
  53. package/modules/merkleIdSystem.js +5 -0
  54. package/modules/missenaBidAdapter.js +89 -0
  55. package/modules/multibid/index.js +3 -3
  56. package/modules/nativoBidAdapter.js +32 -2
  57. package/modules/oguryBidAdapter.js +2 -1
  58. package/modules/openxBidAdapter.js +7 -2
  59. package/modules/operaadsBidAdapter.js +21 -1
  60. package/modules/otmBidAdapter.js +146 -0
  61. package/modules/otmBidAdapter.md +27 -26
  62. package/modules/outbrainBidAdapter.js +5 -0
  63. package/modules/playwireBidAdapter.md +61 -0
  64. package/modules/prebidServerBidAdapter/index.js +3 -3
  65. package/modules/pubmaticBidAdapter.js +5 -3
  66. package/modules/relaidoBidAdapter.js +86 -65
  67. package/modules/richaudienceBidAdapter.js +1 -1
  68. package/modules/rtdModule/index.js +2 -2
  69. package/modules/saambaaBidAdapter.js +420 -0
  70. package/modules/saambaaBidAdapter.md +65 -68
  71. package/modules/seedtagBidAdapter.js +6 -0
  72. package/modules/smaatoBidAdapter.js +9 -1
  73. package/modules/smartxBidAdapter.js +17 -1
  74. package/modules/sonobiBidAdapter.js +7 -0
  75. package/modules/sortableBidAdapter.js +1 -0
  76. package/modules/sspBCBidAdapter.js +34 -3
  77. package/modules/tappxBidAdapter.js +3 -1
  78. package/modules/teadsBidAdapter.js +3 -0
  79. package/modules/trustxBidAdapter.js +18 -7
  80. package/modules/undertoneBidAdapter.js +8 -1
  81. package/modules/userId/index.js +27 -2
  82. package/modules/ventes.md +71 -0
  83. package/modules/ventesBidAdapter.js +410 -0
  84. package/modules/ventesBidAdapter.md +93 -0
  85. package/modules/vidoomyBidAdapter.js +51 -100
  86. package/modules/visxBidAdapter.js +20 -3
  87. package/modules/visxBidAdapter.md +4 -6
  88. package/modules/yahoosspBidAdapter.js +6 -6
  89. package/modules/yahoosspBidAdapter.md +1 -1
  90. package/modules/yieldlabBidAdapter.js +41 -10
  91. package/modules/yieldlabBidAdapter.md +91 -48
  92. package/modules/yieldoneBidAdapter.js +115 -11
  93. package/package.json +6 -1
  94. package/src/adapterManager.js +14 -8
  95. package/src/auction.js +14 -13
  96. package/src/targeting.js +2 -2
  97. package/src/utils.js +7 -0
  98. package/test/spec/integration/faker/googletag.js +6 -0
  99. package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
  100. package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
  101. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
  102. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  103. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  104. package/test/spec/modules/appnexusBidAdapter_spec.js +65 -2
  105. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  106. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  107. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  108. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  109. package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
  110. package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
  111. package/test/spec/modules/dchain_spec.js +329 -0
  112. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  113. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  114. package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
  115. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  116. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  117. package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
  118. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  119. package/test/spec/modules/gptPreAuction_spec.js +58 -4
  120. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  121. package/test/spec/modules/imRtdProvider_spec.js +25 -0
  122. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  123. package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
  124. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  125. package/test/spec/modules/ixBidAdapter_spec.js +288 -5
  126. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  127. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  128. package/test/spec/modules/konduitWrapper_spec.js +0 -1
  129. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  130. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  131. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  132. package/test/spec/modules/merkleIdSystem_spec.js +18 -0
  133. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  134. package/test/spec/modules/multibid_spec.js +31 -31
  135. package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
  136. package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
  137. package/test/spec/modules/openxBidAdapter_spec.js +5 -26
  138. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  139. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  140. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  141. package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
  142. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  143. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  144. package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
  145. package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
  146. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  147. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  148. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  149. package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
  150. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  151. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  152. package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
  153. package/test/spec/modules/userId_spec.js +51 -0
  154. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  155. package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
  156. package/test/spec/modules/visxBidAdapter_spec.js +121 -5
  157. package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
  158. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  159. package/test/spec/unit/core/adapterManager_spec.js +26 -7
  160. package/test/spec/unit/core/targeting_spec.js +44 -0
  161. package/wdio.conf.js +1 -1
@@ -1,6 +1,9 @@
1
1
  import { deepAccess, parseGPTSingleSizeArray, inIframe, deepClone, logError, logWarn, isFn, contains, isInteger, isArray, deepSetValue, parseQueryStringParameters, isEmpty, mergeDeep, convertTypes } from '../src/utils.js';
2
2
  import { BANNER, VIDEO } from '../src/mediaTypes.js';
3
3
  import { config } from '../src/config.js';
4
+ import { EVENTS } from '../src/constants.json';
5
+ import { getStorageManager } from '../src/storageManager.js';
6
+ import events from '../src/events.js';
4
7
  import find from 'core-js-pure/features/array/find.js';
5
8
  import { registerBidder } from '../src/adapters/bidderFactory.js';
6
9
  import { INSTREAM, OUTSTREAM } from '../src/video.js';
@@ -20,15 +23,23 @@ const VIDEO_TIME_TO_LIVE = 3600; // 1hr
20
23
  const NET_REVENUE = true;
21
24
  const MAX_REQUEST_SIZE = 8000;
22
25
  const MAX_REQUEST_LIMIT = 4;
23
-
24
26
  const PRICE_TO_DOLLAR_FACTOR = {
25
27
  JPY: 1
26
28
  };
27
29
  const USER_SYNC_URL = 'https://js-sec.indexww.com/um/ixmatch.html';
28
30
  const RENDERER_URL = 'https://js-sec.indexww.com/htv/video-player.js';
29
31
  const FLOOR_SOURCE = { PBJS: 'p', IX: 'x' };
30
- // determines which eids we send and the rtiPartner field in ext
31
-
32
+ export const ERROR_CODES = {
33
+ BID_SIZE_INVALID_FORMAT: 1,
34
+ BID_SIZE_NOT_INCLUDED: 2,
35
+ PROPERTY_NOT_INCLUDED: 3,
36
+ SITE_ID_INVALID_VALUE: 4,
37
+ BID_FLOOR_INVALID_FORMAT: 5,
38
+ IX_FPD_EXCEEDS_MAX_SIZE: 6,
39
+ EXCEEDS_MAX_SIZE: 7,
40
+ PB_FPD_EXCEEDS_MAX_SIZE: 8,
41
+ VIDEO_DURATION_INVALID: 9
42
+ };
32
43
  const FIRST_PARTY_DATA = {
33
44
  SITE: [
34
45
  'id', 'name', 'domain', 'cat', 'sectioncat', 'pagecat', 'page', 'ref', 'search', 'mobile',
@@ -36,7 +47,6 @@ const FIRST_PARTY_DATA = {
36
47
  ],
37
48
  USER: ['id', 'buyeruid', 'yob', 'gender', 'keywords', 'customdata', 'geo', 'data', 'ext']
38
49
  };
39
-
40
50
  const SOURCE_RTI_MAPPING = {
41
51
  'liveramp.com': 'idl',
42
52
  'netid.de': 'NETID',
@@ -45,7 +55,6 @@ const SOURCE_RTI_MAPPING = {
45
55
  'uidapi.com': 'UID2',
46
56
  'adserver.org': 'TDID'
47
57
  };
48
-
49
58
  const PROVIDERS = [
50
59
  'britepoolid',
51
60
  'id5id',
@@ -62,9 +71,7 @@ const PROVIDERS = [
62
71
  'TDID',
63
72
  'flocId'
64
73
  ];
65
-
66
74
  const REQUIRED_VIDEO_PARAMS = ['mimes', 'minduration', 'maxduration']; // note: protocol/protocols is also reqd
67
-
68
75
  const VIDEO_PARAMS_ALLOW_LIST = [
69
76
  'mimes', 'minduration', 'maxduration', 'protocols', 'protocol',
70
77
  'startdelay', 'placement', 'linearity', 'skip', 'skipmin',
@@ -73,6 +80,17 @@ const VIDEO_PARAMS_ALLOW_LIST = [
73
80
  'delivery', 'pos', 'companionad', 'api', 'companiontype', 'ext',
74
81
  'playerSize', 'w', 'h'
75
82
  ];
83
+ const LOCAL_STORAGE_KEY = 'ixdiag';
84
+ let hasRegisteredHandler = false;
85
+ export const storage = getStorageManager(GLOBAL_VENDOR_ID, BIDDER_CODE);
86
+
87
+ // Possible values for bidResponse.seatBid[].bid[].mtype which indicates the type of the creative markup so that it can properly be associated with the right sub-object of the BidRequest.Imp.
88
+ const MEDIA_TYPES = {
89
+ Banner: 1,
90
+ Video: 2,
91
+ Audio: 3,
92
+ Native: 4
93
+ }
76
94
 
77
95
  /**
78
96
  * Transform valid bid request config object to banner impression object that will be sent to ad server.
@@ -125,7 +143,10 @@ function bidToVideoImp(bid) {
125
143
  }
126
144
 
127
145
  if (imp.video.minduration > imp.video.maxduration) {
128
- logError(`IX Bid Adapter: video minduration [${imp.video.minduration}] cannot be greater than video maxduration [${imp.video.maxduration}]`);
146
+ logError(
147
+ `IX Bid Adapter: video minduration [${imp.video.minduration}] cannot be greater than video maxduration [${imp.video.maxduration}]`,
148
+ { bidder: BIDDER_CODE, code: ERROR_CODES.VIDEO_DURATION_INVALID }
149
+ );
129
150
  return {};
130
151
  }
131
152
 
@@ -262,9 +283,14 @@ function parseBid(rawBid, currency, bidRequest) {
262
283
  bid.currency = currency;
263
284
  bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-';
264
285
 
265
- // in the event of a video
266
- if (deepAccess(rawBid, 'ext.vasturl')) {
286
+ if (rawBid.mtype == MEDIA_TYPES.Video) {
287
+ bid.vastXml = rawBid.adm
288
+ } else if (rawBid.ext && rawBid.ext.vasturl) {
267
289
  bid.vastUrl = rawBid.ext.vasturl
290
+ }
291
+
292
+ // in the event of a video
293
+ if ((rawBid.ext && rawBid.ext.vasturl) || rawBid.mtype == MEDIA_TYPES.Video) {
268
294
  bid.width = bidRequest.video.w;
269
295
  bid.height = bidRequest.video.h;
270
296
  bid.mediaType = VIDEO;
@@ -498,6 +524,13 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
498
524
  r.ext.ixdiag[key] = ixdiag[key];
499
525
  }
500
526
 
527
+ // Get cached errors stored in LocalStorage
528
+ const cachedErrors = getCachedErrors();
529
+
530
+ if (!isEmpty(cachedErrors)) {
531
+ r.ext.ixdiag.err = cachedErrors;
532
+ }
533
+
501
534
  // if an schain is provided, send it along
502
535
  if (validBidRequests[0].schain) {
503
536
  r.source = {
@@ -576,7 +609,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
576
609
  const baseRequestSize = `${baseUrl}${parseQueryStringParameters({ ...payload, r: JSON.stringify(r) })}`.length;
577
610
 
578
611
  if (baseRequestSize > MAX_REQUEST_SIZE) {
579
- logError('ix bidder: Base request size has exceeded maximum request size.');
612
+ logError('IX Bid Adapter: Base request size has exceeded maximum request size.', { bidder: BIDDER_CODE, code: ERROR_CODES.EXCEEDS_MAX_SIZE });
580
613
  return requests;
581
614
  }
582
615
 
@@ -606,7 +639,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
606
639
  }
607
640
  currentRequestSize += fpdRequestSize;
608
641
  } else {
609
- logError('ix bidder: IX config FPD request size has exceeded maximum request size.');
642
+ logError('IX Bid Adapter: IX config FPD request size has exceeded maximum request size.', { bidder: BIDDER_CODE, code: ERROR_CODES.IX_FPD_EXCEEDS_MAX_SIZE });
610
643
  }
611
644
  }
612
645
 
@@ -646,7 +679,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
646
679
  }
647
680
 
648
681
  if (impressionObjects.length && BANNER in impressionObjects[0]) {
649
- const { id, banner: { topframe } } = impressionObjects[0];
682
+ const { id, banner: { topframe }, ext } = impressionObjects[0];
650
683
  const _bannerImpression = {
651
684
  id,
652
685
  banner: {
@@ -655,6 +688,12 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
655
688
  },
656
689
  }
657
690
 
691
+ if (ext.dfp_ad_unit_code) {
692
+ _bannerImpression.ext = {
693
+ dfp_ad_unit_code: ext.dfp_ad_unit_code
694
+ }
695
+ }
696
+
658
697
  if ('bidfloor' in impressionObjects[0]) {
659
698
  _bannerImpression.bidfloor = impressionObjects[0].bidfloor;
660
699
  }
@@ -707,7 +746,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
707
746
  const fpdRequestSize = encodeURIComponent(JSON.stringify({ ...site, ...user })).length;
708
747
  currentRequestSize += fpdRequestSize;
709
748
  } else {
710
- logError('ix bidder: FPD request size has exceeded maximum request size.');
749
+ logError('IX Bid Adapter: FPD request size has exceeded maximum request size.', { bidder: BIDDER_CODE, code: ERROR_CODES.PB_FPD_EXCEEDS_MAX_SIZE });
711
750
  }
712
751
  }
713
752
 
@@ -940,10 +979,99 @@ function createMissingBannerImp(bid, imp, newSize) {
940
979
  }
941
980
 
942
981
  /**
982
+ * @typedef {Array[message: string, err: Object<bidder: string, code: number>]} ErrorData
983
+ * @property {string} message - The error message.
984
+ * @property {object} err - The error object.
985
+ * @property {string} err.bidder - The bidder of the error.
986
+ * @property {string} err.code - The error code.
987
+ */
988
+
989
+ /**
990
+ * Error Event handler that receives type and arguments in a data object.
991
+ *
992
+ * @param {ErrorData} data
993
+ */
994
+ function errorEventHandler(data) {
995
+ if (!storage.localStorageIsEnabled()) {
996
+ return;
997
+ }
998
+
999
+ let currentStorage;
1000
+
1001
+ try {
1002
+ currentStorage = JSON.parse(storage.getDataFromLocalStorage(LOCAL_STORAGE_KEY) || '{}');
1003
+ } catch (e) {
1004
+ logWarn('ix can not read ixdiag from localStorage.');
1005
+ }
1006
+
1007
+ const todayDate = new Date();
1008
+
1009
+ Object.keys(currentStorage).map((errorDate) => {
1010
+ const date = new Date(errorDate);
1011
+
1012
+ if (date.setDate(date.getDate() + 7) - todayDate < 0) {
1013
+ delete currentStorage[errorDate];
1014
+ }
1015
+ });
1016
+
1017
+ if (data.type === 'ERROR' && data.arguments && data.arguments[1] && data.arguments[1].bidder === BIDDER_CODE) {
1018
+ const todayString = todayDate.toISOString().slice(0, 10);
1019
+
1020
+ const errorCode = data.arguments[1].code;
1021
+
1022
+ if (errorCode) {
1023
+ currentStorage[todayString] = currentStorage[todayString] || {};
1024
+
1025
+ if (!Number(currentStorage[todayString][errorCode])) {
1026
+ currentStorage[todayString][errorCode] = 0;
1027
+ }
1028
+
1029
+ currentStorage[todayString][errorCode]++;
1030
+ };
1031
+ }
1032
+
1033
+ storage.setDataInLocalStorage(LOCAL_STORAGE_KEY, JSON.stringify(currentStorage));
1034
+ }
1035
+
1036
+ /**
1037
+ * Get ixdiag stored in LocalStorage and format to be added to request payload
1038
+ *
1039
+ * @returns {Object} Object with error codes and counts
1040
+ */
1041
+ function getCachedErrors() {
1042
+ if (!storage.localStorageIsEnabled()) {
1043
+ return;
1044
+ }
1045
+
1046
+ const errors = {};
1047
+ let currentStorage;
1048
+
1049
+ try {
1050
+ currentStorage = JSON.parse(storage.getDataFromLocalStorage(LOCAL_STORAGE_KEY) || '{}');
1051
+ } catch (e) {
1052
+ logError('ix can not read ixdiag from localStorage.');
1053
+ return null;
1054
+ }
1055
+
1056
+ Object.keys(currentStorage).forEach((date) => {
1057
+ Object.keys(currentStorage[date]).forEach((code) => {
1058
+ if (typeof currentStorage[date][code] === 'number') {
1059
+ errors[code] = errors[code]
1060
+ ? errors[code] + currentStorage[date][code]
1061
+ : currentStorage[date][code];
1062
+ }
1063
+ });
1064
+ });
1065
+
1066
+ return errors;
1067
+ }
1068
+
1069
+ /**
1070
+ *
943
1071
  * Initialize Outstream Renderer
944
1072
  * @param {Object} bid
945
1073
  */
946
- function outstreamRenderer (bid) {
1074
+ function outstreamRenderer(bid) {
947
1075
  bid.renderer.push(() => {
948
1076
  var config = {
949
1077
  width: bid.width,
@@ -951,7 +1079,13 @@ function outstreamRenderer (bid) {
951
1079
  timeout: 3000
952
1080
  };
953
1081
 
954
- window.IXOutstreamPlayer(bid.vastUrl, bid.adUnitCode, config);
1082
+ // IXOutstreamPlayer supports both vastUrl and vastXml, so we can pass either.
1083
+ // Since vastUrl is going to be deprecated from exchange response, vastXml takes priority.
1084
+ if (bid.vastXml) {
1085
+ window.IXOutstreamPlayer(bid.vastXml, bid.adUnitCode, config);
1086
+ } else {
1087
+ window.IXOutstreamPlayer(bid.vastUrl, bid.adUnitCode, config);
1088
+ }
955
1089
  });
956
1090
  }
957
1091
 
@@ -960,7 +1094,7 @@ function outstreamRenderer (bid) {
960
1094
  * @param {string} id
961
1095
  * @returns {Renderer}
962
1096
  */
963
- function createRenderer (id) {
1097
+ function createRenderer(id) {
964
1098
  const renderer = Renderer.install({
965
1099
  id: id,
966
1100
  url: RENDERER_URL,
@@ -994,6 +1128,12 @@ export const spec = {
994
1128
  * @return {boolean} True if this is a valid bid, and false otherwise.
995
1129
  */
996
1130
  isBidRequestValid: function (bid) {
1131
+ if (!hasRegisteredHandler) {
1132
+ events.on(EVENTS.AUCTION_DEBUG, errorEventHandler);
1133
+ events.on(EVENTS.AD_RENDER_FAILED, errorEventHandler);
1134
+ hasRegisteredHandler = true;
1135
+ }
1136
+
997
1137
  const paramsVideoRef = deepAccess(bid, 'params.video');
998
1138
  const paramsSize = deepAccess(bid, 'params.size');
999
1139
  const mediaTypeBannerSizes = deepAccess(bid, 'mediaTypes.banner.sizes');
@@ -1003,6 +1143,7 @@ export const spec = {
1003
1143
  const hasBidFloorCur = bid.params.hasOwnProperty('bidFloorCur');
1004
1144
 
1005
1145
  if (bid.hasOwnProperty('mediaType') && !(contains(SUPPORTED_AD_TYPES, bid.mediaType))) {
1146
+ logWarn('IX Bid Adapter: media type is not supported.');
1006
1147
  return false;
1007
1148
  }
1008
1149
 
@@ -1014,26 +1155,26 @@ export const spec = {
1014
1155
  // since there is an ix bidder level size, make sure its valid
1015
1156
  const ixSize = getFirstSize(paramsSize);
1016
1157
  if (!ixSize) {
1017
- logError('ix bidder params: size has invalid format.');
1158
+ logError('IX Bid Adapter: size has invalid format.', { bidder: BIDDER_CODE, code: ERROR_CODES.BID_SIZE_INVALID_FORMAT });
1018
1159
  return false;
1019
1160
  }
1020
1161
  // check if the ix bidder level size, is present in ad unit level
1021
1162
  if (!includesSize(bid.sizes, ixSize) &&
1022
1163
  !(includesSize(mediaTypeVideoPlayerSize, ixSize)) &&
1023
1164
  !(includesSize(mediaTypeBannerSizes, ixSize))) {
1024
- logError('ix bidder params: bid size is not included in ad unit sizes or player size.');
1165
+ logError('IX Bid Adapter: bid size is not included in ad unit sizes or player size.', { bidder: BIDDER_CODE, code: ERROR_CODES.BID_SIZE_NOT_INCLUDED });
1025
1166
  return false;
1026
1167
  }
1027
1168
  }
1028
1169
 
1029
1170
  if (typeof bid.params.siteId !== 'string' && typeof bid.params.siteId !== 'number') {
1030
- logError('ix bidder params: siteId must be string or number value.');
1171
+ logError('IX Bid Adapter: siteId must be string or number value.', { bidder: BIDDER_CODE, code: ERROR_CODES.SITE_ID_INVALID_VALUE });
1031
1172
  return false;
1032
1173
  }
1033
1174
 
1034
1175
  if (hasBidFloor || hasBidFloorCur) {
1035
1176
  if (!(hasBidFloor && hasBidFloorCur && isValidBidFloorParams(bid.params.bidFloor, bid.params.bidFloorCur))) {
1036
- logError('ix bidder params: bidFloor / bidFloorCur parameter has invalid format.');
1177
+ logError('IX Bid Adapter: bidFloor / bidFloorCur parameter has invalid format.', { bidder: BIDDER_CODE, code: ERROR_CODES.BID_FLOOR_INVALID_FORMAT });
1037
1178
  return false;
1038
1179
  }
1039
1180
  }
@@ -1042,7 +1183,7 @@ export const spec = {
1042
1183
  const errorList = checkVideoParams(mediaTypeVideoRef, paramsVideoRef);
1043
1184
  if (errorList.length) {
1044
1185
  errorList.forEach((err) => {
1045
- logError(err);
1186
+ logError(err, { bidder: BIDDER_CODE, code: ERROR_CODES.PROPERTY_NOT_INCLUDED });
1046
1187
  });
1047
1188
  return false;
1048
1189
  }
@@ -1163,6 +1304,16 @@ export const spec = {
1163
1304
 
1164
1305
  bids.push(bid);
1165
1306
  }
1307
+
1308
+ if (deepAccess(requestBid, 'ext.ixdiag.err')) {
1309
+ if (storage.localStorageIsEnabled()) {
1310
+ try {
1311
+ storage.removeDataFromLocalStorage(LOCAL_STORAGE_KEY);
1312
+ } catch (e) {
1313
+ logError('ix can not clear ixdiag from localStorage.');
1314
+ }
1315
+ }
1316
+ }
1166
1317
  }
1167
1318
 
1168
1319
  return bids;
@@ -10,7 +10,7 @@ export const storage = getStorageManager();
10
10
 
11
11
  const BIDDER_CODE = 'jixie';
12
12
  const EVENTS_URL = 'https://hbtra.jixie.io/sync/hb?';
13
- const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js';
13
+ const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js';
14
14
  const REQUESTS_URL = 'https://hb.jixie.io/v2/hbpost';
15
15
  const sidTTLMins_ = 30;
16
16
 
@@ -104,7 +104,8 @@ function getMiscDims_() {
104
104
  let ret = {
105
105
  pageurl: '',
106
106
  domain: '',
107
- device: 'unknown'
107
+ device: 'unknown',
108
+ mkeywords: ''
108
109
  }
109
110
  try {
110
111
  let refererInfo_ = getRefererInfo();
@@ -112,6 +113,10 @@ function getMiscDims_() {
112
113
  ret.pageurl = url_;
113
114
  ret.domain = parseUrl(url_).host;
114
115
  ret.device = getDevice_();
116
+ let keywords = document.getElementsByTagName('meta')['keywords'];
117
+ if (keywords && keywords.content) {
118
+ ret.mkeywords = keywords.content;
119
+ }
115
120
  } catch (error) {}
116
121
  return ret;
117
122
  }
@@ -167,6 +172,7 @@ export const spec = {
167
172
  device: miscDims.device,
168
173
  domain: miscDims.domain,
169
174
  pageurl: miscDims.pageurl,
175
+ mkeywords: miscDims.mkeywords,
170
176
  bids: bids,
171
177
  cfg: jixieCfgBlob
172
178
  }, ids);
@@ -4,7 +4,7 @@ import { deepAccess } from '../src/utils.js';
4
4
  const BIDDER_CODE = 'justpremium'
5
5
  const GVLID = 62
6
6
  const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr'
7
- const JP_ADAPTER_VERSION = '1.8'
7
+ const JP_ADAPTER_VERSION = '1.8.1'
8
8
  const pixels = []
9
9
 
10
10
  export const spec = {
@@ -101,6 +101,11 @@ export const spec = {
101
101
  advertiserDomains: bid.adomain && bid.adomain.length > 0 ? bid.adomain : []
102
102
  }
103
103
  }
104
+ if (bid.ext && bid.ext.pg) {
105
+ bidResponse.adserverTargeting = {
106
+ 'hb_deal_justpremium': 'jp_pg'
107
+ }
108
+ }
104
109
  bidResponses.push(bidResponse)
105
110
  }
106
111
  })
@@ -158,7 +158,8 @@ function buildPlacement(bidRequest) {
158
158
  height: size[1]
159
159
  }
160
160
  }),
161
- type: bidRequest.params.adUnitType.toUpperCase()
161
+ type: bidRequest.params.adUnitType.toUpperCase(),
162
+ publisherId: bidRequest.params.publisherId
162
163
  }
163
164
  }
164
165
  }
@@ -3,6 +3,7 @@ import {ajax} from '../src/ajax.js';
3
3
  import adapter from '../src/AnalyticsAdapter.js';
4
4
  import CONSTANTS from '../src/constants.json';
5
5
  import adapterManager from '../src/adapterManager.js';
6
+ import { getGlobal } from '../src/prebidGlobal.js';
6
7
 
7
8
  const ANALYTICSTYPE = 'endpoint';
8
9
  const URL = 'https://lwadm.com/analytics/10';
@@ -14,6 +15,7 @@ const TIMEOUTSENT = 8;
14
15
  const ADRENDERFAILEDSENT = 16;
15
16
 
16
17
  let initOptions;
18
+ let prebidGlobal = getGlobal();
17
19
  export const BID_WON_TIMEOUT = 500;
18
20
 
19
21
  const cache = {
@@ -79,6 +81,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE
79
81
  bidResponse.width = args.width;
80
82
  bidResponse.height = args.height;
81
83
  bidResponse.cpm = args.cpm;
84
+ bidResponse.originalCpm = prebidGlobal.convertCurrency(args.originalCpm, args.originalCurrency, args.currency);
82
85
  bidResponse.ttr = args.timeToRespond;
83
86
  bidResponse.readyToSend = 1;
84
87
  bidResponse.mediaType = args.mediaType == 'native' ? 2 : (args.mediaType == 'video' ? 4 : 1);
@@ -237,6 +240,7 @@ function getResponses(gdpr, auctionIds) {
237
240
  width: bid.width,
238
241
  height: bid.height,
239
242
  cpm: bid.cpm,
243
+ orgCpm: bid.originalCpm,
240
244
  ttr: bid.ttr,
241
245
  IsBid: bid.isBid,
242
246
  mediaType: bid.mediaType,
@@ -276,6 +280,7 @@ function getWins(gdpr, auctionIds) {
276
280
  width: bid.width,
277
281
  height: bid.height,
278
282
  cpm: bid.cpm,
283
+ orgCpm: bid.originalCpm,
279
284
  mediaType: bid.mediaType,
280
285
  gdpr: gdprPos,
281
286
  floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined),