Skip to content

Commit

Permalink
Adquery Bid Adapter : added bid request: version and bidPageUrl (#9946)
Browse files Browse the repository at this point in the history
* added referrer to bid request

* added referrer to bid request - tests
  • Loading branch information
adquery authored May 25, 2023
1 parent 8b7bab1 commit 60aca0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/adqueryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,25 @@ export const spec = {
};
function buildRequest(validBidRequests, bidderRequest) {
let bid = validBidRequests;
let pageUrl = '';
if (bidderRequest && bidderRequest.refererInfo) {
pageUrl = bidderRequest.refererInfo.page || '';
}

return {
v: '$prebid.version$',
placementCode: bid.params.placementId,
auctionId: bid.auctionId,
type: bid.params.type,
adUnitCode: bid.adUnitCode,
bidQid: storage.getDataFromLocalStorage('qid') || null,
bidId: bid.bidId,
bidder: bid.bidder,
bidPageUrl: pageUrl,
bidderRequestId: bid.bidderRequestId,
bidRequestsCount: bid.bidRequestsCount,
bidderRequestsCount: bid.bidderRequestsCount,
sizes: parseSizesInput(bid.mediaTypes.banner.sizes).toString(),

};
}

Expand Down
9 changes: 9 additions & 0 deletions test/spec/modules/adqueryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ describe('adqueryBidAdapter', function () {
it('should include sizes', function () {
expect(rdata.sizes).not.be.null
})

it('should include version', function () {
expect(rdata.v).not.be.null
expect(rdata.v).equal('$prebid.version$')
})

it('should include referrer', function () {
expect(rdata.bidPageUrl).not.be.null
})
})

describe('interpretResponse', function () {
Expand Down

0 comments on commit 60aca0d

Please sign in to comment.