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

Undertone 24910 video in prebid #5485

Merged
merged 20 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d8779ee
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
6785395
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
c5611e3
fix lint issue in undertone adapter spec
omerko May 30, 2018
eea398e
Merge branch 'master' of https://github.com/prebid/Prebid.js
omerko Jul 15, 2018
ddcce01
added user sync function to undertone adapter
omerko Sep 13, 2018
2d5bd83
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
a33df49
added user sync function to undertone adapter
omerko Sep 13, 2018
467a238
added user sync function to undertone adapter
omerko Sep 16, 2018
4f3342c
Merge remote-tracking branch 'origin/master'
omerko Sep 16, 2018
95228a2
revert package-lock.json
omerko Oct 11, 2018
852cd6d
Merge branch 'master' of https://github.com/prebid/Prebid.js
AnnaPerion Mar 8, 2020
55fad56
added user sync function to undertone adapter
omerko Sep 13, 2018
33bf123
Merge branch 'master' of https://github.com/PerionNet/Prebid.js
AnnaPerion Mar 25, 2020
beba2be
Update undertoneBidAdapter.js
AnnaPerion Mar 25, 2020
bf43be9
Merge branch 'master' of https://github.com/prebid/Prebid.js
AnnaPerion Jun 28, 2020
c39012e
support video ads
AnnaPerion Jun 30, 2020
72563ff
support video ads
AnnaPerion Jul 12, 2020
2f99051
Merge remote-tracking branch 'upstream/master'
AnnaPerion Jul 12, 2020
9b2ffec
Merge remote-tracking branch 'origin/master' into UN-24910_Video-In-P…
AnnaPerion Jul 12, 2020
9ef8f21
fix indentation
AnnaPerion Jul 16, 2020
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
25 changes: 22 additions & 3 deletions modules/undertoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* Adapter to send bids to Undertone
*/

import { parseUrl } from '../src/utils.js';
import { deepAccess, parseUrl } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';

const BIDDER_CODE = 'undertone';
const URL = 'https://hb.undertone.com/hb';
Expand Down Expand Up @@ -73,6 +74,7 @@ function getBannerCoords(id) {

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO],
isBidRequestValid: function(bid) {
if (bid && bid.params && bid.params.publisherId) {
bid.params.publisherId = parseInt(bid.params.publisherId);
Expand Down Expand Up @@ -120,8 +122,20 @@ export const spec = {
sizes: bidReq.sizes,
params: bidReq.params
};
const videoMediaType = deepAccess(bidReq, 'mediaTypes.video');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should potentially say & deepAccess(bidReq, 'mediaTypes.video.context') != 'outstream or something of the sort

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patmmccann i believe our team already reached out to you via email, however please reach out to pubams@undertone.com for further discussion/ next steps

Copy link
Collaborator

@patmmccann patmmccann Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oranperion this is a community issue, not just our account. What is the status of this? Breaking changes should be reserved for major version updates and this change breaks your support of multiformat ad slots.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patmmccann issue already been solved on backend, there is already high fill rate on the placement id 2002001, and an email about this information been sent to you and your company last week, where a member of your company - Isaiah Ward iward@cafemedia.com conform issue resolved

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looping in the community here, glad all is resolved!

if (videoMediaType) {
bid.video = {
playerSize: deepAccess(bidReq, 'mediaTypes.video.playerSize') || null,
streamType: deepAccess(bidReq, 'mediaTypes.video.context') || null,
playbackMethod: deepAccess(bidReq, 'params.video.playbackMethod') || null,
maxDuration: deepAccess(bidReq, 'params.video.maxDuration') || null,
skippable: deepAccess(bidReq, 'params.video.skippable') || null
};
bid.mediaType = 'video';
}
payload['x-ut-hb-params'].push(bid);
});

