Skip to content

Commit b61cbfb

Browse files
yaiza-tappxJordi Arnaujordi-tappxYaiza Fernández
authored
Tappx Adapter Fix: obtain Adomain from response and add test (prebid#14113)
* Feature: added obtention of gpid, divid and other information and adding tests * Fix: obtain Adomain from response and add test --------- Co-authored-by: Jordi Arnau <jarnau@tappx.com> Co-authored-by: jordi-tappx <jarnau@techsoulogy.com> Co-authored-by: Yaiza Fernández <yfernandez@tappx.com>
1 parent e9c38e4 commit b61cbfb

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

modules/tappxBidAdapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const BIDDER_CODE = 'tappx';
1616
const GVLID_CODE = 628;
1717
const TTL = 360;
1818
const CUR = 'USD';
19-
const TAPPX_BIDDER_VERSION = '0.1.4';
19+
const TAPPX_BIDDER_VERSION = '0.1.5';
2020
const TYPE_CNN = 'prebidjs';
2121
const LOG_PREFIX = '[TAPPX]: ';
2222
const VIDEO_SUPPORT = ['instream', 'outstream'];
@@ -209,6 +209,7 @@ function interpretBid(serverBid, request) {
209209
if (typeof serverBid.lurl !== 'undefined') { bidReturned.lurl = serverBid.lurl }
210210
if (typeof serverBid.nurl !== 'undefined') { bidReturned.nurl = serverBid.nurl }
211211
if (typeof serverBid.burl !== 'undefined') { bidReturned.burl = serverBid.burl }
212+
if (typeof serverBid.adomain !== 'undefined') { bidReturned.adomain = serverBid.adomain }
212213

213214
if (typeof request.bids?.mediaTypes !== 'undefined' && typeof request.bids?.mediaTypes.video !== 'undefined') {
214215
bidReturned.vastXml = serverBid.adm;
@@ -231,7 +232,7 @@ function interpretBid(serverBid, request) {
231232
}
232233

233234
if (typeof bidReturned.adomain !== 'undefined' || bidReturned.adomain !== null) {
234-
bidReturned.meta = { advertiserDomains: request.bids?.adomain };
235+
bidReturned.meta = { advertiserDomains: bidReturned.adomain };
235236
}
236237

237238
return bidReturned;

test/spec/modules/tappxBidAdapter_spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const c_SERVERRESPONSE_B = {
8181
cid: '01744fbb521e9fb10ffea926190effea',
8282
crid: 'a13cf884e66e7c660afec059c89d98b6',
8383
adomain: [
84+
'adomain.com'
8485
],
8586
},
8687
],
@@ -112,6 +113,7 @@ const c_SERVERRESPONSE_V = {
112113
cid: '01744fbb521e9fb10ffea926190effea',
113114
crid: 'a13cf884e66e7c660afec059c89d98b6',
114115
adomain: [
116+
'adomain.com'
115117
],
116118
},
117119
],
@@ -385,6 +387,16 @@ describe('Tappx bid adapter', function () {
385387
const bids = spec.interpretResponse(emptyServerResponse, c_BIDDERREQUEST_B);
386388
expect(bids).to.have.lengthOf(0);
387389
});
390+
391+
it('receive reponse with adomain', function () {
392+
const bids_B = spec.interpretResponse(c_SERVERRESPONSE_B, c_BIDDERREQUEST_B);
393+
const bid_B = bids_B[0];
394+
expect(bid_B.meta.advertiserDomains).to.deep.equal(['adomain.com']);
395+
396+
const bids_V = spec.interpretResponse(c_SERVERRESPONSE_V, c_BIDDERREQUEST_V);
397+
const bid_V = bids_V[0];
398+
expect(bid_V.meta.advertiserDomains).to.deep.equal(['adomain.com']);
399+
});
388400
});
389401

390402
/**

0 commit comments

Comments
 (0)