From b20c7b39ffc4c170eb7f0f49ea59c7aeabd706a4 Mon Sep 17 00:00:00 2001 From: Saurabh Joshi <43156540+sj1815@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:14:28 -0500 Subject: [PATCH] Prebid.js - Update bid Response to use actual creativeID (#25) * update bid Response to use actual creativeID * update spec * fix nomencalature based on Kargo's service --- modules/kargoBidAdapter.js | 2 +- test/spec/modules/kargoBidAdapter_spec.js | 24 ++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/modules/kargoBidAdapter.js b/modules/kargoBidAdapter.js index 9d8c7bc06a1..20bde9f27fd 100644 --- a/modules/kargoBidAdapter.js +++ b/modules/kargoBidAdapter.js @@ -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, diff --git a/test/spec/modules/kargoBidAdapter_spec.js b/test/spec/modules/kargoBidAdapter_spec.js index f43c3b11aac..0a8c9d84deb 100644 --- a/test/spec/modules/kargoBidAdapter_spec.js +++ b/test/spec/modules/kargoBidAdapter_spec.js @@ -725,7 +725,8 @@ describe('kargo adapter tests', function () { adm: '
', width: 320, height: 50, - metadata: {} + metadata: {}, + creativeId: 'bar' }, 2: { id: 'bar', @@ -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: '', width: 300, - height: 250 + height: 250, + creativeId: 'foo' }, 4: { id: 'bar', @@ -753,6 +756,7 @@ describe('kargo adapter tests', function () { height: 250, mediaType: 'banner', metadata: {}, + creativeId: 'foo', currency: 'EUR' }, 5: { @@ -763,6 +767,7 @@ describe('kargo adapter tests', function () { height: 250, mediaType: 'video', metadata: {}, + creativeId: 'foo', currency: 'EUR' }, 6: { @@ -774,6 +779,7 @@ describe('kargo adapter tests', function () { height: 250, mediaType: 'video', metadata: {}, + creativeId: 'foo', currency: 'EUR' } } @@ -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', @@ -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', @@ -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', @@ -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', @@ -880,7 +886,7 @@ describe('kargo adapter tests', function () { height: 250, vastXml: '