Skip to content

Commit

Permalink
Update endpoint for Sharethrough adapter (prebid#4029)
Browse files Browse the repository at this point in the history
* Add HTML5 video support param to bid requests

* Use const instead of var for consistency

* Update supported sizes

- Default size returned changed from 0x0 to 1x1 to support PrebidServer
- Now will always respect the bid sizes supported when configured

Co-authored-by: Josh Becker <jbecker@sharethrough.com>

* Update maintainer contact email

* Support Prebid.js User ID module

- Add support for Unified ID solution of User ID module by
  checking for `bidRequest.userId.tdid` param in `buildRequests`
  method of Sharethrough's adapter
- Update specs, maintain 80%+ code coverage

* Update logic for changing userAgent string in tests

* Add 3 pbjs callbacks to the adapter

* Add comments on empty implementations

* Update Sharethrough endpoint
  • Loading branch information
madma authored and sa1omon committed Nov 28, 2019
1 parent 1e2a548 commit efb3fb3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
13 changes: 11 additions & 2 deletions modules/sharethroughBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { registerBidder } from '../src/adapters/bidderFactory';

const VERSION = '3.0.1';
const BIDDER_CODE = 'sharethrough';
const STR_ENDPOINT = document.location.protocol + '//btlr.sharethrough.com/header-bid/v1';
const STR_ENDPOINT = document.location.protocol + '//btlr.sharethrough.com/WYu2BXv1/v1';
const DEFAULT_SIZE = [1, 1];

export const sharethroughAdapterSpec = {
Expand Down Expand Up @@ -92,7 +92,16 @@ export const sharethroughAdapterSpec = {
}

return syncs;
}
},

// Empty implementation for prebid core to be able to find it
onTimeout: (data) => {},

// Empty implementation for prebid core to be able to find it
onBidWon: (bid) => {},

// Empty implementation for prebid core to be able to find it
onSetTargeting: (bid) => {}
}

function getLargestSize(sizes) {
Expand Down
14 changes: 7 additions & 7 deletions test/spec/modules/sharethroughBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const bidRequests = [
const prebidRequests = [
{
method: 'GET',
url: document.location.protocol + '//btlr.sharethrough.com' + '/header-bid/v1',
url: document.location.protocol + '//btlr.sharethrough.com' + '/WYu2BXv1/v1',
data: {
bidId: 'bidId',
placement_key: 'pKey'
Expand All @@ -52,7 +52,7 @@ const prebidRequests = [
},
{
method: 'GET',
url: document.location.protocol + '//btlr.sharethrough.com' + '/header-bid/v1',
url: document.location.protocol + '//btlr.sharethrough.com' + '/WYu2BXv1/v1',
data: {
bidId: 'bidId',
placement_key: 'pKey'
Expand All @@ -64,7 +64,7 @@ const prebidRequests = [
},
{
method: 'GET',
url: document.location.protocol + '//btlr.sharethrough.com' + '/header-bid/v1',
url: document.location.protocol + '//btlr.sharethrough.com' + '/WYu2BXv1/v1',
data: {
bidId: 'bidId',
placement_key: 'pKey'
Expand All @@ -77,7 +77,7 @@ const prebidRequests = [
},
{
method: 'GET',
url: document.location.protocol + '//btlr.sharethrough.com' + '/header-bid/v1',
url: document.location.protocol + '//btlr.sharethrough.com' + '/WYu2BXv1/v1',
data: {
bidId: 'bidId',
placement_key: 'pKey'
Expand All @@ -89,7 +89,7 @@ const prebidRequests = [
},
{
method: 'GET',
url: document.location.protocol + '//btlr.sharethrough.com' + '/header-bid/v1',
url: document.location.protocol + '//btlr.sharethrough.com' + '/WYu2BXv1/v1',
data: {
bidId: 'bidId',
placement_key: 'pKey'
Expand Down Expand Up @@ -174,9 +174,9 @@ describe('sharethrough adapter spec', function () {
const builtBidRequests = spec.buildRequests(bidRequests);

expect(builtBidRequests[0].url).to.eq(
'http://btlr.sharethrough.com/header-bid/v1');
'http://btlr.sharethrough.com/WYu2BXv1/v1');
expect(builtBidRequests[1].url).to.eq(
'http://btlr.sharethrough.com/header-bid/v1')
'http://btlr.sharethrough.com/WYu2BXv1/v1')
expect(builtBidRequests[0].method).to.eq('GET');
});

Expand Down

0 comments on commit efb3fb3

Please sign in to comment.