Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Prebid Server adapter: fledge support (prebid#9342)
  Taboola Bid Adapter: resolve AUCTION_PRICE macro (prebid#9735)
  Revert "IntentIQ Analytics Module : initial release (prebid#9322)" (prebid#9734)
  IntentIQ Analytics Module : initial release (prebid#9322)
  Increment version to 7.44.0-pre
  Prebid 7.43.0 release
  Core: allow restriction of cookies / localStorage through `bidderSettings.*.storageAllowed` (prebid#9660)
  Add 9 Dots Media alias (prebid#9699)
  Smaato: Adapters that accept geolocation data from bid parameters should also accept it from ortb2.(device|user).geo (prebid#9676) (prebid#9725)
  Adloox AdServer Video : lengthen test timeouts (prebid#9728)
  RTBHouse Bid Adapter: change `source.tid` to contain `auctionId` and populate imp-level `ext.tid` (prebid#9726)
  chore: update `getAudiencesAsBidderOrtb2` implementation and test (prebid#9720)
  CORE: allow to disable setting the pbjs global variable (prebid#9568)
  Display.io Bid Adapter: ad request parameters renaming, user session saving (prebid#9553)
  CORE:  add bid to winningBids when marking as used (prebid#9612)
  Concert Bid Adapter: enable support for GPP consent and remove user sync (prebid#9700)
  Sonobi Bid Adapter: add IntentIq Id (prebid#9649)
  added fix and support for multibid module (prebid#9602)
  Update Permutive RTD documentation (prebid#9697)
  Adkernel Bid Adapter: add adlive.io alias (prebid#9714)
  FPD Enrichment: use low entropy method by default to fetch user agent data (prebid#9711)
  GumGum Bid Adapter : send gpp data in bidrequest (prebid#9707)
  Adagio Bid Adapter : add new params `splitKeyword` and `dl` to bidRequest payload (prebid#9694)
  fix lint and test failures
  Increment version to 7.43.0-pre
  Prebid 7.42.0 release
  Fluct Bid Adapter: add user sync support (prebid#9651)
  VIS.X fix onTimeout data (prebid#9657)
  ShowHeroes Bid Adapter: added support for USP (prebid#9681)
  Core: improve FPD enrichment (prebid#9659)
  changed the URL (prebid#9698)
  Permutive RTD Module: migrate appnexus to ortb2 (prebid#9630)
  Disable describe.only and it.only (prebid#9693)
  DistroScale bidder enhancement (prebid#9641)
  minutemediaplus Bid Adapter - pass gpp, sua and bid data to server. (prebid#9637)
  LiveIntent UserId module: update LiveConnect dependency (prebid#9672)
  Criteo Bid Adapter: reinforce adomain type in case of missmatch (prebid#9687)
  SmartyTech Bid Adapter : add size parameters (prebid#9692)
  Revert "Nativo Bid Adapter: adding UserId support (prebid#9583)" (prebid#9691)
  GDPR consent management: accept static config without `getTCData` (prebid#9664)
  Kulturemedia Bid Adapter: New Adapter (prebid#9613)
  Nativo Bid Adapter: adding UserId support (prebid#9583)
  Underdog Media Bid Adapter: Switch request to method to POST (prebid#9547)
  ZetaGlobalSsp: provide schain (prebid#9678)
  Next Millennium Bid Adapter : added `imp[].id` required parameter for openrtb 2.5 request. (prebid#9675)
  Increment version to 7.42.0-pre
  Prebid 7.41.0 release
  DFP video adserver module: set `description_url` to pub's URL by default; do not skip setting it if `cache.url` is set (prebid#9665)
  support the timeout parameter in the conversant adapter (prebid#9673)
  Browsi Bid Adapter: initial release (prebid#9562)
  feat(permutiveRtd): add `ix` and custom cohort `ortb2.user.data` (prebid#9631)
  Freewheel SSP Adapter: add prebid version in ad request (prebid#9667)
  Yandex Bid Adapter: (prebid#9604)
  Bump webpack from 5.74.0 to 5.76.0 (prebid#9668)
  Deleted the default empty string from  userConsent argument in the module's  init-function. (prebid#9663)
  AdUp Technology bid adapter: avoid modification of bid request (prebid#9656)
  NoBid Bid Adapter: support for Floors (prebid#9635)
  Freewheel SSP Bid Adapter : support userIdAsEids (prebid#9655)
  Missena: add userEids, add network and cpm to tracking (prebid#9645)
  IX Bid Adapter: update additional consent field (prebid#9650)
  Aduptech Bid Adapter : add GVLID (prebid#9658)
  Core: make video cache timeout configurable (prebid#9578)
  Delete flocIdSystem.js (prebid#9652)
  TheMediaGrid Bid Adapter : support gpp (prebid#9629)
  Stv Bid Adapter : initial adapter release (prebid#9533)
  CleanMediaNet Bid Adapter : add userid support and update testing (prebid#9608)
  Update creative.html (prebid#9648)
  PubWise Bid Adapter: support video and improve tests (prebid#9576)
  Increment version to 7.41.0-pre
  Prebid 7.40.0 release
  Rubicon Bid Adapter: add size 1x2 (prebid#9644)
  main>modules\neuwoRtdProvider.js > apiUrl format handling improved, removed unnecessary parameter integrationExamples\gpt\neuwoRtdProvider_example.html > fixed render-step handling on warning (prebid#9646)
  Core: fix native render when adUnits defines `mediaTypes.native.ortb` but adapter replies with "legacy" native bid (prebid#9638)
  kueezRtb Bid Adapter: pass sua data to server. (prebid#9643)
  update Mediago & Discovery BidAdapter:remove size filter (prebid#9585)
  Permutive RTD Module: migrate magnite to ortb2 (prebid#9555)
  Vidazoo Bid Adapter: pass sua params. (prebid#9636)
  ADJS-1271-send-envelope-param-for-lexicon (prebid#9634)
  Nexx360 Bid Adapter: native support added and ortbConverter usage (prebid#9626)
  PBjs Core: do not rely on an extendable `window.Promise` (prebid#9558)
  TheMediaGrid Bid Adapters : do not use jwp segments from bid.rtd field (prebid#9627)
  read video size from playerSize (prebid#9625)
  Lemma Digital Bid Adapter : initial adapter release (prebid#9532)
  smallfix on response validation (prebid#9623)
  Updated adf adapter to support native with type; use ortb request for natives (prebid#9616)
  kargo adapter - adding prebid version to requests (prebid#9620)
  Rubicon bid adapter: remove pchain support (prebid#9621)
  trigger build
  revert
  tag out markWinningBidAsUsed entirely
  remove unnecessary feature tag
  tag out ORTB video conversion utils
  tag out video-related code in native.js
  tag out video-related code in renderAd
  replace callPrebidCache with getHook result
  tag out adpod-related logic
  Define "VIDEO" compile time feature flag
  • Loading branch information
mscottnelson committed Mar 30, 2023
2 parents fb72f24 + 78c1dd3 commit 8d38aee
Show file tree
Hide file tree
Showing 171 changed files with 12,361 additions and 4,626 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
'import'
],
globals: {
'$$PREBID_GLOBAL$$': false,
'BROWSERSTACK_USERNAME': false,
'BROWSERSTACK_KEY': false,
'FEATURES': 'readonly',
Expand Down
3 changes: 2 additions & 1 deletion features.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
"NATIVE"
"NATIVE",
"VIDEO"
]
129 changes: 129 additions & 0 deletions integrationExamples/gpt/lemma_sample.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html>

<head>
<meta name='viewport'
content='width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1'>
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}

#lemmaAd {
height: 100% !important;
max-height: 100%;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
resize: vertical;
margin: 0 auto;
position: relative;
object-fit: fill;
}
</style>
<script>
var PREBID_TIMEOUT = 3300;

var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];

var bannerAdUnits = [{
code: 'banner-div',
mediaTypes: {
banner: {
sizes: [
[728, 90]
]
}
},
bids: [{
bidder: 'lemmadigital',
params: {
pubId: 975, // required
adunitId: '20134', // required
device_type: 2,
}
}]
}];
var videoAdUnits = [{
code: 'video1',
sizes: [
[1920, 1080]
],
mediaTypes: {
video: {
playerSize: [1920, 1080], // required
context: 'instream'
}
},
// Replace this object to test a new Adapter!
bids: [{
bidder: 'lemmadigital',
params: {
pubId: 975, // required
adunitId: '20134', // required
latitude: 34.9578,
longitude: -85.3012,
device_type: 3,
ifa: "ae59889b-d5bb-444b-892b-57057463d584",
video: {
minduration: 3,
maxduration: 300,
protocols: [
2,
3,
5,
6,
7,
8
],
skippable: true,
playback_method: ['auto_play_sound_off'],
mimes: ['video/x-flv',
"video/mp4",
"video/mpeg",
"video/ogg",
"video/webm",
"application/javascript"], // required
}
}
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
</script>
<script async src="../../build/dev/prebid.js"></script>
<script>
pbjs.que.push(function () {
pbjs.setConfig({
debug: true
});
pbjs.addAdUnits(videoAdUnits);
pbjs.requestBids({
timeout: PREBID_TIMEOUT,
bidsBackHandler: function (bids) {
var highestCpmBids = pbjs.getHighestCpmBids('banner-div');
if (highestCpmBids.length) {
var doc = document.getElementById('banner-div');
pbjs.renderAd(doc.contentWindow.document, highestCpmBids[0].adId);
}
}
});
});

</script>
</head>

<body>
<div id='lemmaAd'>
<div id="banner-div"></div>
<iframe id='video1' frameBorder="0"></iframe>
</div>
</body>

</html>
7 changes: 4 additions & 3 deletions integrationExamples/gpt/neuwoRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<script src="../../build/dev/prebid.js" async type="text/javascript"></script>
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var helper = document.getElementById('need-help');
if (helper) helper.style.display = location.href !== 'http://localhost:9999/integrationExamples/gpt/neuwoRtdProvider_example.html' ? 'block' : 'none';

/* adapted from https://docs.prebid.org/dev-docs/examples/basic-example.html */
var div_1_sizes = [
[300, 250],
Expand Down Expand Up @@ -197,4 +194,8 @@ <h5>Div-2</h5>
</div>

</body>
<script type="text/javascript">
var helper = document.getElementById('need-help');
if (helper) helper.style.display = location.href !== 'http://localhost:9999/integrationExamples/gpt/neuwoRtdProvider_example.html' ? 'block' : 'none';
</script>
</html>
2 changes: 1 addition & 1 deletion integrationExamples/gpt/x-domain/creative.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
// this script can be returned by an ad server delivering a cross domain iframe, into which the
// creative will be rendered, e.g. DFP delivering a SafeFrame
// creative will be rendered, e.g. GAM delivering a SafeFrame

const windowLocation = window.location;
const urlParser = document.createElement('a');
Expand Down
5 changes: 3 additions & 2 deletions libraries/ortbConverter/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ export function ortbConverter({
req: Object.assign({bidRequests}, defaultContext, context),
imp: {}
}
ctx.req.impContext = ctx.imp;
const imps = bidRequests.map(bidRequest => {
const impContext = Object.assign({bidderRequest, reqContext: ctx.req}, defaultContext, context);
const result = buildImp(bidRequest, impContext);
if (result != null) {
if (result.hasOwnProperty('id')) {
impContext.bidRequest = bidRequest;
Object.assign(impContext, {bidRequest, imp: result});
ctx.imp[result.id] = impContext;
return result;
}
Expand All @@ -116,7 +117,7 @@ export function ortbConverter({
throw new Error('ortbRequest passed to `fromORTB` must be the same object returned by `toORTB`')
}
function augmentContext(ctx, extraParams = {}) {
return Object.assign({ortbRequest: request}, extraParams, ctx);
return Object.assign(ctx, {ortbRequest: request}, extraParams, ctx);
}
const impsById = Object.fromEntries((request.imp || []).map(imp => [imp.id, imp]));
const bidResponses = (response.seatbid || []).flatMap(seatbid =>
Expand Down
51 changes: 12 additions & 39 deletions libraries/ortbConverter/processors/default.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {deepSetValue, logWarn, mergeDeep} from '../../../src/utils.js';
import {deepSetValue, mergeDeep} from '../../../src/utils.js';
import {bannerResponseProcessor, fillBannerImp} from './banner.js';
import {fillVideoImp, fillVideoResponse} from './video.js';
import {setResponseMediaType} from './mediaType.js';
import {fillNativeImp, fillNativeResponse} from './native.js';
import {BID_RESPONSE, IMP, REQUEST} from '../../../src/pbjsORTB.js';
import {config} from '../../../src/config.js';
import {clientSectionChecker} from '../../../src/fpd/oneClient.js';

export const DEFAULT_PROCESSORS = {
[REQUEST]: {
Expand All @@ -15,14 +15,10 @@ export const DEFAULT_PROCESSORS = {
mergeDeep(ortbRequest, bidderRequest.ortb2)
}
},
// override FPD app, site, and device with getConfig('app'), etc if defined
// TODO: these should be deprecated for v8
appFpd: fpdFromTopLevelConfig('app'),
siteFpd: fpdFromTopLevelConfig('site'),
deviceFpd: fpdFromTopLevelConfig('device'),
onlyOneClient: {
// make sure only one of 'dooh', 'app', 'site' is set in request
priority: -99,
fn: onlyOneClientSection
fn: clientSectionChecker('ORTB request')
},
props: {
// sets request properties id, tmax, test, source.tid
Expand Down Expand Up @@ -57,10 +53,6 @@ export const DEFAULT_PROCESSORS = {
// populates imp.banner
fn: fillBannerImp
},
video: {
// populates imp.video
fn: fillVideoImp
},
pbadslot: {
// removes imp.ext.data.pbaslot if it's not a string
// TODO: is this needed?
Expand All @@ -82,10 +74,6 @@ export const DEFAULT_PROCESSORS = {
// sets banner response attributes if bidResponse.mediaType === BANNER
fn: bannerResponseProcessor(),
},
video: {
// sets video response attributes if bidResponse.mediaType === VIDEO
fn: fillVideoResponse
},
props: {
// sets base bidResponse properties common to all types of bids
fn(bidResponse, bid, context) {
Expand Down Expand Up @@ -126,28 +114,13 @@ if (FEATURES.NATIVE) {
}
}

function fpdFromTopLevelConfig(prop) {
return {
priority: 90, // after FPD from 'ortb2', before the rest
fn(ortbRequest) {
const data = config.getConfig(prop);
if (typeof data === 'object') {
ortbRequest[prop] = mergeDeep({}, ortbRequest[prop], data);
}
}
if (FEATURES.VIDEO) {
DEFAULT_PROCESSORS[IMP].video = {
// populates imp.video
fn: fillVideoImp
}
DEFAULT_PROCESSORS[BID_RESPONSE].video = {
// sets video response attributes if bidResponse.mediaType === VIDEO
fn: fillVideoResponse
}
}

export function onlyOneClientSection(ortbRequest) {
['dooh', 'app', 'site'].reduce((found, section) => {
if (ortbRequest[section] != null && Object.keys(ortbRequest[section]).length > 0) {
if (found != null) {
logWarn(`ORTB request specifies both '${found}' and '${section}'; dropping the latter.`)
delete ortbRequest[section];
} else {
found = section;
}
}
return found;
}, null);
}
41 changes: 41 additions & 0 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
logInfo,
logWarn,
mergeDeep,
isStr,
} from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
Expand Down Expand Up @@ -924,6 +925,46 @@ export const spec = {
adunit_position: getSlotPosition(bidRequest.params.adUnitElementId) // adUnitElementId à déplacer ???
};

// Force the Split Keyword to be a String
if (bidRequest.params.splitKeyword) {
if (isStr(bidRequest.params.splitKeyword) || isNumber(bidRequest.params.splitKeyword)) {
bidRequest.params.splitKeyword = bidRequest.params.splitKeyword.toString();
} else {
delete bidRequest.params.splitKeyword;

logWarn(LOG_PREFIX, 'The splitKeyword param have been removed because the type is invalid, accepted type: number or string.');
}
}

// Force the Data Layer key and value to be a String
if (bidRequest.params.dataLayer) {
if (isStr(bidRequest.params.dataLayer) || isNumber(bidRequest.params.dataLayer) || isArray(bidRequest.params.dataLayer) || isFn(bidRequest.params.dataLayer)) {
logWarn(LOG_PREFIX, 'The dataLayer param is invalid, only object is accepted as a type.');
delete bidRequest.params.dataLayer;
} else {
let invalidDlParam = false;

bidRequest.params.dl = bidRequest.params.dataLayer
// Remove the dataLayer from the BidRequest to send the `dl` instead of the `dataLayer`
delete bidRequest.params.dataLayer

Object.keys(bidRequest.params.dl).forEach((key) => {
if (bidRequest.params.dl[key]) {
if (isStr(bidRequest.params.dl[key]) || isNumber(bidRequest.params.dl[key])) {
bidRequest.params.dl[key] = bidRequest.params.dl[key].toString();
} else {
invalidDlParam = true;
delete bidRequest.params.dl[key];
}
}
});

if (invalidDlParam) {
logWarn(LOG_PREFIX, 'Some parameters of the dataLayer property have been removed because the type is invalid, accepted type: number or string.');
}
}
}

Object.keys(features).forEach((prop) => {
if (features[prop] === '') {
delete features[prop];
Expand Down
6 changes: 6 additions & 0 deletions modules/adagioBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Below, the list of Adagio params and where they can be set.
| debug | | x |
| video | | x |
| native | | x |
| splitKeyword | | x |
| dataLayer | | x |

_* These params are deprecated in favor the Global configuration setup, see below._

Expand Down Expand Up @@ -115,6 +117,10 @@ var adUnits = [
context: 1,
plcmttype: 2
},
splitKeyword: 'splitrule-one',
dl: {
placement: '1234'
}
}
}]
}
Expand Down
3 changes: 2 additions & 1 deletion modules/addefendBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {getGlobal} from '../src/prebidGlobal.js';

const BIDDER_CODE = 'addefend';

Expand All @@ -16,7 +17,7 @@ export const spec = {
},
buildRequests: function(validBidRequests, bidderRequest) {
let bid = {
v: $$PREBID_GLOBAL$$.version,
v: getGlobal().version,
auctionId: false,
pageId: false,
gdpr_applies: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? bidderRequest.gdprConsent.gdprApplies : 'true',
Expand Down
Loading

0 comments on commit 8d38aee

Please sign in to comment.