Skip to content

Commit

Permalink
Criteo - Fix fields mapping error when building bid from bidder respo…
Browse files Browse the repository at this point in the history
…nse (prebid#1917)
  • Loading branch information
leonardlabat authored and jizeyopera committed Oct 13, 2021
1 parent d6abe69 commit 43b42bc
Show file tree
Hide file tree
Showing 16 changed files with 1,853 additions and 1,859 deletions.
4 changes: 2 additions & 2 deletions adapters/criteo/criteo.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ func (a *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest
for i := 0; i < len(bidResponse.Slots); i++ {
bidderResponse.Bids[i] = &adapters.TypedBid{
Bid: &openrtb2.Bid{
ID: bidResponse.Slots[i].ID,
ID: bidResponse.Slots[i].ArbitrageID,
ImpID: bidResponse.Slots[i].ImpID,
Price: bidResponse.Slots[i].CPM,
AdM: bidResponse.Slots[i].Creative,
W: bidResponse.Slots[i].Width,
H: bidResponse.Slots[i].Height,
CrID: bidResponse.Slots[i].CreativeID,
CrID: bidResponse.Slots[i].CreativeCode,
},
BidType: openrtb_ext.BidTypeBanner,
}
Expand Down
230 changes: 115 additions & 115 deletions adapters/criteo/criteotest/exemplary/simple-banner-cookie-uid.json
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
{
"mockBidRequest": {
"id": "test-request-id",
"site": {
"id": "site-id",
"page": "criteo.com"
},
"device": {
"os": "android",
"ip": "91.199.242.236",
"ua": "random user agent"
},
"user": {
"buyeruid": "criteo-user-id"
},
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"bidder": {
"zoneid": 123456,
"networkid": 78910
}
}
}
]
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://bidder.criteo.com/cdb?profileId=230",
"headers": {
"X-Forwarded-For": ["91.199.242.236"],
"User-Agent": ["random user agent"],
"Cookie": ["uid=criteo-user-id"]
},
"body": {
"id": "test-request-id",
"publisher": {
"siteid": "site-id",
"url": "criteo.com",
"networkid": 78910
},
"user": {
"cookieuid": "criteo-user-id",
"ip": "91.199.242.236",
"ua": "random user agent",
"deviceos": "android",
"deviceidtype": "gaid"
},
"gdprconsent": {},
"slots": [
{
"slotid": "00000000-0000-0000-00000000",
"impid": "test-imp-id",
"zoneid": 123456,
"networkid": 78910,
"sizes": [
"300x250"
]
}
]
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"slots": [
{
"id": "test-slot-id",
"impid": "test-imp-id",
"zoneid": 123456,
"networkid": 78910,
"cpm": 0.1,
"currency": "USD",
"width": 300,
"height": 250,
"creativeid": "creative-123",
"creative": "<iframe id='789abc' name='789abc' src='http://creative-url.criteo.com'></iframe>"
}
]
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "test-slot-id",
"impid": "test-imp-id",
"price": 0.1,
"crid": "creative-123",
"adm": "<iframe id='789abc' name='789abc' src='http://creative-url.criteo.com'></iframe>",
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}

{
"mockBidRequest": {
"id": "test-request-id",
"site": {
"id": "site-id",
"page": "criteo.com"
},
"device": {
"os": "android",
"ip": "91.199.242.236",
"ua": "random user agent"
},
"user": {
"buyeruid": "criteo-user-id"
},
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"bidder": {
"zoneid": 123456,
"networkid": 78910
}
}
}
]
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://bidder.criteo.com/cdb?profileId=230",
"headers": {
"X-Forwarded-For": ["91.199.242.236"],
"User-Agent": ["random user agent"],
"Cookie": ["uid=criteo-user-id"]
},
"body": {
"id": "test-request-id",
"publisher": {
"siteid": "site-id",
"url": "criteo.com",
"networkid": 78910
},
"user": {
"cookieuid": "criteo-user-id",
"ip": "91.199.242.236",
"ua": "random user agent",
"deviceos": "android",
"deviceidtype": "gaid"
},
"gdprconsent": {},
"slots": [
{
"slotid": "00000000-0000-0000-00000000",
"impid": "test-imp-id",
"zoneid": 123456,
"networkid": 78910,
"sizes": [
"300x250"
]
}
]
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"slots": [
{
"arbitrageid": "test-slot-id",
"impid": "test-imp-id",
"zoneid": 123456,
"networkid": 78910,
"cpm": 0.1,
"currency": "USD",
"width": 300,
"height": 250,
"creativecode": "creative-123",
"creative": "<iframe id='789abc' name='789abc' src='http://creative-url.criteo.com'></iframe>"
}
]
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "test-slot-id",
"impid": "test-imp-id",
"price": 0.1,
"crid": "creative-123",
"adm": "<iframe id='789abc' name='789abc' src='http://creative-url.criteo.com'></iframe>",
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}

Loading

0 comments on commit 43b42bc

Please sign in to comment.