Skip to content

Commit

Permalink
PubmaticBidAdapter: Using plcmt instead of placement (#11623)
Browse files Browse the repository at this point in the history
* Implement functionality for deal priority

* Update test cases

* kick off test manually

* Added support of GPP to PubMatic adapter

* gpp_sid in user syncs supposed to encode as a string, not an array

* Remove extra space

* Remove trailing spaces

* Remove the placement parameter and update test cases accordingly, Add plcmt parameter.

* Supporting placement parameter and logging warning message, for the plcmt parameter, if it is missing.

* Remove commented code

---------

Co-authored-by: Chris Huie <[email protected]>
  • Loading branch information
pm-nitin-shirsat and ChrisHuie committed May 30, 2024
1 parent 42fd6f2 commit 7defcab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const DEFAULT_HEIGHT = 0;
const PREBID_NATIVE_HELP_LINK = 'http://prebid.org/dev-docs/show-native-ads.html';
const PUBLICATION = 'pubmatic'; // Your publication on Blue Billywig, potentially with environment (e.g. publication.bbvms.com or publication.test.bbvms.com)
const RENDERER_URL = 'https://pubmatic.bbvms.com/r/'.concat('$RENDERER', '.js'); // URL of the renderer application
const MSG_VIDEO_PLACEMENT_MISSING = 'Video.Placement param missing';
const MSG_VIDEO_PLCMT_MISSING = 'Video.plcmt param missing';

const CUSTOM_PARAMS = {
'kadpageurl': '', // Custom page url
Expand Down Expand Up @@ -560,8 +560,8 @@ function _createBannerRequest(bid) {

export function checkVideoPlacement(videoData, adUnitCode) {
// Check for video.placement property. If property is missing display log message.
if (FEATURES.VIDEO && !deepAccess(videoData, 'placement')) {
logWarn(MSG_VIDEO_PLACEMENT_MISSING + ' for ' + adUnitCode);
if (FEATURES.VIDEO && !deepAccess(videoData, 'plcmt')) {
logWarn(MSG_VIDEO_PLCMT_MISSING + ' for ' + adUnitCode);
};
}

Expand Down
10 changes: 5 additions & 5 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4046,10 +4046,10 @@ describe('PubMatic adapter', function () {
});

if (FEATURES.VIDEO) {
describe('Checking for Video.Placement property', function() {
describe('Checking for Video.plcmt property', function() {
let sandbox, utilsMock;
const adUnit = 'Div1';
const msg_placement_missing = 'Video.Placement param missing for Div1';
const msg_placement_missing = 'Video.plcmt param missing for Div1';
let videoData = {
battr: [6, 7],
skipafter: 15,
Expand All @@ -4073,12 +4073,12 @@ describe('PubMatic adapter', function () {
sandbox.restore();
})

it('should log Video.Placement param missing', function() {
it('should log Video.plcmt param missing', function() {
checkVideoPlacement(videoData, adUnit);
sinon.assert.calledWith(utils.logWarn, msg_placement_missing);
})
it('shoud not log Video.Placement param missing', function() {
videoData['placement'] = 1;
it('shoud not log Video.plcmt param missing', function() {
videoData['plcmt'] = 1;
checkVideoPlacement(videoData, adUnit);
sinon.assert.neverCalledWith(utils.logWarn, msg_placement_missing);
})
Expand Down

0 comments on commit 7defcab

Please sign in to comment.