Skip to content

Commit 0d5971f

Browse files
jlquacciajorgeluisrocha
authored andcommitted
Pubmatic Bid Adapter: Removed logic to append JW player data to the "dctr" param (prebid#9169)
* removed logic to append jw data to dctr param * removed unneeded code * removed extra html page for testing
1 parent 1a0b87a commit 0d5971f

File tree

2 files changed

+3
-186
lines changed

2 files changed

+3
-186
lines changed

modules/pubmaticBidAdapter.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ function _addDealCustomTargetings(imp, bid) {
603603
}
604604
}
605605

606-
function _addJWPlayerSegmentData(imp, bid, isS2S) {
606+
function _addJWPlayerSegmentData(imp, bid) {
607607
var jwSegData = (bid.rtd && bid.rtd.jwplayer && bid.rtd.jwplayer.targeting) || undefined;
608608
var jwPlayerData = '';
609609
const jwMark = 'jw-';
@@ -620,12 +620,8 @@ function _addJWPlayerSegmentData(imp, bid, isS2S) {
620620

621621
var ext;
622622

623-
if (isS2S) {
624-
(imp.dctr === undefined || imp.dctr.length == 0) ? imp.dctr = jwPlayerData : imp.dctr += '|' + jwPlayerData;
625-
} else {
626-
ext = imp.ext;
627-
ext && ext.key_val === undefined ? ext.key_val = jwPlayerData : ext.key_val += '|' + jwPlayerData;
628-
}
623+
ext = imp.ext;
624+
ext && ext.key_val === undefined ? ext.key_val = jwPlayerData : ext.key_val += '|' + jwPlayerData;
629625
}
630626

631627
function _createImpressionObject(bid, conf) {
@@ -1371,7 +1367,6 @@ export const spec = {
13711367
*/
13721368

13731369
transformBidParams: function (params, isOpenRtb, adUnit, bidRequests) {
1374-
_addJWPlayerSegmentData(params, adUnit.bids[0], true);
13751370
return convertTypes({
13761371
'publisherId': 'string',
13771372
'adSlot': 'string'

test/spec/modules/pubmaticBidAdapter_spec.js

Lines changed: 0 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,184 +3816,6 @@ describe('PubMatic adapter', function () {
38163816
});
38173817
});
38183818

3819-
describe('JW player segment data for S2S', function() {
3820-
let sandbox = sinon.sandbox.create();
3821-
beforeEach(function () {
3822-
sandbox = sinon.sandbox.create();
3823-
});
3824-
afterEach(function() {
3825-
sandbox.restore();
3826-
});
3827-
it('Should append JW player segment data to dctr values in auction endpoint', function() {
3828-
var videoAdUnit = {
3829-
'bidderCode': 'pubmatic',
3830-
'bids': [
3831-
{
3832-
'bidder': 'pubmatic',
3833-
'params': {
3834-
'publisherId': '156276',
3835-
'adSlot': 'pubmatic_video2',
3836-
'dctr': 'key1=123|key2=345',
3837-
'pmzoneid': '1243',
3838-
'video': {
3839-
'mimes': ['video/mp4', 'video/x-flv'],
3840-
'skippable': true,
3841-
'minduration': 5,
3842-
'maxduration': 30,
3843-
'startdelay': 5,
3844-
'playbackmethod': [1, 3],
3845-
'api': [1, 2],
3846-
'protocols': [2, 3],
3847-
'battr': [13, 14],
3848-
'linearity': 1,
3849-
'placement': 2,
3850-
'minbitrate': 10,
3851-
'maxbitrate': 10
3852-
}
3853-
},
3854-
'rtd': {
3855-
'jwplayer': {
3856-
'targeting': {
3857-
'segments': ['80011026', '80011035'],
3858-
'content': {
3859-
'id': 'jw_d9J2zcaA'
3860-
}
3861-
}
3862-
}
3863-
},
3864-
'bid_id': '17a6771be26cc4',
3865-
'ortb2Imp': {
3866-
'ext': {
3867-
'data': {
3868-
'pbadslot': 'abcd',
3869-
'jwTargeting': {
3870-
'playerID': 'myElement1',
3871-
'mediaID': 'd9J2zcaA'
3872-
}
3873-
}
3874-
}
3875-
}
3876-
}
3877-
],
3878-
'auctionStart': 1630923178417,
3879-
'timeout': 1000,
3880-
'src': 's2s'
3881-
}
3882-
3883-
spec.transformBidParams(bidRequests[0].params, true, videoAdUnit);
3884-
expect(bidRequests[0].params.dctr).to.equal('key1:val1,val2|key2:val1|jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1');
3885-
});
3886-
it('Should send only JW player segment data in auction endpoint, if dctr is missing', function() {
3887-
var videoAdUnit = {
3888-
'bidderCode': 'pubmatic',
3889-
'bids': [
3890-
{
3891-
'bidder': 'pubmatic',
3892-
'params': {
3893-
'publisherId': '156276',
3894-
'adSlot': 'pubmatic_video2',
3895-
'dctr': 'key1=123|key2=345',
3896-
'pmzoneid': '1243',
3897-
'video': {
3898-
'mimes': ['video/mp4', 'video/x-flv'],
3899-
'skippable': true,
3900-
'minduration': 5,
3901-
'maxduration': 30,
3902-
'startdelay': 5,
3903-
'playbackmethod': [1, 3],
3904-
'api': [1, 2],
3905-
'protocols': [2, 3],
3906-
'battr': [13, 14],
3907-
'linearity': 1,
3908-
'placement': 2,
3909-
'minbitrate': 10,
3910-
'maxbitrate': 10
3911-
}
3912-
},
3913-
'rtd': {
3914-
'jwplayer': {
3915-
'targeting': {
3916-
'segments': ['80011026', '80011035'],
3917-
'content': {
3918-
'id': 'jw_d9J2zcaA'
3919-
}
3920-
}
3921-
}
3922-
},
3923-
'bid_id': '17a6771be26cc4',
3924-
'ortb2Imp': {
3925-
'ext': {
3926-
'data': {
3927-
'pbadslot': 'abcd',
3928-
'jwTargeting': {
3929-
'playerID': 'myElement1',
3930-
'mediaID': 'd9J2zcaA'
3931-
}
3932-
}
3933-
}
3934-
}
3935-
}
3936-
],
3937-
'auctionStart': 1630923178417,
3938-
'timeout': 1000,
3939-
'src': 's2s'
3940-
}
3941-
3942-
delete bidRequests[0].params.dctr;
3943-
spec.transformBidParams(bidRequests[0].params, true, videoAdUnit);
3944-
expect(bidRequests[0].params.dctr).to.equal('jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1');
3945-
});
3946-
3947-
it('Should not send any JW player segment data in auction endpoint, if it is not available', function() {
3948-
var videoAdUnit = {
3949-
'bidderCode': 'pubmatic',
3950-
'bids': [
3951-
{
3952-
'bidder': 'pubmatic',
3953-
'params': {
3954-
'publisherId': '156276',
3955-
'adSlot': 'pubmatic_video2',
3956-
'dctr': 'key1=123|key2=345',
3957-
'pmzoneid': '1243',
3958-
'video': {
3959-
'mimes': ['video/mp4', 'video/x-flv'],
3960-
'skippable': true,
3961-
'minduration': 5,
3962-
'maxduration': 30,
3963-
'startdelay': 5,
3964-
'playbackmethod': [1, 3],
3965-
'api': [1, 2],
3966-
'protocols': [2, 3],
3967-
'battr': [13, 14],
3968-
'linearity': 1,
3969-
'placement': 2,
3970-
'minbitrate': 10,
3971-
'maxbitrate': 10
3972-
}
3973-
},
3974-
'bid_id': '17a6771be26cc4',
3975-
'ortb2Imp': {
3976-
'ext': {
3977-
'data': {
3978-
'pbadslot': 'abcd',
3979-
'jwTargeting': {
3980-
'playerID': 'myElement1',
3981-
'mediaID': 'd9J2zcaA'
3982-
}
3983-
}
3984-
}
3985-
}
3986-
}
3987-
],
3988-
'auctionStart': 1630923178417,
3989-
'timeout': 1000,
3990-
'src': 's2s'
3991-
}
3992-
spec.transformBidParams(bidRequests[0].params, true, videoAdUnit);
3993-
expect(bidRequests[0].params.dctr).to.equal('key1:val1,val2|key2:val1');
3994-
});
3995-
})
3996-
39973819
describe('Checking for Video.Placement property', function() {
39983820
let sandbox, utilsMock;
39993821
const adUnit = 'Div1';

0 commit comments

Comments
 (0)