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

ucfunnel Bid Adapter: add support Price Floors Module #6806

Merged
merged 56 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d18db95
Add a new ucfunnel Adapter and test page
Jun 5, 2017
f82a4b7
Add a new ucfunnel Adapter and test page
Jun 5, 2017
4c91775
1. Use prebid lib in the repo to keep updated
RyanChouTw Jun 16, 2017
52eaecb
Merge branch 'master' into master
RyanChouTw Jun 16, 2017
96a70a4
utils.getTopWindowLocation is a function
RyanChouTw Jun 20, 2017
7202a62
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jun 28, 2017
858b833
Change to modules from adapters
RyanChouTw Jun 28, 2017
8b46932
Migrate to module design
RyanChouTw Jun 28, 2017
d7e043b
[Dev Fix] Remove width and height which can be got from ad unit id
RyanChouTw Jul 13, 2017
badfa53
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jul 13, 2017
8d81704
Merge pull request #1 from prebid/master
RyanChouTw Sep 25, 2017
8e7fe31
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Dec 21, 2017
5dc00f3
Update ucfunnelBidAdapter to fit into new spec
RyanChouTw Dec 21, 2017
66c3a06
Correct the endpoint. Fix the error of query string
RyanChouTw Dec 21, 2017
0328e97
Add test case for ucfunnelBidAdapter
RyanChouTw Jan 11, 2018
c2c5eb0
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jan 11, 2018
86fdd23
Fix lint error
RyanChouTw Jan 12, 2018
c331f57
Update version number
RyanChouTw Jan 16, 2018
28acb40
Combine all checks on bid request
RyanChouTw Jan 18, 2018
93621b8
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw May 25, 2018
f7f2515
Add GDPR support for ucfunnel adapter
RyanChouTw May 25, 2018
d4f3467
Merge branch 'master' of https://github.com/prebid/Prebid.js
RyanChouTw Jun 14, 2018
1f79c44
Add in-stream video and native support for ucfunnel adapter
RyanChouTw Jun 14, 2018
7d8dc52
Remove demo page. Add more test cases.
RyanChouTw Jun 20, 2018
99fa86e
Change request method from POST to GET
RyanChouTw Jun 26, 2018
03e37e6
Remove unnecessary comment
RyanChouTw Jun 27, 2018
aabfdd4
Support vastXml and vastUrl for video request
RyanChouTw Jul 3, 2018
2177c15
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 2, 2018
af05d07
update TTL to 30 mins
Dec 2, 2018
45614c9
Avoid using arrow function which is not discuraged in mocha
Dec 3, 2018
a5b402c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 9, 2019
c22723e
ucfunnel tdid support
Jul 9, 2019
644b900
Merge branch 'master' of https://github.com/prebid/Prebid.js into HEAD
Oct 21, 2019
0175c57
ucfunnel fix error message in debug mode
Oct 17, 2019
70e82bb
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Nov 25, 2019
c09b816
ucfunnel adapter add bidfloor parameter
jackhsiehucf Nov 25, 2019
30e79c5
Merge branch 'master' of https://github.com/prebid/Prebid.js into ccpa
jackhsiehucf Dec 5, 2019
fee3803
ucfunnel adapter support CCPA
jackhsiehucf Dec 5, 2019
0f9b6c8
ucfunnel adapter fix prebid 3.0 problem
jackhsiehucf Dec 12, 2019
eb11188
merge
jackhsiehucf Jan 9, 2020
994ffef
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Jan 9, 2020
084190b
ucfunnel adapter native support clicktrackers
jackhsiehucf Jan 10, 2020
ddb077d
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Jan 17, 2020
bb22940
ucfunnel adapter change cookie sync setting
jackhsiehucf Jan 17, 2020
3004ad9
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf May 21, 2020
f34f753
ucfunnel adapter update request parameter
jackhsiehucf May 21, 2020
0f8cba0
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Jan 4, 2021
0b34007
Update ucfunnelBidAdapter
jackhsiehucf Jan 4, 2021
08f7de0
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Feb 25, 2021
85bf436
ucfunnel adapter add currency in ad response
jackhsiehucf Feb 25, 2021
b6b7ab0
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf Apr 23, 2021
c2d5bb3
ucfunnel adapter support uid2
jackhsiehucf Apr 23, 2021
8eea4b5
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf May 12, 2021
8630cb1
ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID
jackhsiehucf May 12, 2021
97421e1
Merge branch 'master' of https://github.com/prebid/Prebid.js
jackhsiehucf May 21, 2021
5829658
ucfunnel Bid Adapter: add support Price Floors Module
jackhsiehucf May 21, 2021
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
38 changes: 36 additions & 2 deletions modules/ucfunnelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const COOKIE_NAME = 'ucf_uid';
const VER = 'ADGENT_PREBID-2018011501';
const BIDDER_CODE = 'ucfunnel';
const GVLID = 607;
const CURRENCY = 'USD';
const VIDEO_CONTEXT = {
INSTREAM: 0,
OUSTREAM: 2
Expand Down Expand Up @@ -210,12 +211,41 @@ function getSupplyChain(schain) {
return supplyChain;
}

function getMediaType(mediaTypes) {
if (mediaTypes != null && mediaTypes.banner) {
return 'banner';
} else if (mediaTypes != null && mediaTypes.video) {
return 'video';
} else if (mediaTypes != null && mediaTypes.native) {
return 'native'
}
return 'banner';
}

function getFloor(bid, size, mediaTypes) {
if (bid.params.bidfloor) {
return bid.params.bidfloor;
}
if (typeof bid.getFloor === 'function') {
var bidFloor = bid.getFloor({
currency: CURRENCY,
mediaType: getMediaType(mediaTypes),
Copy link
Collaborator

@patmmccann patmmccann May 21, 2021

Choose a reason for hiding this comment

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

On multiformat unit, this appears to always set the video floor.

Copy link
Contributor Author

@jackhsiehucf jackhsiehucf May 24, 2021

Choose a reason for hiding this comment

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

@patmmccann Does multiformat unit mean that adUnits support multiple mediaType ?
Like support banner and video in the same adUnits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I update the commit to fix the banner bid floor problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patmmccann any comment about the update commit?

size: (size) ? [ size[0], size[1] ] : '*',
});
if (bidFloor.currency === CURRENCY) {
return bidFloor.floor;
}
}
return undefined;
}

function getRequestData(bid, bidderRequest) {
const size = parseSizes(bid);
const language = navigator.language;
const dnt = (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0;
const userIdTdid = (bid.userId && bid.userId.tdid) ? bid.userId.tdid : '';
const supplyChain = getSupplyChain(bid.schain);
const bidFloor = getFloor(bid, size, bid.mediaTypes);
// general bid data
let bidData = {
ver: VER,
Expand All @@ -225,9 +255,13 @@ function getRequestData(bid, bidderRequest) {
dnt: dnt,
adid: bid.params.adid,
tdid: userIdTdid,
schain: supplyChain,
fp: bid.params.bidfloor
schain: supplyChain
};

if (bidFloor) {
bidData.fp = bidFloor;
}

addUserId(bidData, bid.userId);
try {
bidData.host = window.top.location.hostname;
Expand Down
38 changes: 36 additions & 2 deletions test/spec/modules/ucfunnelBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const userId = {
const validBannerBidReq = {
bidder: BIDDER_CODE,
params: {
adid: 'ad-34BBD2AA24B678BBFD4E7B9EE3B872D',
bidfloor: 1.0
adid: 'ad-34BBD2AA24B678BBFD4E7B9EE3B872D'
},
sizes: [[300, 250]],
bidId: '263be71e91dd9d',
Expand Down Expand Up @@ -175,6 +174,41 @@ describe('ucfunnel Adapter', function () {
expect(data.w).to.equal(width);
expect(data.h).to.equal(height);
});

it('should set bidfloor if configured', function() {
let bid = Object.assign({}, validBannerBidReq);
bid.getFloor = function() {
return {
currency: 'USD',
floor: 2.02
}
};
const requests = spec.buildRequests([ bid ]);
const data = requests[0].data;
expect(data.fp).to.equal(2.02);
});

it('should set bidfloor if configured', function() {
let bid = Object.assign({}, validBannerBidReq);
bid.params.bidfloor = 2.01;
const requests = spec.buildRequests([ bid ]);
const data = requests[0].data;
expect(data.fp).to.equal(2.01);
});

it('should set bidfloor if configured', function() {
let bid = Object.assign({}, validBannerBidReq);
bid.getFloor = function() {
return {
currency: 'USD',
floor: 2.02
}
};
bid.params.bidfloor = 2.01;
const requests = spec.buildRequests([ bid ]);
const data = requests[0].data;
expect(data.fp).to.equal(2.01);
});
});

describe('interpretResponse', function () {
Expand Down