Skip to content

Commit

Permalink
Fix: Pass through entire bid.prebid.meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Pubmatic-Supriya-Patil committed Dec 18, 2023
1 parent 823227a commit dbb3b41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
4 changes: 0 additions & 4 deletions exchange/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ func (bidder *bidderAdapter) requestBid(ctx context.Context, bidderRequest Bidde
if err == nil {
// Conversion rate found, using it for conversion
for i := 0; i < len(bidResponse.Bids); i++ {
if bidResponse.Bids[i].BidMeta == nil {
bidResponse.Bids[i].BidMeta = &openrtb_ext.ExtBidPrebidMeta{}
}
bidResponse.Bids[i].BidMeta.AdapterCode = bidderRequest.BidderName.String()
bidderName := bidderRequest.BidderName
if bidResponse.Bids[i].Seat != "" {
bidderName = bidResponse.Bids[i].Seat
Expand Down
18 changes: 4 additions & 14 deletions exchange/bidder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,6 @@ func TestExtraBid(t *testing.T) {
DealPriority: 5,
BidType: openrtb_ext.BidTypeVideo,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: "groupm",
Currency: "USD",
Expand All @@ -2532,7 +2531,6 @@ func TestExtraBid(t *testing.T) {
DealPriority: 4,
BidType: openrtb_ext.BidTypeBanner,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: string(openrtb_ext.BidderPubmatic),
Currency: "USD",
Expand Down Expand Up @@ -2630,7 +2628,6 @@ func TestExtraBidWithAlternateBidderCodeDisabled(t *testing.T) {
DealPriority: 5,
BidType: openrtb_ext.BidTypeVideo,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: "groupm-allowed",
Currency: "USD",
Expand All @@ -2642,7 +2639,6 @@ func TestExtraBidWithAlternateBidderCodeDisabled(t *testing.T) {
DealPriority: 4,
BidType: openrtb_ext.BidTypeBanner,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: string(openrtb_ext.BidderPubmatic),
Currency: "USD",
Expand Down Expand Up @@ -2713,7 +2709,7 @@ func TestExtraBidWithBidAdjustments(t *testing.T) {
},
BidType: openrtb_ext.BidTypeBanner,
DealPriority: 4,
Seat: "pubmatic",
Seat: "PUBMATIC",
},
{
Bid: &openrtb2.Bid{
Expand All @@ -2740,7 +2736,6 @@ func TestExtraBidWithBidAdjustments(t *testing.T) {
BidType: openrtb_ext.BidTypeVideo,
OriginalBidCPM: 7,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: "groupm",
Currency: "USD",
Expand All @@ -2756,9 +2751,8 @@ func TestExtraBidWithBidAdjustments(t *testing.T) {
BidType: openrtb_ext.BidTypeBanner,
OriginalBidCur: "USD",
OriginalBidCPM: 3,
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: string(openrtb_ext.BidderPubmatic),
Seat: "PUBMATIC",
Currency: "USD",
},
}
Expand All @@ -2768,7 +2762,7 @@ func TestExtraBidWithBidAdjustments(t *testing.T) {

bidderReq := BidderRequest{
BidRequest: &openrtb2.BidRequest{Imp: []openrtb2.Imp{{ID: "impId"}}},
BidderName: openrtb_ext.BidderPubmatic,
BidderName: "PUBMATIC",
}
bidAdjustments := map[string]float64{
string(openrtb_ext.BidderPubmatic): 2, // All lowercase value in bid adjustments to simulate it being case insensitive
Expand All @@ -2786,7 +2780,7 @@ func TestExtraBidWithBidAdjustments(t *testing.T) {
openrtb_ext.ExtAlternateBidderCodes{
Enabled: true,
Bidders: map[string]openrtb_ext.ExtAdapterAlternateBidderCodes{
string(openrtb_ext.BidderPubmatic): {
"PUBMATIC": {
Enabled: true,
AllowedBidderCodes: []string{"groupm"},
},
Expand Down Expand Up @@ -2855,7 +2849,6 @@ func TestExtraBidWithBidAdjustmentsUsingAdapterCode(t *testing.T) {
BidType: openrtb_ext.BidTypeVideo,
OriginalBidCPM: 7,
OriginalBidCur: "USD",
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: "groupm",
Currency: "USD",
Expand All @@ -2871,7 +2864,6 @@ func TestExtraBidWithBidAdjustmentsUsingAdapterCode(t *testing.T) {
BidType: openrtb_ext.BidTypeBanner,
OriginalBidCur: "USD",
OriginalBidCPM: 3,
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: string(openrtb_ext.BidderPubmatic),
Currency: "USD",
Expand Down Expand Up @@ -2970,7 +2962,6 @@ func TestExtraBidWithMultiCurrencies(t *testing.T) {
OriginalBidCPM: 7,
OriginalBidCur: "USD",
OriginalBidCPMUSD: 7,
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: "groupm",
Currency: "INR",
Expand All @@ -2987,7 +2978,6 @@ func TestExtraBidWithMultiCurrencies(t *testing.T) {
OriginalBidCPM: 3,
OriginalBidCur: "USD",
OriginalBidCPMUSD: 3,
BidMeta: &openrtb_ext.ExtBidPrebidMeta{AdapterCode: string(openrtb_ext.BidderPubmatic)},
}},
Seat: string(openrtb_ext.BidderPubmatic),
Currency: "INR",
Expand Down

0 comments on commit dbb3b41

Please sign in to comment.