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

Support for stored auction and bid response ids #231

Merged
merged 3 commits into from
Aug 13, 2019

Conversation

eros902002
Copy link
Collaborator

@eros902002 eros902002 commented Aug 9, 2019

Github issue #228

This PR contains the following changes:

  • Add methods on Prebid to set stored auction id and stored bid responses ids.
  • If present, add these params into the ext object of the impression on the OpenRTB request to Prebid server.

Setting Stored Auction Id - Single Stored Auction Response ID

API:

var storedAuctionResponse: String

Example

Swift:

Prebid.shared.storedAuctionResponse = "111122223333"

Objective-C:

Prebid.shared.storedAuctionResponse = @"111122223333";

Will generate on the request:

"imp": [
    {
        "id": "a",
        "ext": {
            "prebid": { 
                "storedauctionresponse": { 
                    "id": "111122223333" 
                 } 
             } 
        }
    }
]

Setting Stored Bid Responses Ids - Multiple Stored Bid Response IDs

API:

func addStoredBidResponse(bidder: String, responseId: String)
func clearStoredBidResponses()

Example

Swift:

Prebid.shared.addStoredBidResponse(bidder: "appnexus", responseId: "221144")
Prebid.shared.addStoredBidResponse(bidder: "rubicon", responseId: "221155")

Objective-C:

[Prebid.shared addStoredBidResponseWithBidder:@"appnexus" responseId:@"221144"];
[Prebid.shared addStoredBidResponseWithBidder:@"rubicon" responseId:@"221155"];

Will generate on the request:

"imp": [
    {
      "id": "a",
      "ext": {
          "prebid": {
            "storedbidresponse": [
                  { "bidder": "appnexus", "id": "221144" },
                  { "bidder": "rubicon", "id": "221155" },
             ]
           } 
      }
    }
  ]

This method was created to clear the stored bid response ids:

Prebid.shared.clearStoredBidResponses()

@yoalex5 yoalex5 added the feature label Aug 9, 2019
@yoalex5 yoalex5 added this to the Prebid SDK 1.2 milestone Aug 9, 2019
2. `storedBidResponses` has internal access level
3. minor refactoring
@yoalex5
Copy link
Collaborator

yoalex5 commented Aug 12, 2019

Hello @eros902002 !

Thank you for the PR.
I have proposed my changes in PR

Copy link
Collaborator

@yoalex5 yoalex5 left a comment

Choose a reason for hiding this comment

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

Looks good!
Thanks

@yoalex5 yoalex5 merged commit 3c50d8b into prebid:master Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants