Skip to content

Commit 9e5db16

Browse files
vadim-mazzherinveraneverah2p4x8
authored
showheroes-bs Bid Adapter: refactoring + fix test (#7882)
* add ShowHeroes Adapter * ShowHeroes adapter - expanded outstream support * Revert "ShowHeroes adapter - expanded outstream support" This reverts commit bfcdb91. * ShowHeroes adapter - expanded outstream support * ShowHeroes adapter - fixes (#4222) * ShowHeroes adapter - banner and outstream fixes (#4222) * ShowHeroes adapter - description and outstream changes (#4222) * ShowHeroes adapter - increase test coverage and small fix * ShowHeroes Adapter - naming convention issue * Mixed AdUnits declaration support * ITDEV-4723 PrebidJS adapter support with SupplyChain module object * ITDEV-4723 Fix tests * ITDEV-4723 New entry point * showheroes-bsBidAdapter: Add support for advertiserDomains * showheroes-bsBidAdapter: hotfix for outstream render * showheroes-bsBidAdapter: update renderer url * showheroes-bsBidAdapter: use only the necessary fields from the gdprConsent Co-authored-by: veranevera <[email protected]> Co-authored-by: Elizaveta Voziyanova <[email protected]>
1 parent 0e501a6 commit 9e5db16

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

modules/showheroes-bsBidAdapter.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,24 @@ export const spec = {
6161
}
6262
}
6363

64+
const consentData = bidderRequest.gdprConsent || {};
65+
66+
const gdprConsent = {
67+
apiVersion: consentData.apiVersion || 2,
68+
gdprApplies: consentData.gdprApplies || 0,
69+
consentString: consentData.consentString || '',
70+
}
71+
6472
return {
6573
type: streamType,
74+
adUnitCode: bid.adUnitCode,
6675
bidId: bid.bidId,
6776
mediaType: type,
6877
context: context,
6978
playerId: getBidIdParameter('playerId', bid.params),
7079
auctionId: bidderRequest.auctionId,
7180
bidderCode: BIDDER_CODE,
72-
gdprConsent: bidderRequest.gdprConsent,
81+
gdprConsent: gdprConsent,
7382
start: +new Date(),
7483
timeout: 3000,
7584
size: {
@@ -159,6 +168,7 @@ function createBids(bidRes, reqData) {
159168
let bidUnit = {};
160169
bidUnit.cpm = bid.cpm;
161170
bidUnit.requestId = bid.bidId;
171+
bidUnit.adUnitCode = reqBid.adUnitCode;
162172
bidUnit.currency = bid.currency;
163173
bidUnit.mediaType = bid.mediaType || VIDEO;
164174
bidUnit.ttl = TTL;
@@ -183,7 +193,8 @@ function createBids(bidRes, reqData) {
183193
} else if (bid.context === 'outstream') {
184194
const renderer = Renderer.install({
185195
id: bid.bidId,
186-
url: '//',
196+
url: 'https://static.showheroes.com/renderer.js',
197+
adUnitCode: reqBid.adUnitCode,
187198
config: {
188199
playerId: reqBid.playerId,
189200
width: bid.size.width,

test/spec/modules/showheroes-bsBidAdapter_spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const adomain = ['showheroes.com'];
1313

1414
const gdpr = {
1515
'gdprConsent': {
16+
'apiVersion': 2,
1617
'consentString': 'BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA',
1718
'gdprApplies': true
1819
}
@@ -332,6 +333,7 @@ describe('shBidAdapter', function () {
332333
{
333334
'cpm': 5,
334335
'creativeId': 'c_38b373e1e31c18',
336+
'adUnitCode': 'adunit-code-1',
335337
'currency': 'EUR',
336338
'width': 640,
337339
'height': 480,

0 commit comments

Comments
 (0)