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

How to link bidResponse to bidRequest? #3685

Closed
nanek opened this issue Mar 26, 2019 · 6 comments
Closed

How to link bidResponse to bidRequest? #3685

nanek opened this issue Mar 26, 2019 · 6 comments
Assignees

Comments

@nanek
Copy link
Contributor

nanek commented Mar 26, 2019

Type of issue

Question

Description

Prior to #3440, I could find the bidRequest that related to a bidResponse by using adId. I could then pull params such as placementId from the bidRequest to use in our analytics. Going forward what is the preferred way to link a bidResponse object to a bidRequest object? Or is there another way to get the placementId from a bidResponse?

#3440 indicates The bid.requestId is meant to be the tie between the bid response object and the bidRequest.bids object. however I don't see requestId in the bidResponse, at least for appnexus responses in prebid 2.7.

Use case: I have two placementIds linked to one adUnitCode, I would like to be able to distinguish which placementId won in reporting.

@piotr-yuxuan
Copy link
Contributor

Hi!
Bid response's requestId must be equal to request's bidId. It's up to your adapter endpoint to correctly return an array of BidObject items.

@jsnellbaker
Copy link
Collaborator

@nanek When you say that you don't see the requestId in the bidResponse, at least for appnexus responses in prebid 2.7 - at which point in the auction are you doing this check?

The requestId part of the bid gets assigned to it while the bid is being processed through the bidderFactory code (see here), so it may be a slight timing issue of when you're running the check.

@jsnellbaker jsnellbaker self-assigned this Mar 27, 2019
@nanek
Copy link
Contributor Author

nanek commented Mar 28, 2019

I'm using pbjs.getBidResponses() after the ads have rendered. I don't see requestId there.

@jsnellbaker
Copy link
Collaborator

@nanek Thanks for the clarification; I did some digging and found there was a piece of logic in one of the functions to remove the requestId field from the bids that came back through these public functions. This was done at the time since the requestId and adId fields had the same value.

Based on some internal discussion, it was agreed that this removal is no longer needed. I'm going to put together a PR for this update soon.

@jsnellbaker
Copy link
Collaborator

Created the above PR; should hopefully get included soon.

@jsnellbaker
Copy link
Collaborator

@nanek FYI This update went out with the 2.9.0 release yesterday. Please let me know if you still have any trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants