Skip to content

Commit

Permalink
Outbrain adapter: overwrite tagid only if it exists (prebid#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rok Sušnik authored and sachin-pubmatic committed Aug 2, 2021
1 parent ae2dc1e commit 64b473d
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adapters/outbrain/outbrain.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
errs = append(errs, err)
continue
}
imp.TagID = outbrainExt.TagId
reqCopy.Imp[i] = imp
if outbrainExt.TagId != "" {
imp.TagID = outbrainExt.TagId
reqCopy.Imp[i] = imp
}
}

publisher := &openrtb2.Publisher{
Expand Down
139 changes: 139 additions & 0 deletions adapters/outbrain/outbraintest/supplemental/general_params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"tagid": "tag-id",
"ext": {
"bidder": {
"publisher": {
"id": "publisher-id"
}
}
}
}
],
"bcat": ["bad-category"],
"badv": ["bad-advertiser"],
"site": {
"page": "http://example.com"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36",
"h": 500,
"w": 1000
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "http://example.com/bid",
"body": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"tagid": "tag-id",
"ext": {
"bidder": {
"publisher": {
"id": "publisher-id"
}
}
}
}
],
"bcat": ["bad-category"],
"badv": ["bad-advertiser"],
"site": {
"page": "http://example.com",
"publisher": {
"id": "publisher-id"
}
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36",
"h": 500,
"w": 1000
}
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "5095a742-1c27-402b-ab6f-66b1bd53383b",
"seatbid": [
{
"bid": [
{
"id": "test-request-id",
"impid": "test-imp-id",
"price": 1000,
"nurl": "http://example.com/win/1000",
"adm": "<div>ad</div>",
"adomain": [
"example.com"
],
"cid": "test-cid",
"crid": "test-crid",
"cat": [
"IAB13-4"
],
"w": 300,
"h": 250
}
],
"seat": "acc-1876"
}
],
"bidid": "43ccadf2-8b2e-11eb-b294-de4c49e99ff6",
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "test-request-id",
"impid": "test-imp-id",
"price": 1000,
"nurl": "http://example.com/win/1000",
"adm": "<div>ad</div>",
"adomain": [
"example.com"
],
"cid": "test-cid",
"crid": "test-crid",
"cat": [
"IAB13-4"
],
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
]
},
"tagid": "should-be-overwritten-tagid",
"ext": {
"bidder": {
"publisher": {
Expand All @@ -26,6 +27,8 @@
}
}
],
"bcat": ["should-be-overwritten-bcat"],
"badv": ["should-be-overwritten-badv"],
"site": {
"page": "http://example.com"
},
Expand Down

0 comments on commit 64b473d

Please sign in to comment.