-
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
PAAPI: parallel contextual and IG auctions #12205
Changes from all commits
92dc73d
bfa1b58
32b9ef7
3aec7ca
1a34b50
3aa2688
0fa2a2c
b9bff06
4c78354
79f2be1
d296a67
2ac56db
0ddc1a2
4fe1852
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 |
---|---|---|
|
@@ -52,6 +52,7 @@ | |
debug: true, | ||
paapi: { | ||
enabled: true, | ||
parallel: true, | ||
gpt: { | ||
autoconfig: false | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ | |
debug: true, | ||
paapi: { | ||
enabled: true, | ||
parallel: true, | ||
gpt: { | ||
autoconfig: false | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,17 +17,42 @@ const BIDDER_CODE = 'optable'; | |
const DEFAULT_REGION = 'ca' | ||
const DEFAULT_ORIGIN = 'https://ads.optable.co' | ||
|
||
function getOrigin() { | ||
return config.getConfig('optable.origin') ?? DEFAULT_ORIGIN; | ||
} | ||
|
||
function getBaseUrl() { | ||
const region = config.getConfig('optable.region') ?? DEFAULT_REGION; | ||
return `${getOrigin()}/${region}` | ||
} | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
isBidRequestValid: function(bid) { return !!bid.params?.site }, | ||
buildRequests: function(bidRequests, bidderRequest) { | ||
const region = config.getConfig('optable.region') ?? DEFAULT_REGION | ||
const origin = config.getConfig('optable.origin') ?? DEFAULT_ORIGIN | ||
const requestURL = `${origin}/${region}/ortb2/v1/ssp/bid` | ||
const requestURL = `${getBaseUrl()}/ortb2/v1/ssp/bid` | ||
const data = converter.toORTB({ bidRequests, bidderRequest, context: { mediaType: BANNER } }); | ||
|
||
return { method: 'POST', url: requestURL, data } | ||
}, | ||
buildPAAPIConfigs: function(bidRequests) { | ||
const origin = getOrigin(); | ||
return bidRequests | ||
.filter(req => req.ortb2Imp?.ext?.ae) | ||
.map(bid => ({ | ||
bidId: bid.bidId, | ||
config: { | ||
seller: origin, | ||
decisionLogicURL: `${getBaseUrl()}/paapi/v1/ssp/decision-logic.js?origin=${bid.params.site}`, | ||
interestGroupBuyers: [origin], | ||
perBuyerMultiBidLimits: { | ||
[origin]: 100 | ||
}, | ||
perBuyerCurrencies: { | ||
[origin]: 'USD' | ||
} | ||
} | ||
})) | ||
}, | ||
Comment on lines
+37
to
+55
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. @zapo this "freezes" part of the auction configs into the adapter, meaning that updates would need a code change to be deployed, to enable parallel (faster) IG auctions. I got the values by looking at what your endpoint returns - but I don't know if they're universal (and I don't know if your endpoint respects the
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. @dgirardi Looks good, yes they are universal for now. The endpoint does respect |
||
interpretResponse: function(response, request) { | ||
const bids = converter.fromORTB({ response: response.body, request: request.data }).bids | ||
const auctionConfigs = (response.body.ext?.optable?.fledge?.auctionconfigs ?? []).map((cfg) => { | ||
|
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.
Is there any consideration to have the
PAAPI
configs be dynamically configured, possibly from storing into localstorage from a previous auction result. I'm thinking about origins specifically but could be other things we might want to be dynamic. As a SSP the buyer origin is not a hardcoded value as we have multiple buyers depending on context.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.
The interface should be general enough to allow this from an adapter. If it becomes a common pattern we can consider extracting it to a shared library - right now I don't know how that would look like (I expect SSP will still want to get in the first auction, which requires hardcoded buyers).
Yes, and IMO this will quickly devolve into every prebid bundle containing every buyer that exists - but alas we decided that's what we want.