Skip to content

Commit

Permalink
Livewrapped Bidder: add support for ortb2imp (prebid#11026)
Browse files Browse the repository at this point in the history
* Added support for the Price Floors Module

* Use the ad server's currency when getting prices from the floors module

* Default to USD if the ad server's currency can't be retrieved

* Set the default currency at the right place

* Added tests and made a minor change in how device width and height are calculated

* Only include flrCur when ad requests contain floors

* Use ortb native

* Read ortb2imp

---------

Co-authored-by: msmeza <moises@livewrapped.com>
  • Loading branch information
bjorn-lw and msmeza authored Feb 1, 2024
1 parent d000ec8 commit 0ad3244
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 38 deletions.
6 changes: 1 addition & 5 deletions modules/livewrappedBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {config} from '../src/config.js';
import {find} from '../src/polyfill.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {getStorageManager} from '../src/storageManager.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

/**
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
Expand Down Expand Up @@ -52,9 +51,6 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function(bidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
bidRequests = convertOrtbRequestToProprietaryNative(bidRequests);

const userId = find(bidRequests, hasUserId);
const pubcid = find(bidRequests, hasPubcid);
const publisherId = find(bidRequests, hasPublisherId);
Expand Down Expand Up @@ -236,9 +232,9 @@ function bidToAdRequest(bid, currency) {
adUnitId: bid.params.adUnitId,
callerAdUnitId: bid.params.adUnitName || bid.adUnitCode || bid.placementCode,
bidId: bid.bidId,
transactionId: bid.ortb2Imp?.ext?.tid,
formats: getSizes(bid).map(sizeToFormat),
flr: getBidFloor(bid, currency),
rtbData: bid.ortb2Imp,
options: bid.params.options
};

Expand Down
Loading

0 comments on commit 0ad3244

Please sign in to comment.