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

#2640 all bids in console #3022

Closed
wants to merge 64 commits into from

Conversation

jrosendahl
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Addressing #2640
Made changes so that all bids are shown in console when pbjs.getBidResponses() is called.

Other information

#2640

Rachel Joyce and others added 30 commits February 7, 2018 17:04
send 'iv' param if present and full url in `site.page`
Enhance location detection within utils
CR for enhanced-location-detection PR
Reorg gettopwindowlocation util & add tests.
set creativeId to crid if present in response
@snapwich snapwich requested a review from mike-chowla August 27, 2018 17:28
@snapwich snapwich assigned snapwich and mike-chowla and unassigned snapwich Aug 27, 2018
Copy link
Contributor

@mike-chowla mike-chowla left a comment

Choose a reason for hiding this comment

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

I need to think about the effects of this change more but there's a bunch of items that need cleaned up.

@@ -1,15 +1,30 @@
import Adapter from 'src/adapter';
import adaptermanager from 'src/adaptermanager';
import { config } from 'src/config';
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

@@ -1,15 +1,30 @@
import Adapter from 'src/adapter';
import adaptermanager from 'src/adaptermanager';
import { config } from 'src/config';
import {
config
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

import {
userSync
} from 'src/userSync';
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

import CONSTANTS from 'src/constants.json';
import events from 'src/events';
import includes from 'core-js/library/fn/array/includes';

import { logWarn, logError, parseQueryStringParameters, delayExecution, parseSizesInput, getBidderRequest } from 'src/utils';
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

logWarn,
logError,
parseQueryStringParameters,
delayExecution,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

// bidderRequest.end = timestamp();
let bidIds = bidsArray.map(bid => {
if (bid.requestId) {
return bid.requestId.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you converting bid ids to strings? Seems inefficient and unecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Existing unit tests do not consistently use strings or numeric values for id's. I was unsure if this was an issue with the tests or in place to make sure ids can be provided either as a string or int. In any case this is safer.

I could write this using a double equal, but then the cast would be implicit instead of explicit.


let missingBids = bidderRequest.bids.filter(bid => {
if (bid.bidId) {
return bidIds.indexOf(bid.bidId.toString()) === -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you converting bid ids to strings? Seems inefficient and unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above

@@ -251,8 +294,7 @@ export function newBidder(spec) {
break;
case 'POST':
ajax(
request.url,
{
request.url, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

@@ -370,7 +412,7 @@ function validBidSize(adUnitCode, bid, bidRequests) {
// if a banner impression has one valid size, we assign that size to any bid
// response that does not explicitly set width or height
if (parsedSizes.length === 1) {
const [ width, height ] = parsedSizes[0].split('x');
const [width, height] = parsedSizes[0].split('x');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all non-substantive formatting changes

@@ -210,9 +249,14 @@ export function newBidder(spec) {
}
});

if (validBidRequests.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the logic why we only want to add no bids when there are no valid bids. What's the thinking here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if there is a bidderRequest.bids, but none of them are valid, this logs those bids as failed bids. This is consistent with what would currently happen if a subset of the bids are invalid.

If we want to only have no bids for valid requests we will have to use validBidRequests instead of bidderRequest.bids when looking for missing bids to maintain consistency.

Let me know what your preference is. I am fine with it either way.

missingBids.forEach(bid => {
const bidRequest = bidRequestMap[bid.bidId];
bid.requestId = bid.bidId;
let prebidNoBid = Object.assign(bidfactory.createBid(CONSTANTS.STATUS.NO_BID, bidRequest), bid);
Copy link
Collaborator

Choose a reason for hiding this comment

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

With Prebid 1.0 we are not adding NO_BID to auction.
To close aucton in legacy we used to match bidsRequested and bidsReceived and hence were adding a NO_BID.

Not needed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is one of the main pieces to this ticket, so is definitely needed here. It’s adding back in “no bids” for all the missing analytics/data caused by the oversight of removing them in 1.*

@mkendall07
Copy link
Member

Since this is a API change it needs to go into a 2.x release.

@mike-chowla
Copy link
Contributor

Given the feedback, I'm thinking the only way to resolve the debug snippet not showing zero bids in Prebid 1.x is to modify the debug snippet rather the change the core

@andyblackwell
Copy link
Contributor

andyblackwell commented Sep 21, 2018

To be honest it’s not just this “debug” call, the removal of these no bids, and even the introduced ajax timeouts (separate topic) in 1.* has resulted in quite a loss of important analytics data. I’ve personally already patched these issues, it was a roadblock for us on the upgrade and we were not ok with losing that data.

Not sure what you have in mind with the debug snippet, but without changing core I’m not really sure it will cover all the cases though?

@stale
Copy link

stale bot commented Oct 5, 2018

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.

@stale
Copy link

stale bot commented Oct 25, 2018

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.

@stale stale bot added the stale label Oct 25, 2018
@stale stale bot closed this Nov 1, 2018
@s-nikulin-lineate s-nikulin-lineate deleted the HB-2_2640_AllBidsInConsole branch June 20, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants