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

Concert Bid Adapter: add TDID #10549

Merged
merged 22 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a0bfc6b
collect EIDs for bid request
antoinfive Sep 26, 2022
d4392ca
Merge pull request #5 from voxmedia/ac-add-uid2
antoinfive Oct 17, 2022
0be448c
add ad slot positioning to payload
antoinfive Sep 27, 2022
653989d
Merge pull request #6 from voxmedia/ac-add-xy-offset-for-ad-slot
antoinfive Oct 17, 2022
83fdbd8
Merge branch 'prebid:master' into master
antoinfive Oct 17, 2022
b47f73a
Merge branch 'prebid:master' into master
BrettBlox Oct 18, 2022
a692b6c
Merge branch 'prebid:master' into master
BrettBlox Oct 27, 2022
c54b011
RPO-2012: Update local storage name-spacing for c_uid (#8)
BrettBlox Oct 27, 2022
2bb7143
RPO-2012: Add check for shared id (#9)
BrettBlox Nov 4, 2022
d38d7fd
Merge branch 'prebid:master' into master
BrettBlox Nov 10, 2022
572526e
Merge branch 'prebid:master' into master
BrettBlox Feb 8, 2023
7c1969c
Merge branch 'prebid:master' into master
BrettBlox Mar 20, 2023
99b0664
[RPO-3152] Enable Support for GPP Consent (#12)
BrettBlox Mar 22, 2023
105802d
fixes conditional logic for consent allows function (#13)
BrettBlox Mar 22, 2023
4a43497
Merge branch 'prebid:master' into master
BrettBlox Mar 28, 2023
a0d3f83
Merge branch 'prebid:master' into master
BrettBlox Apr 6, 2023
0ee3b28
[RPO-3262] Update getUid function to check for pubcid and sharedid (#14)
BrettBlox Apr 6, 2023
d46d102
[RPO-3405] Add browserLanguage to request meta object
Skitelman Aug 10, 2023
c4fdab6
Merge pull request #15 from voxmedia/RPO-3405-add-browser-language
Skitelman Aug 14, 2023
afde14d
Merge branch 'prebid:master' into master
Skitelman Aug 14, 2023
5af088b
Merge remote-tracking branch 'upstream/master'
Skitelman Sep 25, 2023
aa9f8b0
ConcertBidAdapter: Add TDID (#20)
Skitelman Sep 28, 2023
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/concertBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const spec = {
uspConsent: bidderRequest.uspConsent,
gdprConsent: bidderRequest.gdprConsent,
gppConsent: bidderRequest.gppConsent,
tdid: getTdid(bidderRequest, validBidRequests),
}
};

Expand Down Expand Up @@ -263,3 +264,11 @@ function getOffset(el) {
};
}
}

function getTdid(bidderRequest, validBidRequests) {
if (hasOptedOutOfPersonalization() || !consentAllowsPpid(bidderRequest)) {
return null;
}

return deepAccess(validBidRequests[0], 'userId.tdid') || null;
}
40 changes: 39 additions & 1 deletion test/spec/modules/concertBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,20 @@ describe('ConcertAdapter', function () {
expect(payload).to.have.property('meta');
expect(payload).to.have.property('slots');

const metaRequiredFields = ['prebidVersion', 'pageUrl', 'screen', 'debug', 'uid', 'optedOut', 'adapterVersion', 'uspConsent', 'gdprConsent', 'gppConsent', 'browserLanguage'];
const metaRequiredFields = [
'prebidVersion',
'pageUrl',
'screen',
'debug',
'uid',
'optedOut',
'adapterVersion',
'uspConsent',
'gdprConsent',
'gppConsent',
'browserLanguage',
'tdid'
];
const slotsRequiredFields = ['name', 'bidId', 'transactionId', 'sizes', 'partnerId', 'slotType'];

metaRequiredFields.forEach(function(field) {
Expand Down Expand Up @@ -199,6 +212,31 @@ describe('ConcertAdapter', function () {
expect(slot.offsetCoordinates.x).to.equal(100)
expect(slot.offsetCoordinates.y).to.equal(0)
})

it('should not pass along tdid if the user has opted out', function() {
storage.setDataInLocalStorage('c_nap', 'true');
const request = spec.buildRequests(bidRequests, bidRequest);
const payload = JSON.parse(request.data);

expect(payload.meta.tdid).to.be.null;
});

it('should not pass along tdid if USP consent disallows', function() {
storage.removeDataFromLocalStorage('c_nap');
const request = spec.buildRequests(bidRequests, { ...bidRequest, uspConsent: '1YY' });
const payload = JSON.parse(request.data);

expect(payload.meta.tdid).to.be.null;
});

it('should pass along tdid if the user has not opted out', function() {
storage.removeDataFromLocalStorage('c_nap', 'true');
const tdid = '123abc';
const bidRequestsWithTdid = [{ ...bidRequests[0], userId: { tdid } }]
const request = spec.buildRequests(bidRequestsWithTdid, bidRequest);
const payload = JSON.parse(request.data);
expect(payload.meta.tdid).to.equal(tdid);
});
});

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