Skip to content

Limelight Digital Bid Adapter: added new custom fields for targeting #9436

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

Merged
merged 4 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 9 additions & 3 deletions modules/limelightDigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ export const spec = {
winTop = window;
}
const placements = groupBy(validBidRequests.map(bidRequest => buildPlacement(bidRequest)), 'host')
return Object.keys(placements)
let map = Object.keys(placements)
.map(host => buildRequest(winTop, host, placements[host].map(placement => placement.adUnit)));
return map;
},

/**
Expand Down Expand Up @@ -113,7 +114,7 @@ export const spec = {

registerBidder(spec);

function buildRequest(winTop, host, adUnits) {
function buildRequest(winTop, host, adUnits, bidRequest) {
return {
method: 'POST',
url: `https://${host}/hb`,
Expand Down Expand Up @@ -158,7 +159,12 @@ function buildPlacement(bidRequest) {
type: bidRequest.params.adUnitType.toUpperCase(),
publisherId: bidRequest.params.publisherId,
userIdAsEids: bidRequest.userIdAsEids,
supplyChain: bidRequest.schain
supplyChain: bidRequest.schain,
custom1: bidRequest.params.custom1,
custom2: bidRequest.params.custom2,
custom3: bidRequest.params.custom3,
custom4: bidRequest.params.custom4,
custom5: bidRequest.params.custom5
}
}
}
14 changes: 12 additions & 2 deletions modules/limelightDigitalBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ var adUnits = [{
params: {
host: 'exchange-9qao.ortb.net',
adUnitId: 0,
adUnitType: 'banner'
adUnitType: 'banner',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
}
}]
}];
Expand All @@ -40,7 +45,12 @@ var videoAdUnit = [{
params: {
host: 'exchange-9qao.ortb.net',
adUnitId: 0,
adUnitType: 'video'
adUnitType: 'video',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
}
}]
}];
Expand Down
40 changes: 35 additions & 5 deletions test/spec/modules/limelightDigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ describe('limelightDigitalAdapter', function () {
host: 'exchange.ortb.net',
adUnitId: 123,
adUnitType: 'banner',
publisherId: 'perfectPublisher'
publisherId: 'perfectPublisher',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
},
placementCode: 'placement_0',
auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2',
Expand Down Expand Up @@ -49,7 +54,12 @@ describe('limelightDigitalAdapter', function () {
params: {
host: 'ads.project-limelight.com',
adUnitId: 456,
adUnitType: 'banner'
adUnitType: 'banner',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
},
placementCode: 'placement_1',
auctionId: '482f88de-29ab-45c8-981a-d25e39454a34',
Expand Down Expand Up @@ -90,7 +100,12 @@ describe('limelightDigitalAdapter', function () {
host: 'exchange.ortb.net',
adUnitId: 789,
adUnitType: 'video',
publisherId: 'secondPerfectPublisher'
publisherId: 'secondPerfectPublisher',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
},
placementCode: 'placement_2',
auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
Expand Down Expand Up @@ -128,7 +143,12 @@ describe('limelightDigitalAdapter', function () {
params: {
host: 'exchange.ortb.net',
adUnitId: 789,
adUnitType: 'video'
adUnitType: 'video',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
custom5: 'custom5'
},
placementCode: 'placement_2',
auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
Expand Down Expand Up @@ -196,7 +216,12 @@ describe('limelightDigitalAdapter', function () {
'transactionId',
'publisherId',
'userIdAsEids',
'supplyChain'
'supplyChain',
'custom1',
'custom2',
'custom3',
'custom4',
'custom5'
);
expect(adUnit.id).to.be.a('number');
expect(adUnit.bidId).to.be.a('string');
Expand All @@ -205,6 +230,11 @@ describe('limelightDigitalAdapter', function () {
expect(adUnit.sizes).to.be.an('array');
expect(adUnit.userIdAsEids).to.be.an('array');
expect(adUnit.supplyChain).to.be.an('object');
expect(adUnit.custom1).to.be.a('string');
expect(adUnit.custom2).to.be.a('string');
expect(adUnit.custom3).to.be.a('string');
expect(adUnit.custom4).to.be.a('string');
expect(adUnit.custom5).to.be.a('string');
})
})
})
Expand Down