From cb2536b47a59bcdb958515afa9b6b52129179b3e Mon Sep 17 00:00:00 2001 From: nllerandi3lift <75995508+nllerandi3lift@users.noreply.github.com> Date: Mon, 1 May 2023 12:52:04 -0400 Subject: [PATCH] Triplelift Bid Adapter: relax check on consentString before appending gdprApplies to usersyncs (#9885) * TL-35335: Cast playbackmethod as array * TL-36204: Copy tid to imp extension obj * Added support for entire ortb2Imp obj * Only setting what exists in ortb2Imp.ext * Added additional test to check copy of entire ext obj * Revert "TL-36204: Copy tid to imp extension object" * TL-36204: Copying ortb2Imp.ext to impression ext obj * Added edge case logic and additional test * recos for tid change * Added spread operator to replace deepClone * addresses gdprApplies --------- Co-authored-by: Patrick Loughrey --- modules/tripleliftBidAdapter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 45931bce27e..df00495b88b 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -9,7 +9,7 @@ const BIDDER_CODE = 'triplelift'; const STR_ENDPOINT = 'https://tlx.3lift.com/header/auction?'; const BANNER_TIME_TO_LIVE = 300; const VIDEO_TIME_TO_LIVE = 3600; -let gdprApplies = true; +let gdprApplies = null; let consentString = null; export const storage = getStorageManager({bidderCode: BIDDER_CODE}); @@ -40,8 +40,12 @@ export const tripleliftAdapterSpec = { if (bidderRequest && bidderRequest.gdprConsent) { if (typeof bidderRequest.gdprConsent.gdprApplies !== 'undefined') { gdprApplies = bidderRequest.gdprConsent.gdprApplies; - tlCall = tryAppendQueryString(tlCall, 'gdpr', gdprApplies.toString()); + } else { + gdprApplies = true; } + + tlCall = tryAppendQueryString(tlCall, 'gdpr', gdprApplies.toString()); + if (typeof bidderRequest.gdprConsent.consentString !== 'undefined') { consentString = bidderRequest.gdprConsent.consentString; tlCall = tryAppendQueryString(tlCall, 'cmp_cs', consentString); @@ -87,7 +91,7 @@ export const tripleliftAdapterSpec = { syncEndpoint = tryAppendQueryString(syncEndpoint, 'src', 'prebid'); } - if (consentString !== null) { + if (consentString !== null || gdprApplies) { syncEndpoint = tryAppendQueryString(syncEndpoint, 'gdpr', gdprApplies); syncEndpoint = tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString); }