-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Weborama RTD Module : start Bidder specific handling removal #10005
Changes from all commits
9d5c3fa
3ec983c
1b7d4f1
6e4fb8c
9ae1cb0
94100e1
a457dc6
e2c5747
919540a
3959260
db1fc08
5875c40
4905c89
379a975
b0f2a51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -689,19 +689,8 @@ class WeboramaRtdProvider { | |
/** @type {string} */ | ||
const bidder = bidderAliasRegistry[bid.bidder] || bid.bidder; | ||
|
||
switch (bidder) { | ||
case 'appnexus': | ||
this.#handleAppnexusBid(bid, profile); | ||
break; | ||
case 'pubmatic': | ||
this.#handlePubmaticBid(bid, profile); | ||
break; | ||
case 'smartadserver': | ||
this.#handleSmartadserverBid(bid, profile); | ||
break; | ||
case 'rubicon': | ||
this.#handleRubiconBid(bid, profile, metadata); | ||
break; | ||
if (bidder == 'appnexus') { | ||
this.#handleAppnexusBid(reqBidsConfigObj, bid, profile); | ||
} | ||
} | ||
|
||
|
@@ -719,92 +708,19 @@ class WeboramaRtdProvider { | |
/** handle appnexus/xandr bid | ||
* @method | ||
* @private | ||
* @param {Object} reqBidsConfigObj | ||
* @param {Object} reqBidsConfigObj.ortb2Fragments | ||
* @param {Object} reqBidsConfigObj.ortb2Fragments.bidder | ||
* @param {Object} bid | ||
* @param {Object} bid.params | ||
* @param {Object} bid.params.keyword | ||
* @param {Object} bid.parameters | ||
* @param {Profile} profile | ||
* @returns {void} | ||
*/ | ||
// eslint-disable-next-line no-dupe-class-members | ||
#handleAppnexusBid(bid, profile) { | ||
#handleAppnexusBid(reqBidsConfigObj, bid, profile) { | ||
const base = 'params.keywords'; | ||
this.#assignProfileToObject(bid, base, profile); | ||
} | ||
|
||
/** handle pubmatic bid | ||
* @method | ||
* @private | ||
* @param {Object} bid | ||
* @param {Object} bid.params | ||
* @param {string} bid.params.dctr | ||
* @param {Profile} profile | ||
* @returns {void} | ||
*/ | ||
// eslint-disable-next-line no-dupe-class-members | ||
#handlePubmaticBid(bid, profile) { | ||
const sep = '|'; | ||
const subsep = ','; | ||
|
||
bid.params ||= {}; | ||
|
||
const data = bid.params.dctr || ''; | ||
const target = new Set(data.split(sep).filter((x) => x.length > 0)); | ||
|
||
Object.entries(profile).forEach(([key, values]) => { | ||
const value = values.join(subsep); | ||
const keyword = `${key}=${value}`; | ||
target.add(keyword); | ||
}); | ||
|
||
bid.params.dctr = Array.from(target).join(sep); | ||
} | ||
|
||
/** handle smartadserver bid | ||
* @method | ||
* @private | ||
* @param {Object} bid | ||
* @param {Object} bid.params | ||
* @param {string} bid.params.target | ||
* @param {Profile} profile | ||
* @returns {void} | ||
*/ | ||
// eslint-disable-next-line no-dupe-class-members | ||
#handleSmartadserverBid(bid, profile) { | ||
const sep = ';'; | ||
|
||
bid.params ||= {}; | ||
|
||
const data = bid.params.target || ''; | ||
const target = new Set(data.split(sep).filter((x) => x.length > 0)); | ||
|
||
Object.entries(profile).forEach(([key, values]) => { | ||
values.forEach(value => { | ||
const keyword = `${key}=${value}`; | ||
target.add(keyword); | ||
}) | ||
}); | ||
|
||
bid.params.target = Array.from(target).join(sep); | ||
} | ||
|
||
/** handle rubicon bid | ||
* @method | ||
* @private | ||
* @param {Object} bid | ||
* @param {string} bid.bidder | ||
* @param {Profile} profile | ||
* @param {dataCallbackMetadata} metadata | ||
* @returns {void} | ||
*/ | ||
// eslint-disable-next-line no-dupe-class-members | ||
#handleRubiconBid(bid, profile, metadata) { | ||
if (isBoolean(metadata.user)) { | ||
const section = metadata.user ? 'visitor' : 'inventory'; | ||
const base = `params.${section}`; | ||
this.#assignProfileToObject(bid, base, profile); | ||
} else { | ||
logMessage(`SKIP bidder '${bid.bidder}', data from '${metadata.source}' is not defined as user or site-centric`); | ||
} | ||
// this.#setBidderOrtb2(reqBidsConfigObj.ortb2Fragments?.bidder, bid.bidder, base, profile); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just to clarify for appnexus - we can read data from the various ortb2 keyword fields (we'll pass the data into our existing keywords fields), but we can't read from the segment related ortb data fields at this time. I have checked with our product team and there's no current home for all of the related ortb segment fields of data in our current endpoint (note - there is some ongoing discussions on this topic, so there might be different news at some point down the road). I hope this helps clarify what type of code you could change or leave in place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hey, I try to handle it better in the last next two commits There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@astephensxandr if this is indeed true for the foreseeable future, Microsoft should expect disruption in its ongoing compatibility with RTD modules. Are you saying you guys are comfortable with this? The current situation is in order to avoid a small amount of work by microsoft -- specifically figuring out some translation of fields in user.ext.data into your keywords object -- you are pushing quite difficult work onto many of your partners, not all of which have been able to achieve it. |
||
} | ||
|
||
/** handle generic bid via ortb2 arbitrary data | ||
|
@@ -823,14 +739,28 @@ class WeboramaRtdProvider { | |
if (isBoolean(metadata.user)) { | ||
logMessage(`bidder '${bidder}' is not directly supported, trying set data via bidder ortb2 fpd`); | ||
const section = metadata.user ? 'user' : 'site'; | ||
const base = `${bidder}.${section}.ext.data`; | ||
const path = `${section}.ext.data`; | ||
|
||
this.#assignProfileToObject(reqBidsConfigObj.ortb2Fragments?.bidder, base, profile); | ||
this.#setBidderOrtb2(reqBidsConfigObj.ortb2Fragments?.bidder, bidder, path, profile) | ||
} else { | ||
logMessage(`SKIP unsupported bidder '${bidder}', data from '${metadata.source}' is not defined as user or site-centric`); | ||
} | ||
} | ||
|
||
/** | ||
* set bidder ortb2 data | ||
* @method | ||
* @private | ||
* @param {Object} bidderOrtb2Fragments | ||
* @param {string} bidder | ||
* @param {string} path | ||
* @param {Profile} profile | ||
* @returns {void} | ||
*/ | ||
// eslint-disable-next-line no-dupe-class-members | ||
#setBidderOrtb2(bidderOrtb2Fragments, bidder, path, profile) { | ||
const base = `${bidder}.${path}`; | ||
this.#assignProfileToObject(bidderOrtb2Fragments, base, profile) | ||
} | ||
/** | ||
* assign profile to object | ||
* @method | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you prefer to remove this line, move the handling into the appnexus adapter, or just not be in 8 until this is resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peczenyj update here! Appnexus pr should make this much easier, we're delaying prebid 8 to accommodate