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

CWire: Add domainId param and app capability #4107

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add an exemplary simple app JSON test.

Copy link
Author

Choose a reason for hiding this comment

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

ok!

Copy link
Author

Choose a reason for hiding this comment

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

I added two JSONs containing OpenRTB app request and also the additional domainId field.

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": []
}
}
Loading