From 5f816fe22017bcd204040373cac0eafe95fe86fb Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Tue, 19 Oct 2021 16:05:58 +0330 Subject: [PATCH 01/11] fix: add delay between cookie sync calls --- modules/vidoomyBidAdapter.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index e69386f264a..ab80d7456bc 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -206,19 +206,31 @@ function cookieSync(bidderRequest) { gpdr: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.gdprApplies : '0', gpdr_consent: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.consentString : '', }); - JSON.parse(this.responseText).filter(Boolean).forEach(url => { - firePixel(macro.replace(url)) - }) + const urls = JSON.parse(this.responseText).filter(Boolean).map(url => macro.replace(url)) + const callback = () => { + if (urls.length > 0) { + firePixel(urls.shift(), () => { + setTimeout(() => callback(), 500) + }) + } + } + callback(); }) xhr.send() cookieSynced = true; } -function firePixel(url) { +function firePixel(url, cb) { const img = document.createElement('img'); img.width = 1; img.height = 1; img.src = url; + + if (cb) { + img.onload = () => cb(); + img.onerror = () => cb(new Error()); + } + document.body.appendChild(img); setTimeout(() => { img.remove(); From 714c1a3c7aacb4cfcabd1c7667141076834f9bdb Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Wed, 27 Oct 2021 12:13:56 +0330 Subject: [PATCH 02/11] fix(VidoomyBidAdapter): use default triggerPixel --- modules/vidoomyBidAdapter.js | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index ab80d7456bc..7e7669f1a55 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -1,4 +1,4 @@ -import { logError, deepAccess } from '../src/utils.js'; +import { logError, deepAccess, triggerPixel } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -209,8 +209,8 @@ function cookieSync(bidderRequest) { const urls = JSON.parse(this.responseText).filter(Boolean).map(url => macro.replace(url)) const callback = () => { if (urls.length > 0) { - firePixel(urls.shift(), () => { - setTimeout(() => callback(), 500) + triggerPixel(urls.shift(), () => { + setTimeout(callback, 500) }) } } @@ -220,23 +220,6 @@ function cookieSync(bidderRequest) { cookieSynced = true; } -function firePixel(url, cb) { - const img = document.createElement('img'); - img.width = 1; - img.height = 1; - img.src = url; - - if (cb) { - img.onload = () => cb(); - img.onerror = () => cb(new Error()); - } - - document.body.appendChild(img); - setTimeout(() => { - img.remove(); - }, 10000) -} - function normalizeKey (x) { return x.replace(/_/g, '').toLowerCase(); } From 63bd913bc02f7fdfaf13291b17732388d2101df5 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Wed, 27 Oct 2021 18:29:29 +0330 Subject: [PATCH 03/11] fix: use getUserSyncs hook to sync cookies --- modules/vidoomyBidAdapter.js | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 7e7669f1a55..e5e7fd260c7 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -1,4 +1,4 @@ -import { logError, deepAccess, triggerPixel } from '../src/utils.js'; +import { logError, deepAccess } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -9,7 +9,17 @@ const ENDPOINT = `https://d.vidoomy.com/api/rtbserver/prebid/`; const BIDDER_CODE = 'vidoomy'; const GVLID = 380; -const COOKIE_SYNC_JSON = 'https://vpaid.vidoomy.com/sync/urls.json'; +const COOKIE_SYNC_FALLBACK_URLS = [ + 'https://x.bidswitch.net/sync?ssp=vidoomy', + 'https://ib.adnxs.com/getuid?https%3A%2F%2Fa-prebid.vidoomy.com%2Fsetuid%3Fbidder%3Dadnxs%26gdpr%3D{{GDPR}}%26gdpr_consent%3D{{GDPR_CONSENT}}%26uid%3D%24UID', + 'https://pixel-sync.sitescout.com/dmp/pixelSync?nid=120&redir=https%3A%2F%2Fa.vidoomy.com%2Fapi%2Frtbserver%2Fcookie%3Fi%3DCEN%26uid%3D%7BuserId%7D', + 'https://sync.1rx.io/usersync2/vidoomy?redir=https%3A%2F%2Fa.vidoomy.com%2Fapi%2Frtbserver%2Fcookie%3Fi%3DUN%26uid%3D%5BRX_UUID%5D', + 'https://rtb.openx.net/sync/prebid?gdpr={{GDPR}}&gdpr_consent={{GDPR_CONSENT}}&r=https%3A%2F%2Fa-prebid.vidoomy.com%2Fsetuid%3Fbidder%3Dopenx%26uid%3D$%7BUID%7D', + 'https://ads.pubmatic.com/AdServer/js/user_sync.html?gdpr={{GDPR}}&gdpr_consent={{GDPR_CONSENT}}&us_privacy=&predirect=https%3A%2F%2Fa-prebid.vidoomy.com%2Fsetuid%3Fbidder%3Dpubmatic%26gdpr%3D{{GDPR}}%26gdpr_consent%3D{{GDPR_CONSENT}}%26uid%3D', + 'https://cm.adform.net/cookie?redirect_url=https%3A%2F%2Fa-prebid.vidoomy.com%2Fsetuid%3Fbidder%3Dadf%26gdpr%3D{{GDPR}}%26gdpr_consent%3D{{GDPR_CONSENT}}%26uid%3D%24UID', + 'https://ups.analytics.yahoo.com/ups/58531/occ?gdpr={{GDPR}}&gdpr_consent={{GDPR_CONSENT}}', + 'https://ap.lijit.com/pixel?redir=https%3A%2F%2Fa-prebid.vidoomy.com%2Fsetuid%3Fbidder%3Dsovrn%26gdpr%3D{{GDPR}}%26gdpr_consent%3D{{GDPR_CONSENT}}%26uid%3D%24UID' +]; const isBidRequestValid = bid => { if (!bid.params) { @@ -36,7 +46,7 @@ const isBidRequestValid = bid => { }; const isBidResponseValid = bid => { - if (!bid.requestId || !bid.cpm || !bid.ttl || !bid.currency) { + if (!bid || !bid.requestId || !bid.cpm || !bid.ttl || !bid.currency) { return false; } switch (bid.mediaType) { @@ -89,8 +99,6 @@ const buildRequests = (validBidRequests, bidderRequest) => { const rawQueryParams = queryParams.map(qp => qp.join('=')).join('&'); - cookieSync(bidderRequest) - const url = `${ENDPOINT}?${rawQueryParams}`; return { method: 'GET', @@ -192,33 +200,25 @@ export const spec = { buildRequests, interpretResponse, gvlid: GVLID, -}; + getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) { + if (syncOptions.iframeEnabled || syncOptions.pixelEnabled) { + const macro = Macro({ + gpdr: gdprConsent ? gdprConsent.gdprApplies : '0', + gpdr_consent: gdprConsent ? gdprConsent.consentString : '', + }); -registerBidder(spec); + const pixelType = syncOptions.pixelEnabled ? 'image' : 'iframe'; + const urls = deepAccess(responses, '0.body.pixels') || COOKIE_SYNC_FALLBACK_URLS; -let cookieSynced = false; -function cookieSync(bidderRequest) { - if (cookieSynced) return; - const xhr = new XMLHttpRequest(); - xhr.open('GET', COOKIE_SYNC_JSON) - xhr.addEventListener('load', function () { - const macro = Macro({ - gpdr: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.gdprApplies : '0', - gpdr_consent: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.consentString : '', - }); - const urls = JSON.parse(this.responseText).filter(Boolean).map(url => macro.replace(url)) - const callback = () => { - if (urls.length > 0) { - triggerPixel(urls.shift(), () => { - setTimeout(callback, 500) - }) - } + return [].concat(urls).map(url => ({ + type: pixelType, + url: macro.replace(url) + })); } - callback(); - }) - xhr.send() - cookieSynced = true; -} + }, +}; + +registerBidder(spec); function normalizeKey (x) { return x.replace(/_/g, '').toLowerCase(); From 596c61ec6fd6381130518206ab34563922e217e3 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Wed, 27 Oct 2021 18:30:46 +0330 Subject: [PATCH 04/11] fix: handle 204 no response without error log --- modules/vidoomyBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index e5e7fd260c7..5cbad21e9fe 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -125,6 +125,7 @@ const render = (bid) => { const interpretResponse = (serverResponse, bidRequest) => { try { let responseBody = serverResponse.body; + if (!responseBody) return; if (responseBody.mediaType === 'video') { responseBody.ad = responseBody.vastUrl; const videoContext = bidRequest.data.videoContext; From e5404ecbeaa0ab3d9a00bf6b4fa0286389945b39 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Thu, 28 Oct 2021 16:54:18 +0330 Subject: [PATCH 05/11] chore: refactor getUserSyncs --- modules/vidoomyBidAdapter.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 5cbad21e9fe..11dac756381 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -194,6 +194,23 @@ const interpretResponse = (serverResponse, bidRequest) => { } }; +function getUserSyncs (syncOptions, responses, gdprConsent, uspConsent) { + if (syncOptions.iframeEnabled || syncOptions.pixelEnabled) { + const macro = Macro({ + gpdr: gdprConsent ? gdprConsent.gdprApplies : '0', + gpdr_consent: gdprConsent ? gdprConsent.consentString : '', + }); + + const pixelType = syncOptions.pixelEnabled ? 'image' : 'iframe'; + const urls = deepAccess(responses, '0.body.pixels') || COOKIE_SYNC_FALLBACK_URLS; + + return [].concat(urls).map(url => ({ + type: pixelType, + url: macro.replace(url) + })); + } +}; + export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER, VIDEO], @@ -201,22 +218,7 @@ export const spec = { buildRequests, interpretResponse, gvlid: GVLID, - getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) { - if (syncOptions.iframeEnabled || syncOptions.pixelEnabled) { - const macro = Macro({ - gpdr: gdprConsent ? gdprConsent.gdprApplies : '0', - gpdr_consent: gdprConsent ? gdprConsent.consentString : '', - }); - - const pixelType = syncOptions.pixelEnabled ? 'image' : 'iframe'; - const urls = deepAccess(responses, '0.body.pixels') || COOKIE_SYNC_FALLBACK_URLS; - - return [].concat(urls).map(url => ({ - type: pixelType, - url: macro.replace(url) - })); - } - }, + getUserSyncs, }; registerBidder(spec); From 79cf5e76d59c2d5cab5f53b7bfb5a7c4b14caaae Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Fri, 29 Oct 2021 10:35:22 +0330 Subject: [PATCH 06/11] test: update vidoomyBidAdapter tests --- modules/vidoomyBidAdapter.js | 4 ++-- test/spec/modules/vidoomyBidAdapter_spec.js | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 11dac756381..b17302dfad3 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -197,8 +197,8 @@ const interpretResponse = (serverResponse, bidRequest) => { function getUserSyncs (syncOptions, responses, gdprConsent, uspConsent) { if (syncOptions.iframeEnabled || syncOptions.pixelEnabled) { const macro = Macro({ - gpdr: gdprConsent ? gdprConsent.gdprApplies : '0', - gpdr_consent: gdprConsent ? gdprConsent.consentString : '', + gdpr: gdprConsent ? gdprConsent.gdprApplies : '0', + gdpr_consent: gdprConsent ? gdprConsent.consentString : '', }); const pixelType = syncOptions.pixelEnabled ? 'image' : 'iframe'; diff --git a/test/spec/modules/vidoomyBidAdapter_spec.js b/test/spec/modules/vidoomyBidAdapter_spec.js index 37452914e79..bbbb94d72fc 100644 --- a/test/spec/modules/vidoomyBidAdapter_spec.js +++ b/test/spec/modules/vidoomyBidAdapter_spec.js @@ -4,6 +4,7 @@ import { newBidder } from 'src/adapters/bidderFactory.js'; import { INSTREAM } from '../../../src/video'; const ENDPOINT = `https://d.vidoomy.com/api/rtbserver/prebid/`; +const PIXELS = ['/test.png', '/test2.png?gdpr={{GDPR}}&gdpr_consent={{GDPR_CONSENT}}'] describe('vidoomyBidAdapter', function() { const adapter = newBidder(spec); @@ -182,7 +183,8 @@ describe('vidoomyBidAdapter', function() { 'networkName': null, 'primaryCatId': 'IAB3-1', 'secondaryCatIds': null - } + }, + 'pixels': PIXELS } } @@ -206,5 +208,22 @@ describe('vidoomyBidAdapter', function() { expect(result[0].requestId).to.equal(serverResponseBanner.body.requestId); }); + + it('should sync user cookies', function () { + const GDPR_CONSENT = 'GDPR_TEST' + const result = spec.getUserSyncs({ + pixelEnabled: true + }, [serverResponseBanner], { consentString: GDPR_CONSENT, gdprApplies: 1 }, null) + expect(result).to.eql([ + { + type: 'image', + url: PIXELS[0] + }, + { + type: 'image', + url: `/test2.png?gdpr=1&gdpr_consent=${GDPR_CONSENT}` + } + ]) + }); }); }); From a82ed5f54e0abb040e18c1a5ccde49fbccd1c145 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Fri, 29 Oct 2021 15:04:06 +0330 Subject: [PATCH 07/11] fix: remove Macro --- modules/vidoomyBidAdapter.js | 54 ++---------------------------------- 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index b17302dfad3..f7a727c3d75 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -196,17 +196,14 @@ const interpretResponse = (serverResponse, bidRequest) => { function getUserSyncs (syncOptions, responses, gdprConsent, uspConsent) { if (syncOptions.iframeEnabled || syncOptions.pixelEnabled) { - const macro = Macro({ - gdpr: gdprConsent ? gdprConsent.gdprApplies : '0', - gdpr_consent: gdprConsent ? gdprConsent.consentString : '', - }); - const pixelType = syncOptions.pixelEnabled ? 'image' : 'iframe'; const urls = deepAccess(responses, '0.body.pixels') || COOKIE_SYNC_FALLBACK_URLS; return [].concat(urls).map(url => ({ type: pixelType, - url: macro.replace(url) + url: url + .replace('{{GDPR}}', gdprConsent ? gdprConsent.gdprApplies : '0') + .replace('{{GDPR_CONSENT}}', gdprConsent ? gdprConsent.consentString : '') })); } }; @@ -223,51 +220,6 @@ export const spec = { registerBidder(spec); -function normalizeKey (x) { - return x.replace(/_/g, '').toLowerCase(); -} - -function Macro (obj) { - const macros = {}; - for (const key in obj) { - macros[normalizeKey(key)] = obj[key]; - } - - const set = (key, value) => { - macros[normalizeKey(key)] = typeof value === 'function' ? value : String(value); - }; - - return { - set, - setAll (obj) { - for (const key in obj) { - macros[normalizeKey(key)] = set(obj[key]); - } - }, - replace (string, extraMacros = {}) { - const allMacros = { - ...macros, - ...extraMacros, - }; - const regexes = [ - /{{\s*([a-zA-Z0-9_]+)\s*}}/g, - /\$\$\s*([a-zA-Z0-9_]+)\s*\$\$/g, - /\[\s*([a-zA-Z0-9_]+)\s*\]/g, - /\{\s*([a-zA-Z0-9_]+)\s*\}/g, - ]; - regexes.forEach(regex => { - string = string.replace(regex, (str, x) => { - x = normalizeKey(x); - let value = allMacros[x]; - value = typeof value === 'function' ? value(allMacros) : value; - return !value && value !== 0 ? '' : value; - }); - }); - return string; - }, - }; -} - function getDomainWithoutSubdomain (hostname) { const parts = hostname.split('.'); const newParts = []; From 953e6b9af236b0e7840ecd447ac8125e2f94de1d Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Fri, 29 Oct 2021 15:09:23 +0330 Subject: [PATCH 08/11] fix: query params --- modules/vidoomyBidAdapter.js | 43 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index f7a727c3d75..9a680cd4735 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -77,33 +77,28 @@ const buildRequests = (validBidRequests, bidderRequest) => { const videoContext = deepAccess(bid, 'mediaTypes.video.context'); - const queryParams = []; - queryParams.push(['id', bid.params.id]); - queryParams.push(['adtype', adType]); - queryParams.push(['w', w]); - queryParams.push(['h', h]); - queryParams.push(['pos', parseInt(bid.params.position) || 1]); - queryParams.push(['ua', navigator.userAgent]); - queryParams.push(['l', navigator.language && navigator.language.indexOf('-') !== -1 ? navigator.language.split('-')[0] : '']); - queryParams.push(['dt', /Mobi/.test(navigator.userAgent) ? 2 : 1]); - queryParams.push(['pid', bid.params.pid]); - queryParams.push(['requestId', bid.bidId]); - queryParams.push(['d', getDomainWithoutSubdomain(hostname)]); - queryParams.push(['sp', encodeURIComponent(aElement.href)]); - if (bidderRequest.gdprConsent) { - queryParams.push(['gdpr', bidderRequest.gdprConsent.gdprApplies]); - queryParams.push(['gdprcs', bidderRequest.gdprConsent.consentString]); - } - queryParams.push(['usp', bidderRequest.uspConsent || '']); - queryParams.push(['coppa', !!config.getConfig('coppa')]); - - const rawQueryParams = queryParams.map(qp => qp.join('=')).join('&'); + const queryParams = { + id: bid.params.id, + adtype: adType, + w, + h, + pos: parseInt(bid.params.position) || 1, + ua: navigator.userAgent, + l: navigator.language && navigator.language.indexOf('-') !== -1 ? navigator.language.split('-')[0] : '', + dt: /Mobi/.test(navigator.userAgent) ? 2 : 1, + pid: bid.params.pid, + requestId: bid.bidId, + d: getDomainWithoutSubdomain(hostname), + sp: encodeURIComponent(aElement.href), + usp: bidderRequest.uspConsent || '', + coppa: !!config.getConfig('coppa'), + videoContext: videoContext || '' + }; - const url = `${ENDPOINT}?${rawQueryParams}`; return { method: 'GET', - url: url, - data: {videoContext} + url: ENDPOINT, + data: queryParams } }); return serverRequests; From d19026e6abe0a1d6a447dafcca642baa516f2299 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Fri, 29 Oct 2021 15:10:35 +0330 Subject: [PATCH 09/11] fix: gdpr consent --- modules/vidoomyBidAdapter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 9a680cd4735..61f6af9bda1 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -95,6 +95,11 @@ const buildRequests = (validBidRequests, bidderRequest) => { videoContext: videoContext || '' }; + if (bidderRequest.gdprConsent) { + queryParams.gdpr = bidderRequest.gdprConsent.gdprApplies; + queryParams.gdprcs = bidderRequest.gdprConsent.consentString; + } + return { method: 'GET', url: ENDPOINT, From bfa9c18fff72ad71ed7ffc4515ca4db5d7fa7f65 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Mon, 1 Nov 2021 23:42:07 +0330 Subject: [PATCH 10/11] fix: vidoomyBidAdapter tests --- test/spec/modules/vidoomyBidAdapter_spec.js | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/spec/modules/vidoomyBidAdapter_spec.js b/test/spec/modules/vidoomyBidAdapter_spec.js index bbbb94d72fc..52f522bdcfc 100644 --- a/test/spec/modules/vidoomyBidAdapter_spec.js +++ b/test/spec/modules/vidoomyBidAdapter_spec.js @@ -102,24 +102,24 @@ describe('vidoomyBidAdapter', function() { }); it('attaches source and version to endpoint URL as query params', function () { - expect(request[0].url).to.include(ENDPOINT); - expect(request[1].url).to.include(ENDPOINT); + expect(request[0].url).to.equal(ENDPOINT); + expect(request[1].url).to.equal(ENDPOINT); }); it('only accepts first width and height sizes', function () { - expect(request[0].url).to.include('w=300'); - expect(request[0].url).to.include('h=250'); - expect(request[0].url).to.not.include('w=200'); - expect(request[0].url).to.not.include('h=100'); - expect(request[1].url).to.include('w=400'); - expect(request[1].url).to.include('h=225'); + expect('' + request[0].data.w).to.equal('300'); + expect('' + request[0].data.h).to.equal('250'); + expect('' + request[0].data.w).to.not.equal('200'); + expect('' + request[0].data.h).to.not.equal('100'); + expect('' + request[1].data.w).to.equal('400'); + expect('' + request[1].data.h).to.equal('225'); }); it('should send id and pid parameters', function () { - expect(request[0].url).to.include('id=123123'); - expect(request[0].url).to.include('pid=123123'); - expect(request[1].url).to.include('id=456456'); - expect(request[1].url).to.include('pid=456456'); + expect('' + request[0].data.id).to.equal('123123'); + expect('' + request[0].data.pid).to.equal('123123'); + expect('' + request[1].data.id).to.equal('456456'); + expect('' + request[1].data.pid).to.equal('456456'); }); }); From 4f8ab612a70f3586bae93b10e0933d21f1509937 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Tue, 2 Nov 2021 14:20:16 +0330 Subject: [PATCH 11/11] fix: use USP_CONSENT in cookie sync urls --- modules/vidoomyBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index 61f6af9bda1..182284410e6 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -203,7 +203,8 @@ function getUserSyncs (syncOptions, responses, gdprConsent, uspConsent) { type: pixelType, url: url .replace('{{GDPR}}', gdprConsent ? gdprConsent.gdprApplies : '0') - .replace('{{GDPR_CONSENT}}', gdprConsent ? gdprConsent.consentString : '') + .replace('{{GDPR_CONSENT}}', gdprConsent ? encodeURIComponent(gdprConsent.consentString) : '') + .replace('{{USP_CONSENT}}', uspConsent ? encodeURIComponent(uspConsent) : '') })); } };