Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-87: Implement Prebid Adapter - remove BT specific logic #7

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions modules/BTBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { ortbConverter } from '../libraries/ortbConverter/converter.js';

const BIDDER_CODE = 'blockthrough';
const GVLID = 815;
const ENDPOINT_URL = 'https://pbs.btloader.com/openrtb2/auction';
const SYNC_URL = 'https://cdn.btloader.com/user_sync.html';
// reach out for approval to marketing@blockthrough.com
const ENDPOINT_URL = 'https://pbs.sample.com';
const SYNC_URL = 'https://cdn.sample.com';

const CONVERTER = ortbConverter({
context: {
Expand All @@ -32,16 +33,7 @@ function imp(buildImp, bidRequest, context) {
const { params, ortb2Imp } = bidRequest;

if (params) {
const { blockthrough, ...btBidderParams } = params;

deepSetValue(imp, 'ext', btBidderParams);
if (blockthrough?.auctionID) {
deepSetValue(
imp,
'ext.prebid.blockthrough.auctionID',
blockthrough.auctionID
);
}
deepSetValue(imp, 'ext', params);
}
if (ortb2Imp?.ext.gpid) {
deepSetValue(imp, 'gpid', ortb2Imp.ext.gpid);
Expand Down
2 changes: 1 addition & 1 deletion modules/BTBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The BT adapter requires setup and approval from the Blockthrough team. Please re

# Bidder Config

Make sure to set ab, orgID, websiteID values received after approval using `pbjs.setBidderConfig`.
Make sure to set required ab, orgID, websiteID values received after approval using `pbjs.setBidderConfig`.

## Example

Expand Down
10 changes: 2 additions & 8 deletions test/spec/modules/BTBidAdapte_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ import 'modules/gppControl_usnat.js';
import 'modules/schain.js';

describe('BT Bid Adapter', () => {
const ENDPOINT_URL = 'https://pbs.btloader.com/openrtb2/auction';
const ENDPOINT_URL = 'https://pbs.sample.com';
const validBidRequests = [
{
bidId: '2e9f38ea93bb9e',
bidder: 'blockthrough',
adUnitCode: 'adunit-code',
mediaTypes: { [BANNER]: { sizes: [[300, 250]] } },
params: {
blockthrough: {
auctionID: 'auctionID',
},
bidderA: {
pubId: '11111',
},
Expand Down Expand Up @@ -78,9 +75,6 @@ describe('BT Bid Adapter', () => {
bidderA: {
pubId: '11111',
},
prebid: {
blockthrough: { auctionID: 'auctionID' },
},
};

const requests = spec.buildRequests(validBidRequests, bidderRequest);
Expand Down Expand Up @@ -152,7 +146,7 @@ describe('BT Bid Adapter', () => {
});

describe('getUserSyncs', () => {
const SYNC_URL = 'https://cdn.btloader.com/user_sync.html';
const SYNC_URL = 'https://cdn.sample.com/';

it('should return an empty array if no sync options are provided', () => {
const syncs = spec.getUserSyncs({}, [], null, null, null);
Expand Down