Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adxcgBidAdapter - added pubcid #3824

Merged
merged 7 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/adxcgBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import includes from 'core-js/library/fn/array/includes'
* updated for gdpr compliance on 2018.05.22 -requires gdpr compliance module
* updated to pass aditional auction and impression level parameters. added pass for video targeting parameters
* updated to fix native support for image width/height and icon 2019.03.17
* updated support for userid - pubcid,ttid 2019.05.28
*/

const BIDDER_CODE = 'adxcg'
Expand Down Expand Up @@ -159,6 +160,14 @@ export const spec = {
beaconParams.prebidBidIds = prebidBidIds.join(',')
beaconParams.bidfloors = bidfloors.join(',')

if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.pubcid'))) {
beaconParams.pubcid = validBidRequests[0].userId.pubcid;
}

if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.tdid'))) {
beaconParams.tdid = validBidRequests[0].userId.tdid;
}

let adxcgRequestUrl = url.format({
protocol: secure ? 'https' : 'http',
hostname: secure ? 'hbps.adxcg.net' : 'hbp.adxcg.net',
Expand Down
50 changes: 50 additions & 0 deletions test/spec/modules/adxcgBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,56 @@ describe('AdxcgAdapter', function () {
})
})

describe('userid pubcid should be passed to querystring', function () {
let bid = [{
'bidder': 'adxcg',
'params': {
'adzoneid': '1'
},
'adUnitCode': 'adunit-code',
'sizes': [[300, 250], [640, 360], [1, 1]],
'bidId': '84ab500420319d',
'bidderRequestId': '7101db09af0db2',
'auctionId': '1d1a030790a475',
}]

let bidderRequests = {};

bid[0].userId = {'pubcid': 'pubcidabcd'};

it('should send pubcid if available', function () {
let request = spec.buildRequests(bid, bidderRequests)
let parsedRequestUrl = url.parse(request.url)
let query = parsedRequestUrl.search
expect(query.pubcid).to.equal('pubcidabcd')
})
})

describe('userid tdid should be passed to querystring', function () {
let bid = [{
'bidder': 'adxcg',
'params': {
'adzoneid': '1'
},
'adUnitCode': 'adunit-code',
'sizes': [[300, 250], [640, 360], [1, 1]],
'bidId': '84ab500420319d',
'bidderRequestId': '7101db09af0db2',
'auctionId': '1d1a030790a475',
}]

let bidderRequests = {};

bid[0].userId = {'tdid': 'tdidabcd'};

it('should send pubcid if available', function () {
let request = spec.buildRequests(bid, bidderRequests)
let parsedRequestUrl = url.parse(request.url)
let query = parsedRequestUrl.search
expect(query.tdid).to.equal('tdidabcd');
})
})

describe('response handler', function () {
let BIDDER_REQUEST = {
'bidder': 'adxcg',
Expand Down