Skip to content

Commit

Permalink
add tc string
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Grigoras committed Aug 20, 2020
1 parent 0410982 commit 19515df
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/invibesBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function buildRequest(bidRequests, bidderRequest) {
kw: keywords,
purposes: invibes.purposes.toString(),

tc: invibes.gdpr_consent
};

if (lid) {
Expand Down Expand Up @@ -350,6 +351,8 @@ function buildSyncUrl() {

function readGdprConsent(gdprConsent) {
if (gdprConsent && gdprConsent.vendorData) {
invibes.gdpr_consent = getVendorConsentData(gdprConsent.vendorData);

if (!gdprConsent.vendorData.gdprApplies || gdprConsent.vendorData.hasGlobalConsent) {
var index;
for (index = 0; index < invibes.purposes; ++index) {
Expand Down Expand Up @@ -415,6 +418,13 @@ function getPurposeConsents(vendorData) {
return null;
}

function getVendorConsentData(vendorData) {
if (vendorData.purpose && vendorData.purpose.consents) {
if (vendorData.tcString != null) { return vendorData.tcString; }
}
return vendorData.consentData;
};

function getVendorConsents(vendorData) {
if (vendorData.vendor && vendorData.vendor.consents) {
return vendorData.vendor.consents;
Expand Down

0 comments on commit 19515df

Please sign in to comment.