Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFG-2579: prebid update to latest 8.30.0 #169

Merged
merged 56 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7f815d2
Increment version to 8.28.0-pre
prebidjs-release Dec 7, 2023
32ff256
Support UID 2.0 pgamssp module (#10771)
PGAMSSP Dec 7, 2023
b47a38b
ADSS-1756-pass-gpid-to-video-requests (#10809)
john-ivan Dec 8, 2023
260269d
Browsi RTD : fix for targeting (#10814)
omerDotan Dec 11, 2023
2493f98
nextMillennium Bid Adapter : add pbjs version and support for user.ei…
mhlm Dec 11, 2023
eecdc2e
Update deepintentBidAdapter.js (#10818)
patmmccann Dec 11, 2023
222b442
GC-158 When accessing the TCF it is pulling from the wrong location, …
southern-growthcode Dec 11, 2023
3ec81e6
Adagio Analytics Adapter: listen to AUCTION_END (#10798)
osazos Dec 11, 2023
6275c00
PubMaticAnalyticAdapter : Added new fields related to floors (fetch s…
kapil-tuptewar Dec 11, 2023
048f735
Pubmatic Analytics Adapter : skip duplicate data for pubmatic bids in…
pm-priyanka-deshmane Dec 12, 2023
947a487
support ad unit name (#10825)
gwi-mmuths Dec 12, 2023
5dbbf1b
PBjs Core : new event fired before add bid response (#10685)
matthieularere-msq Dec 12, 2023
85817e7
Revert "Pubmatic Analytics Adapter : skip duplicate data for pubmatic…
patmmccann Dec 12, 2023
fd35856
Revert "support ad unit name (#10825)" (#10831)
ChrisHuie Dec 12, 2023
1c4bc7a
Invibes Bid Adapter : infinite scroll tcf (#10764)
gabrielIvbs Dec 12, 2023
2e07896
Mediago Bid Adapter : switch domain name (#10833)
BaronJHYu Dec 13, 2023
75cb166
Bizzclick Bid Adapter : update adapter, used ortbConverter lib (#10828)
BizzClick Dec 13, 2023
dc530cf
PubMatic Bid Adapter : passing a unique wiid to pubmatic ssp and logg…
pm-azhar-mulla Dec 13, 2023
a631892
Criteo Bid Adapter: Add support for app.publisher.id in bid request (…
vraybaud Dec 14, 2023
3e57af3
providing visibility in case of adapter timeout and bidError (#10807)
barRubi Dec 14, 2023
f58a0a3
Prebid 8.28.0 release
prebidjs-release Dec 14, 2023
2732783
Increment version to 8.29.0-pre
prebidjs-release Dec 14, 2023
5292b63
Adding support for video.plcmt (#10841)
desidiver Dec 15, 2023
a90d6c8
Bump github/codeql-action from 2 to 3 (#10856)
dependabot[bot] Dec 18, 2023
5f8ff5f
HadronId Module: implementing user consent in backend calls (#10845)
jlaso Dec 18, 2023
9a0f012
Eids Docs : add missing EID examples (#10844)
3link Dec 18, 2023
332a7d2
Admixer Bid Adaper: add admixerwl alias (#10859)
AdmixerTech Dec 19, 2023
cd787eb
AdagioAnalyticsAdapter: fix function param check (#10860)
osazos Dec 19, 2023
0b59d4d
NoBid Analytics Adapter: support for counting blocked requests for th…
redaguermas Dec 20, 2023
a5c2e06
consentManagementGpp: fix handling of CMP errors (#10811)
dgirardi Dec 20, 2023
104f53f
Taboola Bid Adapter: implement Iframe user sync (#10789)
ahmadlob Dec 20, 2023
2548949
AMX bid adapter: fix timeout handler, bump version (#10744)
nickjacob Dec 20, 2023
2b8aacb
Ucfunnel Bid Adapter: add format support (#10862)
jackhsiehucf Dec 20, 2023
3c632ca
R2B2 Bid Adapter: Initial release (#10702)
alexalukr2b2 Dec 21, 2023
f5e1988
Core: fix headers in ortbConverter readme (#10874)
someden Dec 27, 2023
c6b45c4
SparteoBidAdapter: Add UserSync (#10822)
geoffray-viously Dec 27, 2023
f625c1e
Yandex Bid Adapter: Add rtt (roud trip time) tracking via nurl (#10846)
korobkov-k Dec 27, 2023
ed48e34
AdMatic Bid Adapter : consent management features added (#10813)
fatihkaya84 Dec 27, 2023
9ec2092
Taboola Bid Adapter: Cookie Look Up Logic Fix (#10873)
ahmadlob Dec 27, 2023
984abfa
ZetaGlobalSsp Bid Adapter : support topics module (#10803)
asurovenko-zeta Dec 27, 2023
325cd3c
Adnuntius Bid Adapter: bugfix for storageFunction (#10869)
mikael-lundin Dec 28, 2023
bdbbf09
Prebid 8.29.0 release
prebidjs-release Dec 28, 2023
46784ab
Increment version to 8.30.0-pre
prebidjs-release Dec 28, 2023
cc49968
Yandex Bid Adapter: add support for topicsFpdModule (#10875)
someden Dec 31, 2023
ff27673
Yandex Bid Adapter: add jsdoc (#10884)
someden Dec 31, 2023
233695d
DxKulture Bid Adapter : user syncs improvements (#10738)
bev-devops Jan 2, 2024
04a7659
Mygaru Id System: Initial release (#10848)
GeneGenie Jan 2, 2024
ed05478
Update viantOrtbBidAdapter_spec.js (#10888)
tkrishnaviant Jan 3, 2024
665c894
Stv Bid Adapter: added user id support, adaptation of schain support …
theo-stv Jan 3, 2024
185e97f
Missena Bid Adapter: allow per page capping (#10863)
pdamoc Jan 3, 2024
49904a0
LiveIntent ID Module: Update live-connect version (#10894)
wi101 Jan 3, 2024
136f0bb
Do not require API for video requests (#10895)
robertrmartinez Jan 3, 2024
7a09d81
Price Floors: Failure to Account for 'data.skipRate' (#10872)
bbaresic Jan 4, 2024
aa21bfd
Prebid 8.30.0 release
prebidjs-release Jan 4, 2024
d5d1fd1
Merge tag 'tags/8.30.0' into PFG-2579-prebid-update-to-latest-8-29-0
yagovelazquezfreestar Jan 10, 2024
970bba6
add prebid analyticsS
yagovelazquezfreestar Jan 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
9 changes: 4 additions & 5 deletions libraries/ortbConverter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ However, there are two restrictions (to avoid them, use the [other customization
)
```

<a id="fine-customization" />
### Fine grained customization - imp, request, bidResponse, response
### <a id="fine-customization" /> Fine grained customization - imp, request, bidResponse, response

When invoked, `toORTB({bidRequests, bidderRequest})` first loops through each request in `bidRequests`, converting them into ORTB `imp` objects.
It then packages them into a single ORTB request, adding other parameters that are not imp-specific (such as for example `request.tmax`).
Expand All @@ -91,7 +90,7 @@ a single return value.

You can customize each of these steps using the `ortbConverter` arguments `imp`, `request`, `bidResponse` and `response`:

### <a id="imp" />Customizing imps: `imp(buildImp, bidRequest, context)`
### <a id="imp" /> Customizing imps: `imp(buildImp, bidRequest, context)`

Invoked once for each input `bidRequest`; should return the ORTB `imp` object to include in the request.
The arguments are:
Expand All @@ -101,7 +100,7 @@ The arguments are:
- `context`: a [context object](#context) that contains at least:
- `bidderRequest`: the `bidderRequest` argument passed to `toORTB`.

#### <a id="params" />Example: attaching custom bid params
#### <a id="params" /> Example: attaching custom bid params

```javascript
const converter = ortbConverter({
Expand Down Expand Up @@ -351,7 +350,7 @@ const converter = ortbConverter({
- the `context` argument of `ortbConverter`: e.g. `ortbConverter({context: {ttl: 30}})`. This will set `context.ttl = 30` globally for the converter.
- the `context` argument of `toORTB`: e.g. `converter.toORTB({bidRequests, bidderRequest, context: {ttl: 30}})`. This will set `context.ttl = 30` only for this request.

### <a id="special-context"/> Special `context` properties
### <a id="special-context" /> Special `context` properties

For ease of use, the conversion logic gives special meaning to some context properties:

Expand Down
3 changes: 2 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"adqueryIdSystem",
"gravitoIdSystem",
"freepassIdSystem",
"operaadsIdSystem"
"operaadsIdSystem",
"mygaruIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
Expand Down
62 changes: 56 additions & 6 deletions modules/adagioAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const cache = {
getAuction: function(auctionId, adUnitCode) {
return this.auctions[auctionId][adUnitCode];
},
getBiddersFromAuction: function(auctionId, adUnitCode) {
return this.getAuction(auctionId, adUnitCode).bdrs.split(',');
},
getAllAdUnitCodes: function(auctionId) {
return Object.keys(this.auctions[auctionId]);
},
updateAuction: function(auctionId, adUnitCode, values) {
this.auctions[auctionId][adUnitCode] = {
...this.auctions[auctionId][adUnitCode],
Expand Down Expand Up @@ -74,7 +80,8 @@ const adagioEnqueue = function adagioEnqueue(action, data) {

const guard = {
adagio: (value) => isAdagio(value),
bidTracked: (auctionId, adUnitCode) => deepAccess(cache, `auctions.${auctionId}.${adUnitCode}`, false)
bidTracked: (auctionId, adUnitCode) => deepAccess(cache, `auctions.${auctionId}.${adUnitCode}`, false),
auctionTracked: (auctionId) => deepAccess(cache, `auctions.${auctionId}`, false)
};

function removeDuplicates(arr, getKey) {
Expand All @@ -90,6 +97,10 @@ function getAdapterNameForAlias(aliasName) {
};

function isAdagio(value) {
if (!value) {
return false
}

return value.toLowerCase().includes('adagio') ||
getAdapterNameForAlias(value).toLowerCase().includes('adagio');
};
Expand All @@ -105,6 +116,19 @@ function getMediaTypeAlias(mediaType) {
return mediaTypesMap[mediaType] || mediaType;
};

function addKeyPrefix(obj, prefix) {
return Object.keys(obj).reduce((acc, key) => {
// We don't want to prefix already prefixed keys.
if (key.startsWith(prefix)) {
acc[key] = obj[key];
return acc;
}

acc[`${prefix}${key}`] = obj[key];
return acc;
}, {});
}

/**
* sendRequest to Adagio. It filter null values and encode each query param.
* @param {Object} qp
Expand Down Expand Up @@ -146,6 +170,7 @@ function getTargetedAuctionId(bid) {
* HANDLERS
* - handlerAuctionInit
* - handlerBidResponse
* - handlerAuctionEnd
* - handlerBidWon
* - handlerAdRender
*
Expand Down Expand Up @@ -227,11 +252,10 @@ function handlerAuctionInit(event) {
auct_id: adagioAuctionId,
adu_code: adUnitCode,
url_dmn: w.location.hostname,
dvc: params.environment,
pgtyp: params.pagetype,
plcmt: params.placement,
tname: params.testName || null,
tvname: params.testVariationName || null,
t_n: params.testName || null,
t_v: params.testVersion || null,
mts: mediaTypesKeys.join(','),
ban_szs: bannerSizes.join(','),
bdrs: bidders.map(bidder => getAdapterNameForAlias(bidder.bidder)).sort().join(','),
Expand All @@ -257,11 +281,33 @@ function handlerBidResponse(event) {
return;
}

if (!event.pba) {
return;
}

cache.updateAuction(event.auctionId, event.adUnitCode, {
adg_sid: event.seatId || null
...addKeyPrefix(event.pba, 'e_')
});
};

function handlerAuctionEnd(event) {
const { auctionId } = event;

if (!guard.auctionTracked(auctionId)) {
return;
}

const adUnitCodes = cache.getAllAdUnitCodes(auctionId);
adUnitCodes.forEach(adUnitCode => {
const mapper = (bidder) => event.bidsReceived.find(bid => bid.adUnitCode === adUnitCode && bid.bidder === bidder) ? '1' : '0';

cache.updateAuction(auctionId, adUnitCode, {
bdrs_bid: cache.getBiddersFromAuction(auctionId, adUnitCode).map(mapper).join(',')
});
sendNewBeacon(auctionId, adUnitCode);
});
}

function handlerBidWon(event) {
let auctionId = getTargetedAuctionId(event);

Expand Down Expand Up @@ -340,10 +386,14 @@ let adagioAdapter = Object.assign(adapter({ emptyUrl, analyticsType }), {
case CONSTANTS.EVENTS.BID_RESPONSE:
handlerBidResponse(args);
break;
case CONSTANTS.EVENTS.AUCTION_END:
handlerAuctionEnd(args);
break;
case CONSTANTS.EVENTS.BID_WON:
handlerBidWon(args);
break;
case CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED:
// AD_RENDER_SUCCEEDED seems redundant with BID_WON.
// case CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED:
case CONSTANTS.EVENTS.AD_RENDER_FAILED:
handlerAdRender(args, eventType === CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED);
break;
Expand Down
131 changes: 115 additions & 16 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getValue, logError, isEmpty, deepAccess, isArray, getBidIdParameter} from '../src/utils.js';
import {getValue, formatQS, logError, deepAccess, isArray, getBidIdParameter} from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
Expand Down Expand Up @@ -56,18 +56,16 @@ export const spec = {
* @return {ServerRequest}
*/
buildRequests: (validBidRequests, bidderRequest) => {
const tmax = bidderRequest.timeout;
const bids = validBidRequests.map(buildRequestObject);
const blacklist = bidderRequest.ortb2;
const ortb = bidderRequest.ortb2;
const networkId = getValue(validBidRequests[0].params, 'networkId');
const host = getValue(validBidRequests[0].params, 'host');
const currency = config.getConfig('currency.adServerCurrency') || 'TRY';
const bidderName = validBidRequests[0].bidder;

const payload = {
user: {
ua: navigator.userAgent
},
blacklist: [],
ortb,
site: {
page: bidderRequest.refererInfo.page,
ref: bidderRequest.refererInfo.page,
Expand All @@ -80,17 +78,59 @@ export const spec = {
ext: {
cur: currency,
bidder: bidderName
}
},
schain: {},
regs: {
ext: {
}
},
user: {
ext: {}
},
at: 1,
tmax: parseInt(tmax)
};

if (!isEmpty(blacklist.badv)) {
payload.blacklist = blacklist.badv;
};
if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
const consentStr = (bidderRequest.gdprConsent.consentString)
? bidderRequest.gdprConsent.consentString.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') : '';
const gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
payload.regs.ext.gdpr = gdpr;
payload.regs.ext.consent = consentStr;
}

if (bidderRequest && bidderRequest.coppa) {
payload.regs.ext.coppa = bidderRequest.coppa === true ? 1 : (bidderRequest.coppa === false ? 0 : undefined);
}

if (bidderRequest && bidderRequest.ortb2?.regs?.gpp) {
payload.regs.ext.gpp = bidderRequest.ortb2?.regs?.gpp;
}

if (bidderRequest && bidderRequest.ortb2?.regs?.gpp_sid) {
payload.regs.ext.gpp_sid = bidderRequest.ortb2?.regs?.gpp_sid;
}

if (bidderRequest && bidderRequest.uspConsent) {
payload.regs.ext.uspIab = bidderRequest.uspConsent;
}

if (validBidRequests[0].schain) {
const schain = mapSchain(validBidRequests[0].schain);
if (schain) {
payload.schain = schain;
}
}

if (validBidRequests[0].userIdAsEids) {
const eids = { eids: validBidRequests[0].userIdAsEids };
payload.user.ext = { ...payload.user.ext, ...eids };
}

if (payload) {
switch (bidderName) {
case 'pixad':
SYNC_URL = 'https://static.pixad.com.tr/sync.html';
SYNC_URL = 'https://static.cdn.pixad.com.tr/sync.html';
break;
default:
SYNC_URL = 'https://cdn.serve.admatic.com.tr/showad/sync.html';
Expand All @@ -101,12 +141,36 @@ export const spec = {
}
},

getUserSyncs: function (syncOptions, responses) {
if (syncOptions.iframeEnabled) {
return [{
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
if (!hasSynced && syncOptions.iframeEnabled) {
// data is only assigned if params are available to pass to syncEndpoint
let params = {};

if (gdprConsent) {
if (typeof gdprConsent.gdprApplies === 'boolean') {
params['gdpr'] = Number(gdprConsent.gdprApplies);
}
if (typeof gdprConsent.consentString === 'string') {
params['gdpr_consent'] = gdprConsent.consentString;
}
}

if (uspConsent) {
params['us_privacy'] = encodeURIComponent(uspConsent);
}

if (gppConsent?.gppString) {
params['gpp'] = gppConsent.gppString;
params['gpp_sid'] = gppConsent.applicableSections?.toString();
}

params = Object.keys(params).length ? `?${formatQS(params)}` : '';

hasSynced = true;
return {
type: 'iframe',
url: SYNC_URL
}];
url: SYNC_URL + params
};
}
},

Expand Down Expand Up @@ -156,6 +220,41 @@ export const spec = {
}
};

var hasSynced = false;

export function resetUserSync() {
hasSynced = false;
}

/**
* @param {object} schain object set by Publisher
* @returns {object} OpenRTB SupplyChain object
*/
function mapSchain(schain) {
if (!schain) {
return null;
}
if (!validateSchain(schain)) {
logError('AdMatic: required schain params missing');
return null;
}
return schain;
}

/**
* @param {object} schain object set by Publisher
* @returns {object} bool
*/
function validateSchain(schain) {
if (!schain.nodes) {
return false;
}
const requiredFields = ['asi', 'sid', 'hp'];
return schain.nodes.every(node => {
return requiredFields.every(field => node[field]);
});
}

function isUrl(str) {
try {
URL(str);
Expand Down
Loading
Loading