Skip to content

Commit

Permalink
Missena Bid Adapter: add session identifier (prebid#11058)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdamoc authored Feb 6, 2024
1 parent 7260a2d commit f8858ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/missenaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
buildUrl,
formatQS,
generateUUID,
isFn,
logInfo,
safeJSONParse,
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
};
Expand Down
4 changes: 4 additions & 0 deletions test/spec/modules/missenaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f8858ae

Please sign in to comment.