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

Prebid 7: remove support for TCFv1 #8356

Merged
merged 12 commits into from
Jun 7, 2022
11 changes: 1 addition & 10 deletions modules/apacdexBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { deepAccess, isPlainObject, isArray, replaceAuctionPrice, isFn } from '../src/utils.js';
import { config } from '../src/config.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';
const BIDDER_CODE = 'apacdex';
const ENDPOINT = 'https://useast.quantumdex.io/auction/pbjs'
const USERSYNC = 'https://sync.quantumdex.io/usersync/pbjs'
Expand Down Expand Up @@ -378,14 +379,4 @@ function getBidFloor(bid) {
return null;
}

function hasPurpose1Consent(gdprConsent) {
let result = true;
if (gdprConsent) {
if (gdprConsent.gdprApplies && gdprConsent.apiVersion === 2) {
result = !!(deepAccess(gdprConsent, 'vendorData.purpose.consents.1') === true);
}
}
return result;
}

registerBidder(spec);
15 changes: 3 additions & 12 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {find, includes} from '../src/polyfill.js';
import {INSTREAM, OUTSTREAM} from '../src/video.js';
import {getStorageManager} from '../src/storageManager.js';
import {bidderSettings} from '../src/bidderSettings.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';

const BIDDER_CODE = 'appnexus';
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
Expand Down Expand Up @@ -383,7 +384,7 @@ export const spec = {
},

getUserSyncs: function (syncOptions, responses, gdprConsent) {
if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
if (syncOptions.iframeEnabled && hasPurpose1Consent(gdprConsent)) {
return [{
type: 'iframe',
url: 'https://acdn.adnxs.com/dmp/async_usersync.html'
Expand Down Expand Up @@ -546,16 +547,6 @@ function getViewabilityScriptUrlFromPayload(viewJsPayload) {
return jsTrackerSrc;
}

function hasPurpose1Consent(bidderRequest) {
let result = true;
if (bidderRequest && bidderRequest.gdprConsent) {
if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true);
}
}
return result;
}

function formatRequest(payload, bidderRequest) {
let request = [];
let options = {
Expand All @@ -564,7 +555,7 @@ function formatRequest(payload, bidderRequest) {

let endpointUrl = URL;

if (!hasPurpose1Consent(bidderRequest)) {
if (!hasPurpose1Consent(bidderRequest?.gdprConsent)) {
endpointUrl = URL_SIMPLE;
}

Expand Down
Loading