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

add vastUrl + media type for video bids Prebid Server #1739

Merged
merged 4 commits into from
Oct 27, 2017
Merged
Changes from 1 commit
Commits
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
16 changes: 11 additions & 5 deletions modules/prebidServerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ function PrebidServer() {
if (videoMediaType) {
// pbs expects a ad_unit.video attribute if the imp is video
adUnit.video = Object.assign({}, videoMediaType);
delete adUnit.mediaTypes.video;
delete adUnit.mediaTypes;
// default is assumed to be 'banner' so if there is a video type we assume video only until PBS can support multi format auction.
adUnit.media_types = ['video'];
Copy link
Collaborator

@matthewlane matthewlane Oct 26, 2017

Choose a reason for hiding this comment

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

Would it make sense to use the VIDEO constant here too?

}
})
convertTypes(adUnits);
Expand Down Expand Up @@ -196,10 +198,15 @@ function PrebidServer() {
bidObject.creative_id = bidObj.creative_id;
bidObject.bidderCode = bidObj.bidder;
bidObject.cpm = cpm;
bidObject.ad = bidObj.adm;
if (bidObj.nurl) {
bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bidObj.nurl));
if (bidObj.media_type === 'video') {
bidObject.vastUrl = bidObj.nurl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is a nurl guaranteed on video bids?

In section 6.4.2 of the OpenRTB 2.5 spec, it looks like video bids could either serve vastUrl through the nurl, or vastXml through adm.

} else {
bidObject.ad = bidObj.adm;
if (bidObj.nurl) {
bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bidObj.nurl));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these should be the other way around. From the spec, adm is described as:

Optional means of conveying ad markup in case the bid wins; supersedes the win notice if markup is included in both.

(see section 4.2.3)

}

bidObject.width = bidObj.width;
bidObject.height = bidObj.height;
bidObject.adserverTargeting = bidObj.ad_server_targeting;
Expand All @@ -223,7 +230,6 @@ function PrebidServer() {
bidObject.source = TYPE;
bidObject.adUnitCode = bidRequest.placementCode;
bidObject.bidderCode = bidRequest.bidder;

bidmanager.addBidResponse(bidObject.adUnitCode, bidObject);
});
});
Expand Down