Skip to content

Commit

Permalink
chore: update default video placement value [PB-1560] (#9948)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Corbo <chris.corbo@indexexchange.com>
  • Loading branch information
ccorbo and Chris Corbo authored May 30, 2023
1 parent 7cbedf0 commit 68d572e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const FEATURE_TOGGLES = {
let siteID = 0;
let gdprConsent = '';
let usPrivacy = '';
let defaultVideoPlacement = false;

// Possible values for bidResponse.seatBid[].bid[].mtype which indicates the type of the creative markup so that it can properly be associated with the right sub-object of the BidRequest.Imp.
const MEDIA_TYPES = {
Expand Down Expand Up @@ -223,7 +224,8 @@ function bidToVideoImp(bid) {
if (deepAccess(videoParamRef, 'playerConfig.floatOnScroll')) {
imp.video.placement = 5;
} else {
imp.video.placement = 4;
imp.video.placement = 3;
defaultVideoPlacement = true;
}
} else {
logWarn(`IX Bid Adapter: Video context '${context}' is not supported`);
Expand Down Expand Up @@ -1111,7 +1113,8 @@ function buildIXDiag(validBidRequests) {
ren: false,
version: '$prebid.version$',
userIds: _getUserIds(validBidRequests[0]),
url: window.location.href.split('?')[0]
url: window.location.href.split('?')[0],
vpd: defaultVideoPlacement
};

// create ad unit map and collect the required diag properties
Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2596,7 +2596,8 @@ describe('IndexexchangeAdapter', function () {
const impression = extractPayload(request).imp[0];

expect(impression.id).to.equal(DEFAULT_VIDEO_VALID_BID[0].bidId);
expect(impression.video.placement).to.equal(4);
expect(impression.video.placement).to.equal(3);
expect(extractPayload(request).ext.ixdiag.vpd).to.equal(true);
});

it('should handle unexpected context', function () {
Expand Down

0 comments on commit 68d572e

Please sign in to comment.