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

Conversant adapter: use ortbConverter to handle requests and responses #14

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
b154fc1
Adagio Bid Adapter: add GPID support (#10775)
osazos Nov 29, 2023
73fb8d3
Core: add option to turn off `Sec-Browsing-Topics` header (#10776)
dgirardi Nov 29, 2023
d70097e
Missena Bid Adapter: add capping support (#10746)
pdamoc Nov 30, 2023
7974ebc
Adnuntius Bid Adaptor: Handle voidAuIds from server response (#10646)
antosarho Nov 30, 2023
32748b4
TPMN Bid Adapter: remove OptionsObject (#10777)
tpmn-admin Nov 30, 2023
7dd09d8
GC-157 Boune request when the PID is missing (#10774)
southern-growthcode Nov 30, 2023
9c597a3
DynamicAdBoost Module : add to adloader list (#10752)
adxpremium Nov 30, 2023
a8fedc6
Generic analytics: fix spurious warning messages (#10739)
dgirardi Nov 30, 2023
5202784
Prebid 8.26.0 release
prebidjs-release Nov 30, 2023
ec42b13
Increment version to 8.27.0-pre
prebidjs-release Nov 30, 2023
2de3f87
Flipp Bid Adapter: update constant NETWORK_ID (#10781)
mike-lei Dec 1, 2023
16133c5
identityLinkIdSystem - liveramp - bug fix setting tcf consent string …
mamatic Dec 1, 2023
faec1bb
Add GVLID to vox adapter (#10784)
hybrid-ai Dec 1, 2023
fe2f35e
LiveIntent UserId module: Add support for sovrn id (#10783)
3link Dec 1, 2023
4f057b1
Unruly Bid Adapter : include Prebid.js version in request (#10773)
bhainesnexxen Dec 1, 2023
cbf1e15
MgidX Bid Adapter: refactor request.gdpr object generating (#10782)
xmgiddev Dec 2, 2023
7be0a10
NextMillennium Bid Adapter: support for GPP consent string, `site.pag…
mhlm Dec 4, 2023
4f3826a
Replace openx.com with openx.net (#10786)
3link Dec 4, 2023
27b57ab
Rise Bid Adapter : support currency (#10790)
YakirLavi Dec 5, 2023
645b562
MinuteMedia Bid Adapter : support currency (#10791)
YakirLavi Dec 5, 2023
55ba111
Core: Add eventString to error executing handler message (#10797)
pclinger Dec 5, 2023
f818b8f
Adagio Bid Adapter: remove useless adrequest fields (#10794)
osazos Dec 5, 2023
9a65d49
VIS.X: add response time tracking on bidWon event (#10772)
vfedoseev Dec 5, 2023
264efa7
ViantOrtb Bid Adapter : update endpoint url (#10801)
tkrishnaviant Dec 6, 2023
bf909ea
Teads Bid Adapter: add new window features to request (#10796)
github-saad-elmahfoudi Dec 6, 2023
0de4a09
Sparteo Bid Adapter : handle vastUrl for video context (#10805)
geoffray-viously Dec 7, 2023
864dc02
deal support added (#10802)
mustafakemal16 Dec 7, 2023
d0747e4
Mediago Bid Adapter : add cookieSync and gdpr (#10724)
BaronJHYu Dec 7, 2023
cb82c47
Sovrn Bid Adapter : send coppa signal (#10729)
ikagotso Dec 7, 2023
4fe6292
Adnuntius Bid Adapter : forces gdpr=1 flag if consent is required (#1…
mikael-lundin Dec 7, 2023
8ab882f
GeoEdge RTD module: collect CPM and curency from the winning bid (#10…
GeoEdge-r-and-d Dec 7, 2023
c6a13ca
userId: fix bug where pubProvidedId UIDs are duplicated (#10795)
dgirardi Dec 7, 2023
37b7e05
Prebid 8.27.0 release
prebidjs-release Dec 7, 2023
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)
kmdevops 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
714acd3
Increment version to 8.31.0-pre
prebidjs-release Jan 4, 2024
866be6e
1.Added safechecks for s2s metadapter case 2.Skipped firing client si…
kapil-tuptewar Jan 4, 2024
60e7e96
Discovery Bid Adapter: update buyerId, add ssppid & pmguid, add getUs…
ecoeco163 Jan 4, 2024
cdbe68c
ID5 User Id module - pass gpp string and sid in getId request (#10899)
abazylewicz-id5 Jan 5, 2024
7f2763d
Adnuntius Bid Adapter : bugfix void au ids (#10890)
antosarho Jan 5, 2024
3e6b546
GreenbidsAnalyticsAdapter and GreenbidsRtdProvider: Rework greenbids …
jbogp Jan 5, 2024
d390f6c
Core: add eslint-plugin-jsdoc (#10893)
someden Jan 6, 2024
759c52d
Pangle Bid Adapter : add multi format support (#10909)
pangle-fe Jan 8, 2024
2379853
Conversant adapter: use ortbConverter to handle requests and responses
Oct 27, 2023
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
35 changes: 33 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ module.exports = {
node: {
moduleDirectory: ['node_modules', './']
}
},
'jsdoc': {
mode: 'typescript',
tagNamePreference: {
'tag constructor': 'constructor',
extends: 'extends',
method: 'method',
return: 'return',
}
}
},
extends: 'standard',
extends: [
'standard',
'plugin:jsdoc/recommended'
],
plugins: [
'prebid',
'import'
'import',
'jsdoc'
],
globals: {
'BROWSERSTACK_USERNAME': false,
Expand Down Expand Up @@ -46,6 +59,24 @@ module.exports = {
'no-undef': 2,
'no-useless-escape': 'off',
'no-console': 'error',
'jsdoc/check-types': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-param-name': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/require-property-name': 'off',
'jsdoc/require-property-type': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-check': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-yields': 'off',
'jsdoc/require-yields-check': 'off',
'jsdoc/tag-lines': 'off'
},
overrides: Object.keys(allowedModules).map((key) => ({
files: key + '/**/*.js',
Expand Down
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
86 changes: 68 additions & 18 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 All @@ -42,7 +48,7 @@ const enc = window.encodeURIComponent;

/**
/* BEGIN ADAGIO.JS CODE
*/
*/

function canAccessTopWindow() {
try {
Expand All @@ -65,16 +71,17 @@ const adagioEnqueue = function adagioEnqueue(action, data) {
};

/**
* END ADAGIO.JS CODE
*/
* END ADAGIO.JS CODE
*/

/**
* UTILS FUNCTIONS
*/
* UTILS FUNCTIONS
*/

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,10 +116,23 @@ 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
*/
* sendRequest to Adagio. It filter null values and encode each query param.
* @param {Object} qp
*/
function sendRequest(qp) {
// Removing null values
qp = Object.keys(qp).reduce((acc, key) => {
Expand Down Expand Up @@ -140,17 +164,18 @@ function getTargetedAuctionId(bid) {

/**
* END UTILS FUNCTIONS
*/
*/

/**
* HANDLERS
* - handlerAuctionInit
* - handlerBidResponse
* - handlerAuctionEnd
* - handlerBidWon
* - handlerAdRender
*
* Each handler is called when the event is fired.
*/
*/

function handlerAuctionInit(event) {
const w = getCurrentWindow();
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 @@ -247,7 +271,7 @@ function handlerAuctionInit(event) {
* handlerBidResponse allow to track the adagio bid response
* and to update the auction cache with the seat ID.
* No beacon is sent here.
*/
*/
function handlerBidResponse(event) {
if (!guard.adagio(event.bidder)) {
return;
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 @@ -326,7 +372,7 @@ function handlerAdRender(event, isSuccess) {

/**
* END HANDLERS
*/
*/

let adagioAdapter = Object.assign(adapter({ emptyUrl, analyticsType }), {
track: function(event) {
Expand All @@ -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
Loading