Skip to content

Commit

Permalink
OpenWrap Release v21.3.0 (#426)
Browse files Browse the repository at this point in the history
* support for video in hybrid profiles

* added newBid.mediaType for pubmaticServerBidAdapter

* unit test case for video request

* reverted debug flag

* Changes for UOe-5712/5705

* Manually took the changes for DVC related info

* Fix Typo

* piid for hybrid profiles

* removed fix for piid from staged_nightly

* sspId for pubmatic only (#418)

* fix to remove redundant validation for datatype for partner value - UOE-5788

* fix for UOE-5788

* moved changes for UOE-5788 in hasRequiredParams function

* consent string gets overwritten when IH is enabled

* Feature/secondary alias (#425)

* gps secondary bid adapter

* fix alias

* remove dvc since it will go with ow prebid same

Co-authored-by: manisha <manisha.satpute@pubmatic.com>
Co-authored-by: Manasi <pm-manasi-moghe@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 25, 2020
1 parent d65bcb7 commit 71d2f37
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export const spec = {
{ code: 'districtm', gvlid: 144 },
{ code: 'adasta' },
{ code: 'beintoo', gvlid: 618 },
{ code: 'dg' }
{ code: 'dg' },
{ code: 'gps' }
],
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

Expand Down
10 changes: 6 additions & 4 deletions modules/id5IdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ export const id5IdSubmodule = {
if (!hasRequiredParams(configParams)) {
return undefined;
}
if (!configParams || typeof parseInt(configParams.partner) !== 'number') {
//This check is redundant. moving it to the 'hasRequiredParams function instead' - UOE-5788
/*if (!configParams || typeof parseInt(configParams.partner) !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
}
return undefined;
}*/
configParams.partner = parseInt(configParams.partner)
const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0;
const gdprConsentString = hasGdpr ? consentData.consentString : '';
Expand Down Expand Up @@ -125,8 +127,8 @@ export const id5IdSubmodule = {
};

function hasRequiredParams(configParams) {
if (!configParams || typeof configParams.partner !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
if (!configParams || typeof parseInt(configParams.partner) !== 'number' || isNaN(parseInt(configParams.partner))) {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number - Current value received: ` + configParams.partner);
return false;
}
return true;
Expand Down
6 changes: 4 additions & 2 deletions modules/pubmaticServerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ function _handleEids(payload, validBidRequests) {
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.firstpartyid`), 'firstpartyid', 1);
}
if (eids.length > 0) {
payload.user.ext = {};
if(!payload.user.ext) {
payload.user.ext = {};
}
payload.user.ext.eids = eids;
}
}
Expand Down Expand Up @@ -641,7 +643,7 @@ export const spec = {
if (bid.ext.prebid && bid.ext.prebid.targeting) {
newBid.adserverTargeting = bid.ext.prebid.targeting
}
if (newBid && newBid.originalBidder == 'pubmatic') {
if (newBid && newBid.originalBidder == "pubmatic") {
newBid.sspID = bid.id || '';
}
break;
Expand Down
9 changes: 9 additions & 0 deletions test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ let events = require('src/events');
let ajax = require('src/ajax');
let utils = require('src/utils');

const DEFAULT_USER_AGENT = window.navigator.userAgent;
const MOBILE_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1';
const setUADefault = () => { window.navigator.__defineGetter__('userAgent', function () { return DEFAULT_USER_AGENT }) };
const setUAMobile = () => { window.navigator.__defineGetter__('userAgent', function () { return MOBILE_USER_AGENT }) };
const setUANull = () => { window.navigator.__defineGetter__('userAgent', function () { return null }) };

const {
EVENTS: {
AUCTION_INIT,
Expand Down Expand Up @@ -247,6 +253,7 @@ describe('pubmatic analytics adapter', function () {
let clock;

beforeEach(function () {
setUADefault();
sandbox = sinon.sandbox.create();

xhr = sandbox.useFakeXMLHttpRequest();
Expand Down Expand Up @@ -643,6 +650,7 @@ describe('pubmatic analytics adapter', function () {
});

it('Logger: currency conversion check', function() {
setUANull();
setConfig({
adServerCurrency: 'JPY',
rates: {
Expand Down Expand Up @@ -698,6 +706,7 @@ describe('pubmatic analytics adapter', function () {
});

it('Logger: regexPattern in bid.params', function() {
setUAMobile();
const BID_REQUESTED_COPY = utils.deepClone(MOCK.BID_REQUESTED);
BID_REQUESTED_COPY.bids[1].params.regexPattern = '*';
events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);
Expand Down

0 comments on commit 71d2f37

Please sign in to comment.