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

Ix Bid Adapter: pass through paapi imp extension [PB-2799] #11639

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ function addImpressions(impressions, impKeys, r, adUnitIndex) {
const tid = impressions[impKeys[adUnitIndex]].tid;
const sid = impressions[impKeys[adUnitIndex]].sid;
const auctionEnvironment = impressions[impKeys[adUnitIndex]].ae;
const paapi = impressions[impKeys[adUnitIndex]].paapi;
const bannerImpressions = impressionObjects.filter(impression => BANNER in impression);
const otherImpressions = impressionObjects.filter(impression => !(BANNER in impression));

Expand Down Expand Up @@ -1023,7 +1024,7 @@ function addImpressions(impressions, impKeys, r, adUnitIndex) {
_bannerImpression.banner.pos = position;
}

if (dfpAdUnitCode || gpid || tid || sid || auctionEnvironment || externalID) {
if (dfpAdUnitCode || gpid || tid || sid || auctionEnvironment || externalID || paapi) {
_bannerImpression.ext = {};

_bannerImpression.ext.dfp_ad_unit_code = dfpAdUnitCode;
Expand All @@ -1035,6 +1036,7 @@ function addImpressions(impressions, impKeys, r, adUnitIndex) {
// enable fledge auction
if (auctionEnvironment == 1) {
_bannerImpression.ext.ae = 1;
_bannerImpression.ext.paapi = paapi;
}
}

Expand Down Expand Up @@ -1440,6 +1442,10 @@ function createBannerImps(validBidRequest, missingBannerSizes, bannerImps, bidde
const fledgeEnabled = deepAccess(bidderRequest, 'fledgeEnabled')
if (fledgeEnabled) {
const auctionEnvironment = deepAccess(validBidRequest, 'ortb2Imp.ext.ae')
const paapi = deepAccess(validBidRequest, 'ortb2Imp.ext.paapi')
if (paapi) {
bannerImps[validBidRequest.adUnitCode].paapi = paapi
}
if (auctionEnvironment) {
if (isInteger(auctionEnvironment)) {
bannerImps[validBidRequest.adUnitCode].ae = auctionEnvironment;
Expand Down
16 changes: 16 additions & 0 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3517,6 +3517,22 @@ describe('IndexexchangeAdapter', function () {
expect(logWarnSpy.calledWith('error setting auction environment flag - must be an integer')).to.be.true;
logWarnSpy.restore();
});

it('impression should have paapi extension when passed', function () {
const bidderRequest = deepClone(DEFAULT_OPTION_FLEDGE_ENABLED);
let bid = utils.deepClone(DEFAULT_BANNER_VALID_BID_WITH_FLEDGE_ENABLED[0]);
bid.ortb2Imp.ext.ae = 1
bid.ortb2Imp.ext.paapi = {
requestedSize: {
width: 300,
height: 250
}
}
const requestBidFloor = spec.buildRequests([bid], bidderRequest)[0];
const impression = extractPayload(requestBidFloor).imp[0];
expect(impression.ext.paapi.requestedSize.width).to.equal(300);
expect(impression.ext.paapi.requestedSize.height).to.equal(250);
});
});

describe('integration through exchangeId and externalId', function () {
Expand Down