From f8858ae9f4553928fbece2239e299c58be1d28a8 Mon Sep 17 00:00:00 2001 From: Petre Damoc Date: Tue, 6 Feb 2024 21:12:15 +0200 Subject: [PATCH] Missena Bid Adapter: add session identifier (#11058) --- modules/missenaBidAdapter.js | 3 +++ test/spec/modules/missenaBidAdapter_spec.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/modules/missenaBidAdapter.js b/modules/missenaBidAdapter.js index 527b6704146..99cad1c7bc6 100644 --- a/modules/missenaBidAdapter.js +++ b/modules/missenaBidAdapter.js @@ -1,6 +1,7 @@ import { buildUrl, formatQS, + generateUUID, isFn, logInfo, safeJSONParse, @@ -24,6 +25,7 @@ const EVENTS_DOMAIN = 'events.missena.io'; const EVENTS_DOMAIN_DEV = 'events.staging.missena.xyz'; export const storage = getStorageManager({ bidderCode: BIDDER_CODE }); +window.msna_ik = window.msna_ik || generateUUID(); /* Get Floor price information */ function getFloor(bidRequest) { @@ -79,6 +81,7 @@ export const spec = { return validBidRequests.map((bidRequest) => { const payload = { adunit: bidRequest.adUnitCode, + ik: window.msna_ik, request_id: bidRequest.bidId, timeout: bidderRequest.timeout, }; diff --git a/test/spec/modules/missenaBidAdapter_spec.js b/test/spec/modules/missenaBidAdapter_spec.js index f84981352ab..ab1fbdcc074 100644 --- a/test/spec/modules/missenaBidAdapter_spec.js +++ b/test/spec/modules/missenaBidAdapter_spec.js @@ -137,6 +137,10 @@ describe('Missena Adapter', function () { expect(payloadNoFloor.floor).to.equal(undefined); expect(payloadNoFloor.floor_currency).to.equal(undefined); }); + it('should send the idempotency key', function () { + expect(window.msna_ik).to.not.equal(undefined); + expect(payload.ik).to.equal(window.msna_ik); + }); getDataFromLocalStorageStub.restore(); getDataFromLocalStorageStub = sinon.stub(