Skip to content

Commit

Permalink
Prebid 7: remove support for TCFv1 (#8356)
Browse files Browse the repository at this point in the history
* Prebid 7: remove support for TCFv1

* Remove superfluous argument

* convert let to const

* Small improvements

* Fix behavior on timeout: 0

* Remove some of the duplication for bidders checking p1 consent

* Extract `hasPurpose1Consent` util function

* Update quantcastBidAdapter.js

Co-authored-by: Patrick McCann <[email protected]>
Co-authored-by: Patrick McCann <[email protected]>
  • Loading branch information
3 people authored Jun 7, 2022
1 parent 6e3f8dd commit 3682d62
Show file tree
Hide file tree
Showing 30 changed files with 315 additions and 929 deletions.
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';
import {parseDomain} from '../src/refererDetection.js';
const BIDDER_CODE = 'apacdex';
const ENDPOINT = 'https://useast.quantumdex.io/auction/pbjs'
Expand Down Expand Up @@ -344,14 +345,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 @@ -384,7 +385,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 @@ -547,16 +548,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 @@ -565,7 +556,7 @@ function formatRequest(payload, bidderRequest) {

let endpointUrl = URL;

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

Expand Down
Loading

0 comments on commit 3682d62

Please sign in to comment.