Skip to content

Commit

Permalink
showheroes-bs Bid Adapter: refactoring + fix test (prebid#7882)
Browse files Browse the repository at this point in the history
* 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 (prebid#4222)

* ShowHeroes adapter - banner and outstream fixes (prebid#4222)

* ShowHeroes adapter - description and outstream changes (prebid#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]>
  • Loading branch information
3 people authored and Chris Pabst committed Jan 10, 2022
1 parent e12fdb3 commit 2048b4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modules/showheroes-bsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,24 @@ export const spec = {
}
}

const consentData = bidderRequest.gdprConsent || {};

const gdprConsent = {
apiVersion: consentData.apiVersion || 2,
gdprApplies: consentData.gdprApplies || 0,
consentString: consentData.consentString || '',
}

return {
type: streamType,
adUnitCode: bid.adUnitCode,
bidId: bid.bidId,
mediaType: type,
context: context,
playerId: getBidIdParameter('playerId', bid.params),
auctionId: bidderRequest.auctionId,
bidderCode: BIDDER_CODE,
gdprConsent: bidderRequest.gdprConsent,
gdprConsent: gdprConsent,
start: +new Date(),
timeout: 3000,
size: {
Expand Down Expand Up @@ -159,6 +168,7 @@ function createBids(bidRes, reqData) {
let bidUnit = {};
bidUnit.cpm = bid.cpm;
bidUnit.requestId = bid.bidId;
bidUnit.adUnitCode = reqBid.adUnitCode;
bidUnit.currency = bid.currency;
bidUnit.mediaType = bid.mediaType || VIDEO;
bidUnit.ttl = TTL;
Expand All @@ -183,7 +193,8 @@ function createBids(bidRes, reqData) {
} else if (bid.context === 'outstream') {
const renderer = Renderer.install({
id: bid.bidId,
url: '//',
url: 'https://static.showheroes.com/renderer.js',
adUnitCode: reqBid.adUnitCode,
config: {
playerId: reqBid.playerId,
width: bid.size.width,
Expand Down
2 changes: 2 additions & 0 deletions test/spec/modules/showheroes-bsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const adomain = ['showheroes.com'];

const gdpr = {
'gdprConsent': {
'apiVersion': 2,
'consentString': 'BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA',
'gdprApplies': true
}
Expand Down Expand Up @@ -332,6 +333,7 @@ describe('shBidAdapter', function () {
{
'cpm': 5,
'creativeId': 'c_38b373e1e31c18',
'adUnitCode': 'adunit-code-1',
'currency': 'EUR',
'width': 640,
'height': 480,
Expand Down

0 comments on commit 2048b4a

Please sign in to comment.