Skip to content

Commit

Permalink
fix(vidoomyBidAdapter): macro replacement and gdprConsent null fix (#…
Browse files Browse the repository at this point in the history
…7518)

Co-authored-by: Sasan Farrokh <sasan.farrokh@vidoomy.com>
  • Loading branch information
SasanFarrokh and sasanfarokh authored Sep 30, 2021
1 parent 60a12e0 commit 9ba6750
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/vidoomyBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const buildRequests = (validBidRequests, bidderRequest) => {
xhr.open('GET', COOKIE_SYNC_JSON)
xhr.addEventListener('load', function () {
const macro = Macro({
gpdr: bidderRequest.gdprConsent.gdprApplies,
gpdr_consent: bidderRequest.gdprConsent.consentString
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))
Expand Down Expand Up @@ -248,6 +248,7 @@ function Macro (obj) {
/{{\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) => {
Expand Down

0 comments on commit 9ba6750

Please sign in to comment.