Skip to content

Commit

Permalink
Adquery Bid Adapter: bugfix local uuid (prebid#8734)
Browse files Browse the repository at this point in the history
* adquery - bugfix local uuid

* adquery - bugfix local uuid

Co-authored-by: m.czerwiak <[email protected]>
  • Loading branch information
2 people authored and Chris Corbo committed Jul 27, 2022
1 parent cd638bd commit 4d6e2ef
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions modules/adqueryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const spec = {
logInfo(request);
logInfo(response);

let qid = null;
const res = response && response.body && response.body.data;
let bidResponses = [];

Expand Down Expand Up @@ -86,6 +87,17 @@ export const spec = {
bidResponses.push(bidResponse);
logInfo('bidResponses', bidResponses);

if (res && res.qid) {
if (storage.getDataFromLocalStorage('qid')) {
qid = storage.getDataFromLocalStorage('qid');
if (qid && qid.includes('%7B%22')) {
storage.setDataInLocalStorage('qid', res.qid);
}
} else {
storage.setDataInLocalStorage('qid', res.qid);
}
}

return bidResponses;
},

Expand Down Expand Up @@ -178,25 +190,13 @@ export const spec = {

};
function buildRequest(validBidRequests, bidderRequest) {
let gnerateQid = (Math.random().toString(36).substring(2)) + ((new Date().getTime()).toString(36));
let bid = validBidRequests;
let qid = gnerateQid;

if (storage.getDataFromLocalStorage('qid')) {
qid = storage.getDataFromLocalStorage('qid');
if (qid && qid.includes('%7B%22')) {
qid = gnerateQid;
}
} else {
storage.setDataInLocalStorage('qid', qid);
}

return {
placementCode: bid.params.placementId,
auctionId: bid.auctionId,
qid: qid,
type: bid.params.type,
adUnitCode: bid.adUnitCode,
bidQid: storage.getDataFromLocalStorage('qid') || null,
bidId: bid.bidId,
bidder: bid.bidder,
bidderRequestId: bid.bidderRequestId,
Expand Down

0 comments on commit 4d6e2ef

Please sign in to comment.