Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missena Bid Adapter : send coppa and autoplay #12352

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/missenaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { config } from '../src/config.js';
import { BANNER } from '../src/mediaTypes.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';
import { isAutoplayEnabled } from '../libraries/autoplayDetection/autoplay.js';

/**
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
Expand Down Expand Up @@ -91,8 +92,10 @@ function toPayload(bidRequest, bidderRequest) {
const bidFloor = getFloor(bidRequest);
payload.floor = bidFloor?.floor;
payload.floor_currency = bidFloor?.currency;
payload.currency = config.getConfig('currency.adServerCurrency') || 'EUR';
payload.currency = config.getConfig('currency.adServerCurrency');
payload.schain = bidRequest.schain;
payload.coppa = config.getConfig('coppa') === true ? 1 : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please get coppa from bidderRequest.ortb2.regs.coppa instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the code to get the coppa from the bidderRequest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisHuie is there anything else that we need to do here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

payload.autoplay = isAutoplayEnabled() === true ? 1 : 0;

return {
method: 'POST',
Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/missenaBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect } from 'chai';
import { spec, storage } from 'modules/missenaBidAdapter.js';
import { BANNER } from '../../../src/mediaTypes.js';
import { config } from 'src/config.js';
import * as autoplay from 'libraries/autoplayDetection/autoplay.js';

const REFERRER = 'https://referer';
const REFERRER2 = 'https://referer2';
Expand All @@ -12,6 +14,9 @@ describe('Missena Adapter', function () {
storageAllowed: true,
},
};
let sandbox = sinon.sandbox.create();
sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true);
sandbox.stub(autoplay, 'isAutoplayEnabled').returns(false);

const bidId = 'abc';
const bid = {
Expand Down Expand Up @@ -107,6 +112,15 @@ describe('Missena Adapter', function () {
const payload = JSON.parse(request.data);
const payloadNoFloor = JSON.parse(requests[1].data);

it('should send disabled autoplay', function () {
expect(payload.autoplay).to.equal(0);
});

it('should contain coppa', function () {
expect(payload.coppa).to.equal(1);
});
sandbox.restore();

it('should contain uspConsent', function () {
expect(payload.us_privacy).to.equal('IDO');
});
Expand Down