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

Prebid Server Bid Adapter: normalize pbs adapter auction ids #6836

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
8d635ff
Add microadBidAdapter
Feb 15, 2019
3055b90
Remove unnecessary encodeURIComponent from microadBidAdapter
Feb 26, 2019
67fb91b
Submit Advangelists Prebid Adapter
Feb 26, 2019
3ebb916
Submit Advangelists Prebid Adapter 1.1
Feb 27, 2019
4f5c451
Correct procudtion endpoint for prebid
Feb 28, 2019
2dc6d1d
Merge branch 'microad-bid-adapter' of git://github.com/strong-zero/Pr…
Feb 28, 2019
fa3e081
Merge remote-tracking branch 'origin/master' into master-rubicon-clean
Mar 18, 2019
600a46e
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Mar 18, 2019
7f578b3
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 23, 2019
176a312
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 26, 2019
9abf89c
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 13, 2019
6ce04ab
Merge remote-tracking branch 'upstream/master'
Jun 10, 2019
415e2f6
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jun 27, 2019
61fb82c
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 11, 2019
3cc4c67
analytics update with wrapper name
Jul 11, 2019
cd81e02
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
e2b4e04
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
53b5970
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 15, 2019
5c00ed5
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 16, 2019
28848ad
reverted error merge
Jul 16, 2019
ab635ee
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 19, 2019
93308f5
Merge branch 'master' of https://github.com/prebid/Prebid.js into mas…
Jul 24, 2019
1cfd52d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 25, 2019
d619807
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 27, 2019
9893f0f
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 7, 2019
986a251
Merge remote-tracking branch 'upstream/master'
Aug 23, 2019
2cae7c0
Merge branch 'master' of https://github.com/prebid/Prebid.js into ori…
Aug 27, 2019
d7fd252
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 4, 2019
c7c01ba
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 10, 2019
24a28aa
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 10, 2019
7a1a4ec
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Sep 25, 2019
4173d16
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 25, 2019
ca13952
update changed default value of netRevenue to true
Sep 27, 2019
0b6cd48
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 3, 2019
5f0110d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 3, 2019
f930a34
Merge remote-tracking branch 'upstream/master'
Oct 8, 2019
9bff282
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 14, 2019
712ec9e
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 29, 2019
f192f65
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 29, 2019
006f53c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 29, 2019
0341150
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 31, 2019
fa59897
Merge branch 'master' of https://github.com/prebid/Prebid.js
Nov 15, 2019
dcff2cf
Merge branch 'master' of https://github.com/prebid/Prebid.js
Nov 20, 2019
0222ce2
Merge branch 'master' of https://github.com/prebid/Prebid.js
Nov 24, 2019
227beca
Merge branch 'master' of https://github.com/prebid/Prebid.js
Nov 25, 2019
dc3ee49
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Dec 4, 2019
9a5a08d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 4, 2019
35ea5d4
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 6, 2019
f89b71c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 17, 2019
4e1679b
Re-add rubicon analytics without deprecated getTopWindowUrl util
Dec 17, 2019
fd80acd
Cache referrer on auction_init instead of bid_requested
Dec 17, 2019
2ab26a3
Merge pull request #51 from rubicon-project/rubicon-analytics-3.0
msm0504 Dec 17, 2019
7de7ca6
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Jan 9, 2020
5f1fe06
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jan 9, 2020
60b5ad8
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jan 17, 2020
5f44edd
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Feb 10, 2020
4809354
Merge branch 'master' of https://github.com/prebid/Prebid.js
Feb 10, 2020
8d8bdff
Merge branch 'master' of https://github.com/prebid/Prebid.js
Feb 13, 2020
a1a2318
Merge branch 'master' of https://github.com/prebid/Prebid.js
Feb 19, 2020
ac2ac12
Merge branch 'master' of https://github.com/prebid/Prebid.js
Feb 24, 2020
5ce8787
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
Mar 12, 2020
6c2bdec
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 12, 2020
a54a491
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 27, 2020
889178d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 27, 2020
40cba46
Merge branch 'master' of https://github.com/prebid/Prebid.js
Apr 4, 2020
cc5d929
Merge remote-tracking branch 'remote/master'
Apr 23, 2020
5574a52
merged remote master changes
Apr 24, 2020
ba62245
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 1, 2020
1fe62f9
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 5, 2020
a4d1d62
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 13, 2020
7215461
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 20, 2020
258c555
Merge remote-tracking branch 'origin/master'
May 20, 2020
a921ac9
Merge remote-tracking branch 'remotes/remote/master'
Jun 3, 2020
90975d1
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jun 5, 2020
aac67fa
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jun 18, 2020
585993c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 8, 2020
20f5825
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 16, 2020
8ce42f0
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 4, 2020
253b8bb
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 17, 2020
dc7fba5
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 18, 2020
b93665b
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 21, 2020
6e60389
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 26, 2020
ce3c6c6
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 27, 2020
b15a527
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 31, 2020
32a6264
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 3, 2020
f437bf2
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 9, 2020
9d5316b
Merge branch 'master' of https://github.com/prebid/Prebid.js
Oct 22, 2020
1bf50d7
Merge branch 'master' of https://github.com/rubicon-project/Prebid.js
May 26, 2021
560b45b
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 26, 2021
e3ddd66
changed id to use bidRequest.auctionId for all prebid server adapters
May 26, 2021
06fa386
added test for the id and source.tid values
May 26, 2021
3dc03aa
removed extra period
May 26, 2021
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
4 changes: 2 additions & 2 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ const OPEN_RTB_PROTOCOL = {
return;
}
const request = {
id: s2sBidRequest.tid,
source: {tid: s2sBidRequest.tid},
id: firstBidRequest.auctionId,
source: {tid: firstBidRequest.auctionId},
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is possible that publishers can pass in their own auctionId's into requestBids

And in this case, we would want to be sure source.tid is always a UUID.

So after speaking with @bretg I think we should just generate a random UUID for source.tid here every time.

utils.generateUUID()

@bretg Can you comment and confirm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch on the pub-specified auctionId. source.tid needs to be the same even if there are multiple PBS vendors. i.e. generate a new UUID for source.tid before we start looping through the vendors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi there, can we move forward on this PR? I can help if needed.
cc @idettman

Copy link
Collaborator

Choose a reason for hiding this comment

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

@osazos - your help would be appreciated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @bretg, I finally got time to work on this one.

Regarding your last comment I would like to be sure we want this behavior because it is a breaking change. Actually a large part of the process is based on the fact the tid is unique by Vendor. See there:

var uniqueServerBidRequests = [];
serverBidRequests.forEach(serverBidRequest => {
var index = -1;
for (var i = 0; i < uniqueServerBidRequests.length; ++i) {
if (serverBidRequest.tid === uniqueServerBidRequests[i].tid) {
index = i;
break;
}
}
if (index <= -1) {
uniqueServerBidRequests.push(serverBidRequest);
}
});
let counter = 0
_s2sConfigs.forEach((s2sConfig) => {
if (s2sConfig && uniqueServerBidRequests[counter] && includes(s2sConfig.bidders, uniqueServerBidRequests[counter].bidderCode)) {
// s2s should get the same client side timeout as other client side requests.
const s2sAjax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
request: requestCallbacks.request.bind(null, 's2s'),
done: requestCallbacks.done
} : undefined);
let adaptersServerSide = s2sConfig.bidders;
const s2sAdapter = _bidderRegistry[s2sConfig.adapter];
let tid = uniqueServerBidRequests[counter].tid;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for looking at this @osazos. It would take me some time to sort out what the heck this thing is doing with "uniqueServerBidRequests", but I can say that source.tid needs to be the same for multiple PBS calls in the same auction.

So maybe we just leave "uniqueServerBidRequests" there and just generate a brand new thing to use as source.tid for the auction.

tmax: s2sConfig.timeout,
imp: imps,
test: getConfig('debug') ? 1 : 0,
Expand Down
11 changes: 11 additions & 0 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,17 @@ describe('S2S Adapter', function () {
resetSyncedStatus();
});

it('should set id and source.tid to the auctionId', function () {
config.setConfig({ s2sConfig: CONFIG });

adapter.callBids(OUTSTREAM_VIDEO_REQUEST, BID_REQUESTS, addBidResponse, done, ajax);

const requestBid = JSON.parse(server.requests[0].requestBody);
expect(requestBid.id).to.equal('173afb6d132ba3');
expect(requestBid.source).to.be.an('object');
expect(requestBid.source.tid).to.equal('173afb6d132ba3');
});

it('should not add outstrean without renderer', function () {
config.setConfig({ s2sConfig: CONFIG });

Expand Down