Skip to content

Commit

Permalink
CWire: Add domainId param and app capability (#4107)
Browse files Browse the repository at this point in the history
  • Loading branch information
roarc0 authored Jan 22, 2025
1 parent 4d2b942 commit 3dc2749
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 3 deletions.
160 changes: 160 additions & 0 deletions adapters/cwire/cwiretest/exemplary/app-imp-ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"mockBidRequest": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": [
"CHF"
],
"imp": [
{
"id": "102",
"banner": {
"h": 250,
"w": 300,
"pos": 0
},
"ext": {
"bidder": {
"cwcreative": "9999",
"placementId": 15,
"domainId": 42
}
}
}
],
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0"
},
"user": {
"id": "55816b39711f9b5acf3b90e313ed29e51665623f",
"geo": {
"country": "ch",
"region": "basel-stadt",
"city": "basel"
}
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://cwi.re/prebid/adapter-endpoint",
"headers": {
"Content-Type": [
"application/json;charset=utf-8"
],
"Accept": [
"application/json"
]
},
"body": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": [
"CHF"
],
"imp": [
{
"id": "102",
"banner": {
"h": 250,
"w": 300,
"pos": 0
},
"ext": {
"bidder": {
"cwcreative": "9999",
"placementId": 15,
"domainId": 42
}
}
}
],
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0"
},
"user": {
"id": "55816b39711f9b5acf3b90e313ed29e51665623f",
"geo": {
"country": "ch",
"region": "basel-stadt",
"city": "basel"
}
}
},
"impIDs": [
"102"
]
},
"mockResponse": {
"status": 200,
"headers": {},
"body": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": "CHF",
"seatbid": [
{
"seat": "cwire",
"group": 0,
"bid": [
{
"id": "333",
"impid": "102",
"price": 8.00,
"crid": "9999",
"adm": "<h3>Example Ad</h3>",
"w": 1,
"h": 1,
"nurl": "https://embed.cwi.re/delivery/prebid-server/win/333",
"mtype": 1
}
]
}
]
}
}
}
],
"expectedBidResponses": [
{
"currency": "CHF",
"bids": [
{
"bid": {
"id": "333",
"impid": "102",
"price": 8.00,
"crid": "9999",
"adm": "<h3>Example Ad</h3>",
"w": 1,
"h": 1,
"nurl": "https://embed.cwi.re/delivery/prebid-server/win/333",
"mtype": 1
},
"type": "banner"
}
]
}
]
}
146 changes: 146 additions & 0 deletions adapters/cwire/cwiretest/exemplary/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"mockBidRequest": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": [
"CHF"
],
"imp": [
{
"id": "102",
"banner": {
"h": 250,
"w": 300,
"pos": 0
}
}
],
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0"
},
"user": {
"id": "55816b39711f9b5acf3b90e313ed29e51665623f",
"geo": {
"country": "ch",
"region": "basel-stadt",
"city": "basel"
}
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://cwi.re/prebid/adapter-endpoint",
"headers": {
"Content-Type": [
"application/json;charset=utf-8"
],
"Accept": [
"application/json"
]
},
"body": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": [
"CHF"
],
"imp": [
{
"id": "102",
"banner": {
"h": 250,
"w": 300,
"pos": 0
}
}
],
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"device": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0"
},
"user": {
"id": "55816b39711f9b5acf3b90e313ed29e51665623f",
"geo": {
"country": "ch",
"region": "basel-stadt",
"city": "basel"
}
}
},
"impIDs": [
"102"
]
},
"mockResponse": {
"status": 200,
"headers": {},
"body": {
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"cur": "CHF",
"seatbid": [
{
"seat": "cwire",
"group": 0,
"bid": [
{
"id": "333",
"impid": "102",
"price": 8.00,
"crid": "4321",
"adm": "<h3>Example Ad</h3>",
"w": 1,
"h": 1,
"nurl": "https://embed.cwi.re/delivery/prebid-server/win/333",
"mtype": 1
}
]
}
]
}
}
}
],
"expectedBidResponses": [
{
"currency": "CHF",
"bids": [
{
"bid": {
"id": "333",
"impid": "102",
"price": 8.00,
"crid": "4321",
"adm": "<h3>Example Ad</h3>",
"w": 1,
"h": 1,
"nurl": "https://embed.cwi.re/delivery/prebid-server/win/333",
"mtype": 1
},
"type": "banner"
}
]
}
]
}
3 changes: 3 additions & 0 deletions adapters/cwire/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ var validParams = []string{
`{"placementId":123,"pageId":321,"cwcreative":"3746"}`,
`{"placementId":123,"pageId":321}`,
`{"placementId":123}`,
`{"placementId":123,"domainId":333,"pageId":321,"cwcreative":"3746"}`,
`{"placementId":123,"domainId":333,"pageId":321}`,
`{"placementId":123},"domainId":333}`,
`{}`,
}

Expand Down
1 change: 1 addition & 0 deletions openrtb_ext/imp_cwire.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package openrtb_ext

// ImpExtCwire defines the contract for MakeRequests `request.imp[i].ext.bidder`
type ImpExtCWire struct {
DomainID int `json:"domainId,omitempty"`
PlacementID int `json:"placementId,omitempty"`
PageID int `json:"pageId,omitempty"`
CwCreative string `json:"cwcreative,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion static/bidder-info/cwire.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ endpointCompression: gzip
gvlVendorID: 1081
modifyingVastXmlAllowed: false
capabilities:
site:
app:
mediaTypes:
- banner
site:
mediaTypes:
- banner
8 changes: 6 additions & 2 deletions static/bidder-params/cwire.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
"type": "integer",
"description": "An ID which identifies this placement of the impression"
},
"pageId": {
"domainId": {
"type": "integer",
"description": "An ID which identifies the site selling the impression"
},
"pageId": {
"type": "integer",
"description": "An ID which identifies the site selling the impression (deprecated)"
},
"cwcreative": {
"type": "string",
"description": "An CWire ID of the creative that we want to show"
Expand All @@ -29,4 +33,4 @@
}
},
"required": []
}
}

0 comments on commit 3dc2749

Please sign in to comment.