From e8111249525243787eacbd05f00ed44fdac59035 Mon Sep 17 00:00:00 2001 From: Patrick Loughrey Date: Wed, 30 Nov 2022 12:13:54 -0500 Subject: [PATCH] Triplelift Adapter: Update referrer logic (#9304) * prioritize topmostlocation * adds test for topmostlocation / referrer * cleanup * delete param after test * TL-32803: Update referrer logic * TL-32803: Update referrer logic Co-authored-by: Nick Llerandi Co-authored-by: nllerandi3lift <75995508+nllerandi3lift@users.noreply.github.com> --- modules/tripleliftBidAdapter.js | 2 +- test/spec/modules/tripleliftBidAdapter_spec.js | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 3fdabcfa6d2..7f6ec90c7b9 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -29,7 +29,7 @@ export const tripleliftAdapterSpec = { tlCall = tryAppendQueryString(tlCall, 'v', '$prebid.version$'); if (bidderRequest && bidderRequest.refererInfo) { - let referrer = bidderRequest?.refererInfo?.topmostLocation || bidderRequest?.refererInfo?.page; + let referrer = bidderRequest.refererInfo.page; tlCall = tryAppendQueryString(tlCall, 'referrer', referrer); } diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 4cab8be7e09..5cfa64184f9 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -979,19 +979,12 @@ describe('triplelift adapter', function () { expect(url).to.match(new RegExp('(?:' + prebid.version + ')')) expect(url).to.match(/(?:referrer)/); }); - it('should prioritize topmostLocation for referrer', function () { - bidderRequest.refererInfo.topmostLocation = 'https://topmostlocation.com?foo=bar' + it('should use refererInfo.page for referrer', function () { + bidderRequest.refererInfo.page = 'https://topmostlocation.com?foo=bar' const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); const url = request.url; expect(url).to.match(/(\?|&)referrer=https%3A%2F%2Ftopmostlocation.com%3Ffoo%3Dbar/); - delete bidderRequest.refererInfo.topmostLocation - }); - it('should fall back to page for referrer if topmostLocation is unavailable', function () { - bidderRequest.refererInfo.topmostLocation = null - const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); - const url = request.url; - expect(url).to.match(/(\?|&)referrer=https%3A%2F%2Fexamplereferer.com/); - delete bidderRequest.refererInfo.topmostLocation + delete bidderRequest.refererInfo.page }); it('should return us_privacy param when CCPA info is available', function() { bidderRequest.uspConsent = '1YYY';