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

Tappx Bid Adapter: add floor module support #6626

Merged
merged 108 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
1646d1f
UPDATE: add initial UID
Mar 24, 2021
62d04e2
UPDATE: UID change user ext
Mar 26, 2021
9a2f9cb
UPDATE: UID clean logs
Mar 26, 2021
3fedc33
UPDATE: add host info
Mar 26, 2021
3cfb943
UPDATE: tappx bid adapter universal id
Mar 30, 2021
22a2b71
UPDATE: fix bidder param
Mar 31, 2021
8700881
UPDATE: tappxBidAdapter tests
Mar 31, 2021
88dfa06
tappxBidAdapter - fix spacing
Mar 31, 2021
919c2f2
tappxBidAdapter: add test user eids array
Mar 31, 2021
37d9f96
tappxBidAdapter: update eids array
Mar 31, 2021
e5777a2
FIX: package-lock.json
Mar 31, 2021
d9a9969
Conversant adapter: add adomain, remove digitrust (#6495)
patmmccann Mar 31, 2021
668c017
Rads Bid Adapter: add GDPR support & user sync support (#6455)
onlsol Mar 31, 2021
7da6799
Proxistore Bid Adapter: add cookieless url endpoint & use floor modul…
vincentproxistore Mar 31, 2021
1a7a7a3
AdYoulike Bid Adapter: Add an "Insertion" tracking for Native mediaty…
guiann Mar 31, 2021
3876d67
Dspx Bid Adapter : add user sync support (#6456)
onlsol Mar 31, 2021
d9e3b12
Multibid Module: add new module to handle multiple bids from single b…
mmoschovas Mar 31, 2021
709e967
Adding uid2 to submodules.json (#6508)
SKOCHERI Mar 31, 2021
b87bfb1
NextRoll ID System: add new ID module (#6396)
abijr Apr 1, 2021
1fae3c4
Qwarry Bid Adapter: add GDPR and consent string handling (#6489)
artemiokost Apr 1, 2021
f2ff4dd
Zemanta Bid Adapter: add support for new params & consent strings to …
Apr 1, 2021
6697dc9
Automatad Bid Adapter: Add meta.advertiserDomains to bid response (#6…
Apr 1, 2021
4230a2c
Adhese Bid Adapter: add support for caching video content (#6501)
Apr 1, 2021
f94d9b4
update apacdex unit test to disable debug mode (#6511)
jsnellbaker Apr 1, 2021
d6d29a7
Telaria: not setting adid (#6507)
bretg Apr 1, 2021
cb19d28
Prebid 4.33.0 Release
jsnellbaker Apr 1, 2021
2b865a3
increment pre version
jsnellbaker Apr 1, 2021
0ce4ae3
rubicon: removing maxduration as a required bidder parameter (#6513)
bretg Apr 1, 2021
61ac2eb
Zemanta adapter: add advertiserDomains (#6517)
Apr 2, 2021
d6426dc
Lemma Bid Adapter: accepting the floor to use the getFloor function (…
lm-abhijit Apr 2, 2021
22f7de5
Mediasquare Bid Adapter: fix getUserSyncs issue with empty bids + add…
matthieularere-msq Apr 2, 2021
fcc2928
Update nextroll ID variable name to match published ID module (#6519)
abijr Apr 2, 2021
391cbb7
Merkle User ID Module: updates to user id submodule (#6503)
SKOCHERI Apr 3, 2021
40c85ca
AdKernel Bid/Analytics Adapters: user privacy related changes (#6488)
ckbo3hrk Apr 5, 2021
7a7af27
SynacorMedia: remove adId from the bid response (#6520)
rajcspsg Apr 5, 2021
e519ead
Rubicon: making doc data types consistent (#6526)
bretg Apr 5, 2021
e8b02b9
Synacormedia Bid Adapter: add meta.advertiserDomains (#6527)
rajcspsg Apr 5, 2021
25ba111
Adloox Analytics Adapter: add new analytics adapter (#6308)
jimdigriz Apr 5, 2021
8aed380
Seedtag adapter: Fixing bug preventing to receive the right params on…
lauramorillo Apr 6, 2021
55831de
adot bid adapter: add publisher path from bidder config to endpoint u…
Giudici-a Apr 6, 2021
ac5c107
Admixer ID System: add userId submodule (#6238)
Galphimbl Apr 6, 2021
42e1c66
PBJS Core: call custom render func after loadscript if provided (#6422)
jeremiegirault Apr 6, 2021
e35140a
Pubxai Analytics Adapter: bug fixes and code revamp (#6474)
pnhegde Apr 6, 2021
a265241
PBJS Core: canBidderRegisterSync ignoring iframe sync disabled by def…
patmmccann Apr 7, 2021
a7ab978
Added automatic tzo and targetId to adserver request. (#6534)
mikael-lundin Apr 7, 2021
c3ee6f9
Impactify Bid Adapter: add new bid adapter (#6518)
thomasdseao Apr 7, 2021
1157b6d
Prebid 4.34.0 Release
Apr 7, 2021
71518cd
Increment pre version
Apr 7, 2021
35de47d
Prebid server adapter: add config for openx hosting (#6530)
deivydas Apr 8, 2021
955c472
Yieldmo adapter: add meta data to bids (#6550)
ym-atsymuk Apr 8, 2021
927496e
Smartx Bid Adapter: Add meta.advertiserDomains support (#6547)
Skylinar Apr 8, 2021
26a5462
Onevideo / Adap.tv Adapter: updated example configuration (#6546)
adam-browning Apr 8, 2021
87a6b47
Mass Deal Rendering Module: support multiple custom configs for dealI…
cciocov Apr 9, 2021
7e43042
ZetaSsp Bid Adapter: add new bid adapter (#6432)
asurovenko-zeta Apr 9, 2021
05c568c
Adnuntius Bid Adapter: Fix for bid too low. (#6557)
mikael-lundin Apr 9, 2021
37f803c
ReadPeak Bid Adapter: fix api issues, add gdpr consent, & getfloor mo…
readpeaktuomo Apr 9, 2021
195572d
BetweenBidAdatper: added sharedid support (#6531)
ignat-one Apr 9, 2021
b9f9f88
adWMG Bid Adapter: update endpoints for cookie sync (#6544)
nyakove Apr 9, 2021
32a74f7
Yieldmo Bid Adapter: add support for the floors module (#6541)
ym-dlabuzov Apr 9, 2021
81139c4
Sortable Bid Adapter: add eids support (#6565)
karentnarvaez Apr 10, 2021
c50694b
Outbrain Bid Adapter: replacing Zemanta (#6558)
Apr 10, 2021
81546c8
Sirdata Real-time Data Module: add new RTD module (#6515)
nouchy Apr 10, 2021
67de22f
Logicad Bid Adapter: add support for userid modules (#6529)
logicad Apr 12, 2021
4297d45
ATS-identityLinkIdSystem - add use3P config property to control firin…
mamatic Apr 12, 2021
8ce416a
Proxistore Bid Adapter: add support for tcf v2 consent (#6543)
vincentproxistore Apr 12, 2021
df0d4dd
BlueBillyWig Bid Adapter: add renderer customization options (#6540)
K-JBoon Apr 12, 2021
d911c0f
OpenX Bid Adapter: Set Deal ID for video requests (#6573)
kenan-gillet Apr 12, 2021
87a3338
33Across Bid Adapter: add support for User ID modules (#6554)
curlyblueeagle Apr 12, 2021
62ea47c
pubGENIUS bid adapter: support floor module (#6555)
edmonl Apr 12, 2021
36d211a
Welect Bid Adapter: update url of API (#6570)
nduitz Apr 13, 2021
2794ce9
Bright Mountain Media Bid Adapter: change bidder code to bmtm; alias …
Apr 13, 2021
df6cf9a
Adtelligent Bid Adapter: add adUrl support & new alias (#6559)
GeneGenie Apr 13, 2021
28cd35a
Bright Mountain Media Bid Adapter: Change Endpoint URL (#6576)
Apr 13, 2021
587a5f6
tappxBidAdapter: update
Mar 24, 2021
dee1db6
tasppxBidAdapter: add video
Apr 9, 2021
96ef7f5
tappxBidAdapter: update video
Apr 12, 2021
62753cd
tappxBidAdapter: update name interpret banner
Apr 13, 2021
036265f
tappxBidAdapter: add tests for video
Apr 13, 2021
6a5fcfa
tappxBidAdapter: add adomain
Apr 13, 2021
29cb756
tappxBidAdapter: update adapter version
Apr 13, 2021
1f3cd3e
tappxBidAdapter: update interpretBid adomain and dealid
Apr 13, 2021
3aa5068
tappxBidAdapter: update isBidRequestValid
Apr 13, 2021
b78f0ab
tappxBidAdapter: update tests. Adding video to isBidRequestValid
Apr 13, 2021
0b6ddf3
tappxBidAdapter: update doc .md file
Apr 13, 2021
454881a
Merge branch 'master' of https://github.com/prebid/Prebid.js
prebidtappx Apr 14, 2021
a4ddb4a
Merge remote-tracking branch 'prebid/master'
agrandes-tappx Apr 14, 2021
5b6382f
Tappx - Change accept floor module
agrandes-tappx Apr 19, 2021
c587fce
Merge remote-tracking branch 'prebid/master' into tappx-module-floors
agrandes-tappx Apr 19, 2021
4798907
Tappx - feature simplification
agrandes-tappx Apr 20, 2021
582f0df
Tappx - remove log
agrandes-tappx Apr 20, 2021
e8076bf
Change version
agrandes-tappx Apr 20, 2021
0d6375a
Merge branch 'master' of https://github.com/prebid/Prebid.js into tap…
agrandes-tappx Apr 23, 2021
c9ce240
Try to unrevert bad merge change
agrandes-tappx Apr 23, 2021
5c39065
Tappx - prebid recomendations and changes
agrandes-tappx Apr 27, 2021
0901cf5
Tappx - CircleCI hotfixes
agrandes-tappx Apr 27, 2021
267bf23
Tappx - Non important fix
agrandes-tappx Apr 28, 2021
2a9e2f5
Tappx - Test Coverage
agrandes-tappx Apr 28, 2021
531a416
Merge branch 'master' into tappx-module-floors
prebidtappx Apr 28, 2021
9f84234
Merge branch 'tappx-module-floors' of https://github.com/prebidtappx/…
agrandes-tappx Apr 28, 2021
09cef37
Tappx - CircleCI hotfixes
agrandes-tappx Apr 28, 2021
f945919
Tappx - Only USD allowed in module floor + test
agrandes-tappx May 4, 2021
f688106
Tappx - aesthetic change for uniformity of logs
agrandes-tappx May 4, 2021
c14a05b
Tappx - CircleCI hotfixes
agrandes-tappx May 4, 2021
7145f2c
Tappx - remove don't used module
agrandes-tappx May 5, 2021
4599fb6
Tappx - Change the place and only one let
agrandes-tappx May 5, 2021
6de9007
Tappx - use of beforeEach
agrandes-tappx May 5, 2021
9009fd6
Tappx - CircleCI hotfixes
agrandes-tappx May 5, 2021
93b95cc
Merge branch 'master' of https://github.com/prebid/Prebid.js into tap…
agrandes-tappx May 6, 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
26 changes: 21 additions & 5 deletions modules/tappxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { config } from '../src/config.js';
const BIDDER_CODE = 'tappx';
const TTL = 360;
const CUR = 'USD';
const TAPPX_BIDDER_VERSION = '0.1.10413';
const TAPPX_BIDDER_VERSION = '0.1.10420';
const TYPE_CNN = 'prebidjs';
const VIDEO_SUPPORT = ['instream'];

Expand Down Expand Up @@ -262,11 +262,29 @@ function buildOneRequest(validBidRequests, bidderRequest) {
imp.secure = 1;

imp.bidfloor = utils.deepAccess(validBidRequests, 'params.bidfloor');
if (utils.isFn(validBidRequests.getFloor)) {
try {
let floor = validBidRequests.getFloor({
currency: CUR,
mediaType: '*',
size: '*'
});
if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
imp.bidfloor = floor.floor;
} else {
utils.logWarn('[TAPPX]: ', 'Currency not valid. Use only USD with Tappx.');
}
} catch (e) {
utils.logWarn('[TAPPX]: ', e);
imp.bidfloor = utils.deepAccess(validBidRequests, 'params.bidfloor'); // Be sure that we have an imp.bidfloor
}
}

let bidder = {};
bidder.tappxkey = TAPPXKEY;
bidder.endpoint = ENDPOINT;
bidder.host = hostInfo.url;
bidder.bidfloor = BIDFLOOR;
bidder.ext = (typeof BIDEXTRA == 'object') ? BIDEXTRA : undefined;

imp.ext = {};
Expand Down Expand Up @@ -338,9 +356,7 @@ function buildOneRequest(validBidRequests, bidderRequest) {
payload.params = params;
payload.regs = regs;
// < Payload
utils.logMessage('---------------------');
utils.logMessage(JSON.stringify(payload));
utils.logMessage('---------------------');

return {
method: 'POST',
url: `https://${HOST}/${ENDPOINT}?type_cnn=${TYPE_CNN}&v=${TAPPX_BIDDER_VERSION}`,
Expand All @@ -365,7 +381,7 @@ function getHostInfo(hostParam) {
domainInfo.domain = hostParam.split('/', 1)[0];
domainInfo.url = hostParam;

let regexNewEndpoints = new RegExp(`^(zz.*|testing)\.ssp\.tappx\.com$`, 'i');
let regexNewEndpoints = new RegExp(`^(vz.*|zz.*|testing)\.ssp\.tappx\.com$`, 'i');
let regexClassicEndpoints = new RegExp(`^[a-z]{3}\.[a-z]{3}\.tappx\.com$`, 'i');

if (regexNewEndpoints.test(domainInfo.domain)) {
Expand Down
39 changes: 39 additions & 0 deletions test/spec/modules/tappxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,43 @@ describe('Tappx bid adapter', function () {
expect(consent[0].url).to.match(/&type=iframe/);
});
})

describe('module Floor implementation', function() {
let getFloorResponse, bidderRequest_f;
beforeEach(function() {
getFloorResponse = {};
bidderRequest_f = c_BIDREQUEST;
})
it('should correctly send hard floors when getFloor function is present and returns valid floor', function () {
// default getFloor response is empty object so should not break and not send hard_floor
bidderRequest_f.bids[0].getFloor = () => getFloorResponse;
let request = spec.buildRequests(bidderRequest_f.bids, bidderRequest_f);
let payload;

getFloorResponse = undefined;
request = spec.buildRequests(bidderRequest_f.bids, bidderRequest_f);

// without Module floor
payload = JSON.parse(request[0].data);
expect(payload.imp[0].bidfloor).to.equal(0.05);

// make it respond with USD floor and string floor
getFloorResponse = {currency: 'USD', floor: '1.23'};
request = spec.buildRequests(bidderRequest_f.bids, bidderRequest_f);
payload = JSON.parse(request[0].data);
expect(payload.imp[0].bidfloor).to.equal('1.23');

// make it respond with EUR floor (not valid)
getFloorResponse = {currency: 'EUR', floor: '1.23'};
request = spec.buildRequests(bidderRequest_f.bids, bidderRequest_f);
payload = JSON.parse(request[0].data);
expect(payload.imp[0].bidfloor).to.equal(0.05); // Default value from tappx/bidder bidfloor

// make it respond with USD floor and num floor
getFloorResponse = {currency: 'USD', floor: 1.23};
request = spec.buildRequests(bidderRequest_f.bids, bidderRequest_f);
payload = JSON.parse(request[0].data);
expect(payload.imp[0].bidfloor).to.equal(1.23);
});
})
});