From efb3fb3bd78e73e57556b4910c08c8b54960b86a Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Jul 2019 09:36:57 -0700 Subject: [PATCH] Update endpoint for Sharethrough adapter (#4029) * 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 * 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 --- modules/sharethroughBidAdapter.js | 13 +++++++++++-- test/spec/modules/sharethroughBidAdapter_spec.js | 14 +++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 8c0c98bceae..a7a64e0bda3 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -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 = { @@ -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) { diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index 825e42273cf..d8feac3d0a2 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' @@ -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'); });