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

set bid response id to sovrn impid #498

Merged
merged 9 commits into from
Aug 8, 2016
Merged

Conversation

protonate
Copy link
Collaborator

No description provided.

@protonate
Copy link
Collaborator Author

protonate commented Aug 2, 2016

A further issue arises in the bidmanager.addBidResponse function that causes the first Sovrn bid returned to win the auction.

We assume a single bid per bidder per placement here:
https://github.com/prebid/Prebid.js/blob/accomodate-sovrn-multisize/src/bidmanager.js#L73

I'll push up a commit that will check for the existence of a bidResponse.adId which will now be set by the Sovrn adapter passing a bidObj to the bid factory. If an ID already exists we won't need to do this "best effort" approach in bidmanager.

cc: @pdramos1 @cliffliang

@protonate
Copy link
Collaborator Author

cc: @prebid/sovrn for review

@sovrnoss
Copy link
Contributor

sovrnoss commented Aug 3, 2016

@protonate

We've tested the change and can confirm that the multisize issue is fixed.
The adIds are all unique and the winning bid is selected.

We took a first stab at the unit test for this change. But, we think that it needs to test the bidManager instead of the sovrn Adaptor.

Would you be able to write this test for the updated functionality? Let us know if you need any assistance or have any questions.

Thanks again for all your work here,
sovrn Support Team

@@ -119,7 +119,7 @@ var SovrnAdapter = function SovrnAdapter() {

//store bid response
//bid status is good (indicating 1)
bid = bidfactory.createBid(1);
bid = bidfactory.createBid(1, bidObj);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be required/implemented for all adapters? This issue is not isolated to Sovrn, it is just potentially more commonly setup there and was noticed first. aardvark and triplelift are two additional examples where we will run into this issue in our current setup as we setup flex sizes for them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are working towards this approach as a requirement for adapters but opted not to implement by core team as it became too obtrusive to modify adapter code ourselves.

@nanek
Copy link
Contributor

nanek commented Aug 3, 2016

On L81 in sovrn.js bid = bidfactory.createBid(2); does this need to be updated also? Or will all responses have an adId now, so the "best effort approach" is never called?

@sovrnoss
Copy link
Contributor

sovrnoss commented Aug 3, 2016

@nanek

The best effort approach within the bidmanager is not called in that case. The bid response has an bidId by the time it's added through bidmanager.addBidResponse.

That bidId, however, is randomly generated when the bid is created on L18 of bidfactory.js. In the other case (status 1 bid response) on L122 of sovrn.js, the bidId is created from the original request.

When we tested the empty response case within a test environment, the bidId within the pbjs.adUnits object did not match the adId within the bidResponses object for the empty unit.

We agree with the change suggested above. We don't believe that the case above will create any issues, because the best effort approach isn't called.
But, it seems that the point is to match the original bidIds from the requests to the adIds in the responses. So, for that reason, and for consistency sake, it would be better to update L81 in sovrn.js

Thanks,
sovrn Support Team

@protonate
Copy link
Collaborator Author

@sovrnoss This fix and a test are merged to master and will be included in our next release. Please have a last past and confirm that these changes resolve multi-size functionality for Sovrn adapter.

cc: @cliffliang @pdramos1

@sovrnoss
Copy link
Contributor

We've had an additional quality assurance resource double check and verify the change and have confirmed that the multi-size functionality is resolved.

olafbuitelaar added a commit to olafbuitelaar/Prebid.js that referenced this pull request Aug 13, 2016
* Sovrn adapter creates bid response with ID of bid request
* set bid response id to sovrn impid
* no need to match on "best effort" if `bid.adId` is set
* whitespace fix
* code style fixes
# Conflicts:
#	src/bidmanager.js
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

Successfully merging this pull request may close these issues.

3 participants