Skip to content

Commit

Permalink
Handle nextroll id (prebid#12)
Browse files Browse the repository at this point in the history
* Handle nextroll id

* Remove double nesting in user obj

* Revert change to publisherTagAvailable
  • Loading branch information
abijr authored Jan 22, 2020
1 parent 5162fb0 commit e02ec0d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/adrollBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const spec = {
}

function _buildRequests(validBidRequests, bidderRequest) {
let topLocation = _parseUrl(bidderRequest.refererInfo.referer);
let topLocation = _parseUrl(utils.deepAccess(bidderRequest, 'refererInfo.referer'));
return validBidRequests.map((bidRequest, index) => {
return {
method: 'POST',
Expand All @@ -103,6 +103,7 @@ function _buildRequests(validBidRequests, bidderRequest) {
}
},

user: _getUser(validBidRequests),
site: _getSite(bidRequest, topLocation),
seller: _getSeller(bidRequest),
device: _getDevice(bidRequest),
Expand All @@ -111,6 +112,22 @@ function _buildRequests(validBidRequests, bidderRequest) {
})
}

function _getUser(requests) {
let id = utils.deepAccess(requests, '0.userId.nextroll');
if (id === undefined) {
return
}

return {
ext: {
eid: [{
"source": "nextroll",
id
}]
}
}
}

function _interpretResponse(serverResponse, _bidRequest) {
if (!serverResponse.body) {
return [];
Expand Down

0 comments on commit e02ec0d

Please sign in to comment.