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

Multiple bid adapters: use auctionId for source.tid #9074

Merged
merged 1 commit into from
Oct 5, 2022
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
2 changes: 1 addition & 1 deletion modules/adfBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const spec = {
const adxDomain = setOnAny(validBidRequests, 'params.adxDomain') || 'adx.adform.net';

const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
const tid = validBidRequests[0].transactionId;
const tid = bidderRequest.auctionId;
const test = setOnAny(validBidRequests, 'params.test');
const currency = getConfig('currency.adServerCurrency');
const cur = currency && [ currency ];
Expand Down
1 change: 1 addition & 0 deletions modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function buildRequestParams(tags, bidderRequest) {
let {auctionId, gdprConsent, uspConsent, transactionId, refererInfo} = bidderRequest;
let req = {
id: auctionId,
// TODO: transactionId is undefined here, should this be auctionId? see #8573
tid: transactionId,
site: buildSite(refererInfo),
imp: tags
Expand Down
2 changes: 1 addition & 1 deletion modules/adxcgBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const spec = {
device.dnt = getDNT() ? 1 : 0;
device.language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';

const tid = validBidRequests[0].transactionId;
const tid = bidderRequest.auctionId;
const test = setOnAny(validBidRequests, 'params.test');
const currency = getConfig('currency.adServerCurrency');
const cur = currency && [ currency ];
Expand Down
2 changes: 1 addition & 1 deletion modules/dianomiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const spec = {
setOnAny(validBidRequests, 'params.pt') ||
setOnAny(validBidRequests, 'params.priceType') ||
'net';
const tid = validBidRequests[0].transactionId;
const tid = bidderRequest.auctionId;
const currency = getConfig('currency.adServerCurrency');
const cur = currency && [currency];
const eids = setOnAny(validBidRequests, 'userIdAsEids');
Expand Down
2 changes: 1 addition & 1 deletion modules/finativeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const spec = {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
const tid = validBidRequests[0].transactionId;
const tid = bidderRequest.auctionId;
const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR];
let url = bidderRequest.refererInfo.referer;

Expand Down
4 changes: 2 additions & 2 deletions modules/improvedigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ const ID_REQUEST = {
}
// In the single request mode, split imps between those going to the ad server and those going to extend server
if (extendImps.length) {
requests.push(formatRequest(extendImps, null, true));
requests.push(formatRequest(extendImps, bidderRequest.auctionId, true));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deepSetValue(request, 'source.tid', bidRequest0.transactionId);
seems to still be there @dgirardi

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patmmccann, I missed that, but I don't think it has any effect now, because it's always overridden by this PR setting it to auctionID afterwards. Since all of that is being refactored in #8738 I think it's OK to leave.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem; I changed the original issue to call out a bunch that i found where source was on one line and tid was on the next line

}
if (adServerImps.length) {
requests.push(formatRequest(adServerImps, null, false));
requests.push(formatRequest(adServerImps, bidderRequest.auctionId, false));
}

return requests;
Expand Down
2 changes: 1 addition & 1 deletion modules/readpeakBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const spec = {
cur: [currency],
source: {
fd: 1,
tid: bidRequests[0].transactionId,
tid: bidderRequest.auctionId,
ext: {
prebid: '$prebid.version$'
}
Expand Down
2 changes: 1 addition & 1 deletion modules/seedingAllianceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const spec = {
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
const tid = validBidRequests[0].transactionId;
const tid = bidderRequest.auctionId;
const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR];
let url = bidderRequest.refererInfo.page;

Expand Down
2 changes: 1 addition & 1 deletion modules/sharethroughBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const sharethroughAdapterSpec = {
ext: {},
},
source: {
tid: bidRequests[0].transactionId,
tid: bidderRequest.auctionId,
ext: {
version: '$prebid.version$',
str: VERSION,
Expand Down
1 change: 1 addition & 0 deletions modules/talkadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const spec = {
cur: CURRENCY,
timeout: poBidderRequest.timeout,
auction_id: paValidBidRequests[0].auctionId,
// TODO: should this use auctionId? see #8573
transaction_id: paValidBidRequests[0].transactionId,
bids: laBids,
gdpr: { applies: false, consent: false },
Expand Down
1 change: 1 addition & 0 deletions modules/truereachBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const spec = {

let siteId = deepAccess(validBidRequests[0], 'params.site_id');

// TODO: should this use auctionId? see #8573
let url = BIDDER_URL + siteId + '?hb=1&transactionId=' + validBidRequests[0].transactionId;

return {
Expand Down
2 changes: 1 addition & 1 deletion modules/ttdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function getBidFloor(bid) {

function getSource(validBidRequests) {
let source = {
tid: validBidRequests[0].transactionId
tid: validBidRequests[0].auctionId
};
if (validBidRequests[0].schain) {
utils.deepSetValue(source, 'ext.schain', validBidRequests[0].schain);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions test/spec/modules/adfBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ describe('Adf adapter', function () {
let validBidRequests = [{
bidId: 'bidId',
params: { siteId: 'siteId' },
transactionId: 'transactionId'
}];
let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data);
let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' }, auctionId: 'tid' }).data);

assert.equal(request.source.tid, validBidRequests[0].transactionId);
assert.equal(request.source.tid, 'tid');
assert.equal(request.source.fd, 1);
});

Expand Down
5 changes: 2 additions & 3 deletions test/spec/modules/adxcgBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ describe('Adxcg adapter', function () {
let validBidRequests = [{
bidId: 'bidId',
params: {siteId: 'siteId'},
transactionId: 'transactionId'
}];
let request = JSON.parse(spec.buildRequests(validBidRequests, {refererInfo: {referer: 'page'}}).data);
let request = JSON.parse(spec.buildRequests(validBidRequests, {refererInfo: {referer: 'page'}, auctionId: 'tid'}).data);

assert.equal(request.source.tid, validBidRequests[0].transactionId);
assert.equal(request.source.tid, 'tid');
assert.equal(request.source.fd, 1);
});

Expand Down
5 changes: 2 additions & 3 deletions test/spec/modules/dianomiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,13 @@ describe('Dianomi adapter', () => {
{
bidId: 'bidId',
params: { smartadId: 1234 },
transactionId: 'transactionId',
},
];
let request = JSON.parse(
spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data
spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' }, auctionId: 'tid' }).data
);

assert.equal(request.source.tid, validBidRequests[0].transactionId);
assert.equal(request.source.tid, 'tid');
assert.equal(request.source.fd, 1);
});

Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/sharethroughBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ describe('sharethrough adapter spec', function () {
refererInfo: {
ref: 'https://referer.com',
},
auctionId: 'auction-id'
};
});

Expand Down Expand Up @@ -233,7 +234,7 @@ describe('sharethrough adapter spec', function () {
expect(openRtbReq.device.ua).to.equal(navigator.userAgent);
expect(openRtbReq.regs.coppa).to.equal(1);

expect(openRtbReq.source.tid).to.equal(bidRequests[0].transactionId);
expect(openRtbReq.source.tid).to.equal(bidderRequest.auctionId);
expect(openRtbReq.source.ext.version).not.to.be.undefined;
expect(openRtbReq.source.ext.str).not.to.be.undefined;
expect(openRtbReq.source.ext.schain).to.deep.equal(bidRequests[0].schain);
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/ttdBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ describe('ttdBidAdapter', function () {
expect(requestBody.imp[0].ext.gpid).to.equal(gpid);
});

it('sends transaction id in source.tid', function () {
it('sends auction id in source.tid', function () {
const requestBody = testBuildRequests(baseBannerBidRequests, baseBidderRequest).data;
expect(requestBody.source).to.be.not.null;
expect(requestBody.source.tid).to.equal('1111474f-58b1-4368-b812-84f8c937a099');
expect(requestBody.source.tid).to.equal(baseBidderRequest.auctionId);
});

it('includes the ad size in the bid request', function () {
Expand Down Expand Up @@ -557,7 +557,7 @@ describe('ttdBidAdapter', function () {
const requestBody = testBuildRequests(baseBannerMultipleBidRequests, baseBidderRequest).data;
expect(requestBody.imp.length).to.equal(2);
expect(requestBody.source).to.be.not.null;
expect(requestBody.source.tid).to.equal('1111474f-58b1-4368-b812-84f8c937a099');
expect(requestBody.source.tid).to.equal(baseBidderRequest.auctionId);
expect(requestBody.imp[0].ext).to.be.not.null;
expect(requestBody.imp[0].ext.tid).to.equal('8651474f-58b1-4368-b812-84f8c937a099');
expect(requestBody.imp[1].ext).to.be.not.null;
Expand Down