Skip to content

Commit

Permalink
update coppa condtion and add context support for video
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamc-ins committed Apr 9, 2024
1 parent df112dc commit 3780613
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/insticatorBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function buildVideo(bidRequest) {
const placement = deepAccess(bidRequest, 'mediaTypes.video.placement') || 3;
const plcmt = deepAccess(bidRequest, 'mediaTypes.video.plcmt') || undefined;
const playerSize = deepAccess(bidRequest, 'mediaTypes.video.playerSize');
const context = deepAccess(bidRequest, 'mediaTypes.video.context');

if (!w && playerSize) {
if (Array.isArray(playerSize[0])) {
Expand Down Expand Up @@ -139,6 +140,10 @@ function buildVideo(bidRequest) {
optionalParams['plcmt'] = plcmt;
}

if (context) {
optionalParams['context'] = context;
}

let videoObj = {
placement,
mimes,
Expand Down Expand Up @@ -197,8 +202,12 @@ function buildDevice(bidRequest) {
return device;
}

function _getCoppa() {
return config.getConfig('coppa') === true ? 1 : 0;
function _getCoppa(bidderRequest) {
const coppa = deepAccess(bidderRequest, 'ortb2.regs.coppa');
if (coppa === undefined) {
return config.getConfig('coppa') === true ? 1 : 0;
}
return coppa;
}

function _getGppConsent(bidderRequest) {
Expand All @@ -225,7 +234,7 @@ function buildRegs(bidderRequest) {
regs.ext.gdprConsentString = bidderRequest.gdprConsent.consentString;
}

regs.coppa = _getCoppa();
regs.coppa = _getCoppa(bidderRequest);

const { gpp, gppSid } = _getGppConsent(bidderRequest);

Expand Down

0 comments on commit 3780613

Please sign in to comment.