Skip to content

Commit

Permalink
Prebid.js - Update bid Response to use actual creativeID (#25)
Browse files Browse the repository at this point in the history
* update bid Response to use actual creativeID

* update spec

* fix nomencalature based on Kargo's service
  • Loading branch information
sj1815 authored Feb 28, 2024
1 parent 14eec2e commit b20c7b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function interpretResponse(response, bidRequest) {
width: adUnit.width,
height: adUnit.height,
ttl: 300,
creativeId: adUnit.id,
creativeId: adUnit.creativeID,
dealId: adUnit.targetingCustom,
netRevenue: true,
currency: adUnit.currency || bidRequest.currency,
Expand Down
24 changes: 15 additions & 9 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ describe('kargo adapter tests', function () {
adm: '<div id="1"></div>',
width: 320,
height: 50,
metadata: {}
metadata: {},
creativeId: 'bar'
},
2: {
id: 'bar',
Expand All @@ -736,14 +737,16 @@ describe('kargo adapter tests', function () {
targetingCustom: 'dmpmptest1234',
metadata: {
landingPageDomain: ['https://foobar.com']
}
},
creativeId: 'foo'
},
3: {
id: 'bar',
cpm: 2.5,
adm: '<div id="2"></div>',
width: 300,
height: 250
height: 250,
creativeId: 'foo'
},
4: {
id: 'bar',
Expand All @@ -753,6 +756,7 @@ describe('kargo adapter tests', function () {
height: 250,
mediaType: 'banner',
metadata: {},
creativeId: 'foo',
currency: 'EUR'
},
5: {
Expand All @@ -763,6 +767,7 @@ describe('kargo adapter tests', function () {
height: 250,
mediaType: 'video',
metadata: {},
creativeId: 'foo',
currency: 'EUR'
},
6: {
Expand All @@ -774,6 +779,7 @@ describe('kargo adapter tests', function () {
height: 250,
mediaType: 'video',
metadata: {},
creativeId: 'foo',
currency: 'EUR'
}
}
Expand Down Expand Up @@ -818,7 +824,7 @@ describe('kargo adapter tests', function () {
width: 320,
height: 50,
ttl: 300,
creativeId: 'foo',
creativeId: 'bar',
dealId: undefined,
netRevenue: true,
currency: 'USD',
Expand All @@ -833,7 +839,7 @@ describe('kargo adapter tests', function () {
width: 300,
height: 250,
ttl: 300,
creativeId: 'bar',
creativeId: 'foo',
dealId: 'dmpmptest1234',
netRevenue: true,
currency: 'USD',
Expand All @@ -850,7 +856,7 @@ describe('kargo adapter tests', function () {
width: 300,
height: 250,
ttl: 300,
creativeId: 'bar',
creativeId: 'foo',
dealId: undefined,
netRevenue: true,
currency: 'USD',
Expand All @@ -865,7 +871,7 @@ describe('kargo adapter tests', function () {
width: 300,
height: 250,
ttl: 300,
creativeId: 'bar',
creativeId: 'foo',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
Expand All @@ -880,7 +886,7 @@ describe('kargo adapter tests', function () {
height: 250,
vastXml: '<VAST></VAST>',
ttl: 300,
creativeId: 'bar',
creativeId: 'foo',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
Expand All @@ -895,7 +901,7 @@ describe('kargo adapter tests', function () {
height: 250,
vastUrl: 'https://foobar.com/vast_adm',
ttl: 300,
creativeId: 'bar',
creativeId: 'foo',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
Expand Down

0 comments on commit b20c7b3

Please sign in to comment.