Skip to content

Commit

Permalink
Limelight Digital Bid Adapter: added new custom fields for targeting (p…
Browse files Browse the repository at this point in the history
…rebid#9436)

* Added new custom fields (#2)

* Fixed integration

* Fixes after review

* Fixes after review

---------

Co-authored-by: RuzannaAvetisyan <44729750+RuzannaAvetisyan@users.noreply.github.com>
Co-authored-by: apykhteyev <alex@project-limelight.com>
  • Loading branch information
3 people authored Feb 8, 2023
1 parent c5f6221 commit 0442955
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 8 deletions.
7 changes: 6 additions & 1 deletion modules/limelightDigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,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

0 comments on commit 0442955

Please sign in to comment.