return {
method: 'POST',
url: reqUrl,
Expand All @@ -144,9 +158,14 @@ export const spec = {
creativeId: bidRes.adId,
currency: bidRes.currency,
netRevenue: bidRes.netRevenue,
ttl: bidRes.ttl || 360,
ad: bidRes.ad
ttl: bidRes.ttl || 360
};
if (bidRes.mediaType && bidRes.mediaType === 'video') {
bid.vastXml = bidRes.ad;
bid.mediaType = bidRes.mediaType;
} else {
bid.ad = bidRes.ad
}
bids.push(bid);
}
});
Expand Down
76 changes: 75 additions & 1 deletion test/spec/modules/undertoneBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,49 @@ const invalidBidReq = {
auctionId: '9ad1fa8d-2297-4660-a018-b39945054746'
};

const bidReq = [{
const videoBidReq = [{
adUnitCode: 'div-gpt-ad-1460505748561-0',
bidder: BIDDER_CODE,
params: {
placementId: '10433394',
publisherId: 12345,
video: {
id: 123,
skippable: true,
playbackMethod: 2,
maxDuration: 30
}
},
mediaTypes: {video: {
context: 'outstream',
playerSize: [640, 480]
}},
sizes: [[300, 250], [300, 600]],
bidId: '263be71e91dd9d',
auctionId: '9ad1fa8d-2297-4660-a018-b39945054746'
},
{
adUnitCode: 'div-gpt-ad-1460505748561-1',
bidder: BIDDER_CODE,
params: {
placementId: '10433395',
publisherId: 12345
},
mediaTypes: {video: {
context: 'outstream',
playerSize: [640, 480]
}},
sizes: [[300, 250], [300, 600]],
bidId: '263be71e91dd9d',
auctionId: '9ad1fa8d-2297-4660-a018-b39945054746'
}];
const bidReq = [{
adUnitCode: 'div-gpt-ad-1460505748561-0',
bidder: BIDDER_CODE,
params: {
placementId: '10433394',
publisherId: 12345,
},
sizes: [[300, 250], [300, 600]],
bidId: '263be71e91dd9d',
auctionId: '9ad1fa8d-2297-4660-a018-b39945054746'
Expand Down Expand Up @@ -147,6 +183,20 @@ const bidResArray = [
ttl: 360
}
];
const bidVideoResponse = [
{
ad: '<xml />',
bidRequestId: '263be71e91dd9d',
cpm: 100,
adId: '123abc',
currency: 'USD',
mediaType: 'video',
netRevenue: true,
width: 300,
height: 250,
ttl: 360
}
];

let element;
let sandbox;
Expand Down Expand Up @@ -241,6 +291,23 @@ describe('Undertone Adapter', () => {
expect(bid2.publisherId).to.equal(12345);
expect(bid2.params).to.be.an('object');
});
it('should send video fields correctly', function () {
const request = spec.buildRequests(videoBidReq, bidderReq);
const bidVideo = JSON.parse(request.data)['x-ut-hb-params'][0];
const bidVideo2 = JSON.parse(request.data)['x-ut-hb-params'][1];

expect(bidVideo.mediaType).to.equal('video');
expect(bidVideo.video).to.be.an('object');
expect(bidVideo.video.playerSize).to.be.an('array');
expect(bidVideo.video.streamType).to.equal('outstream');
expect(bidVideo.video.playbackMethod).to.equal(2);
expect(bidVideo.video.maxDuration).to.equal(30);
expect(bidVideo.video.skippable).to.equal(true);

expect(bidVideo2.video.skippable).to.equal(null);
expect(bidVideo2.video.maxDuration).to.equal(null);
expect(bidVideo2.video.playbackMethod).to.equal(null);
});
it('should send all userIds data to server', function () {
const request = spec.buildRequests(bidReqUserIds, bidderReq);
const bidCommons = JSON.parse(request.data)['commons'];
Expand Down Expand Up @@ -303,6 +370,13 @@ describe('Undertone Adapter', () => {
it('should only use valid bid responses', () => {
expect(spec.interpretResponse({ body: bidResArray }).length).to.equal(1);
});

it('should detect video response', () => {
const videoResult = spec.interpretResponse({body: bidVideoResponse});
const vbid = videoResult[0];

expect(vbid.mediaType).to.equal('video');
});
});

describe('getUserSyncs', () => {
Expand Down