-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pbs multiple servers #5209
Pbs multiple servers #5209
Conversation
…ebid.js into master-rubicon-clean
# Conflicts: # modules/advangelistsBidAdapter.js # test/spec/modules/advangelistsBidAdapter_spec.js
…ter-remote-updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there may be some issues.
Using the following s2sConfig:
s2sConfig: [
{
enabled: true,
bidders: ["appnexus"],
defaultVendor: "appnexus",
accountId: 1001
},
{
enabled: true,
bidders: ["rubicon"],
defaultVendor: "rubicon",
accountId: 1001
}
],
is not generating the expected output.
I would expect two prebidServer calls to happen:
One to Rubicon's PBS with the Rubicon bids
One to Appnexus's PBS with the Appnexus bids.
Below is the screenshot where you can see way too many requests are being fired:
As you can see we are seeing:
2 PBS requests to Appnexus
3 PBS requests to Rubicon
and a single Client side request to both Rubicon and Appnexus.
Let me know if you need any more information!
I will include the HTML page I was using below.
<html>
<head>
<meta charset="UTF8">
<script type="text/javascript" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
/*
Setup our GPT tag and slots
*/
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().enableSingleRequest();
googletag.pubads().enableAsyncRendering();
googletag.pubads().disableInitialLoad();
googletag.enableServices();
});
googletag.cmd.push(function () {
googletag.defineSlot('/112115922/HB_QA_Tests', [[728, 90], [300, 250], [300, 600]], 'test_div_1').addService(googletag.pubads());
googletag.defineSlot('/112115922/HB_QA_Tests', [[640, 480]], 'test_div_2').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
var adUnits = [
{
code: 'test_div_1',
mediaTypes: {
banner: {
sizes: [[728, 90], [300, 250], [300, 600], [320, 250]]
},
},
bids: [
{
bidder: 'rubicon',
params: {
accountId: "1001",
siteId: "113932",
zoneId: "535510"
}
}, {
bidder: 'appnexus',
params: {
placementId: 13144370
}
}
]
},
{
code: 'test_div_2',
mediaTypes: {
"video": {
"context": "instream",
"mimes": [
"video/mp4",
"video/x-flv"
],
"api": [
2
],
"playerSize": [
640,
480
],
"maxduration": 30,
"playbackmethod": [
2
],
"linearity": 1,
"protocols": [
1,
2,
3,
4,
5,
6
]
}
},
bids: [
{
bidder: 'rubicon',
params: {
accountId: "7780",
siteId: "87184",
zoneId: "412394",
video: {}
}
}, {
bidder: "appnexus",
params: {
placementId: 13232385,
video: {
skippable: true,
playback_method: ['auto_play_sound_off']
}
}
}
]
}
];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
// These are used so we can easily access the bid objects in our automation framework if needed
my_bid_responses = [];
my_bid_requests = [];
function prebid_bid_requested(bid) {
my_bid_requests.push(bid);
};
function prebid_bid_response(bid) {
my_bid_responses.push(bid);
};
pbjs.que.push(function () {
pbjs.enableAnalytics({
provider: 'rubicon',
options: {
accountId: 1001,
endpoint: 'http://prebid-a-q.us-west-1.elasticbeanstalk.com/event'
}
});
// These events are triggered and add the bids to our custom arrays which we can open during automation in order to do validations!
pbjs.onEvent('bidRequested', prebid_bid_requested);
pbjs.onEvent('bidResponse', prebid_bid_response);
pbjs.setConfig({
bidderTimeout: 3000,
s2sConfig: [
{
enabled: true,
bidders: ["appnexus"],
defaultVendor: "appnexus",
accountId: 1001
},
{
enabled: true,
bidders: ["rubicon"],
defaultVendor: "rubicon",
accountId: 1001
}
],
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: function (bidResponses) {
sendAdserverRequest(bidResponses);
},
});
});
setTimeout(function () {
sendAdserverRequest();
}, 10000);
</script>
<script async src="http://localhost:9999/build/dev/prebid.js"></script>
</head>
<body>
<br><br>
<h3>START test_div_1 Ad Slot</h3>
<div id='test_div_1' style="position: relative; top: 1;">
<script>
googletag.cmd.push(function () {
googletag.display('test_div_1');
});
</script>
</div>
<h3>END test_div_1 Ad Slot</h3>
<br><br>
<h3>START test_div_2 Ad Slot</h3>
<div id='test_div_2' style="position: relative; top: 1;">
<script>
googletag.cmd.push(function () {
googletag.display('test_div_2');
});
</script>
</div>
<h3>END test_div_2 Ad Slot</h3>
</body>
</html> |
Testing this out and believe adapterManager.aliasBidAdapter needs to be updated to add aliased bidders to the registry from the different configs. Something like the below:
|
@idettman @r-schweitzer Is there any update on here? Was under the impression a PR into this branch was pending and needed to be merged until it was ready to be re-reviewed? Want to know when I can review again and test it out. |
Hey @robertrmartinez, we are still testing on our side. We needed to make a couple of adjustments already and I'm in the process of adding new unit tests and we're continuing to test on our side. I've also been on vacation and now sick. I will let you know when we're ready to push our code. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Obsoleted by #5992 |
Type of change
Description of change
There are a couple of use cases for PBJS connecting to different Prebid Servers:
Programmatic Guaranteed
Comparison of Prebid Server host vendors
Multiple Prebid Servers can be specified, but no overlap in bidders. i.e. bidderZ always goes to one or the other
Requirements
a) s2sConfig-defined test parameters should be interpreted the same: use a random number to decide whether the bidder should be contacted via the client-path or the server-path.
b) AdUnit-defined test parameters are also interpreted the same: use a random number to decide whether the bidder should be contacted via the client-path or the server-path.
Proposed Configuration and Expected Results for Phase 1
The core idea here is to let s2sConfig optionally be an array. It could still support an object, which is interpreted as an array with a single entry.
Scenario 1: Running Programmatic Guaranteed as a separate bidder on a different PBS instance:
Scenario 2: Same bidder appears in multiple s2sConfig entries. This is basically an error condition for this phase.