Skip to content

Commit

Permalink
add deprecated placementId param & host param test
Browse files Browse the repository at this point in the history
  • Loading branch information
BizzClick committed Jan 15, 2024
1 parent b07eb3e commit 16bd598
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 7 deletions.
6 changes: 5 additions & 1 deletion adapters/bizzclick/bizzclick.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtBizzclick) (string, er
if params.Host != "" {
host = params.Host
}
endpointParams := macros.EndpointTemplateParams{AccountID: params.AccountID, SourceId: params.SourceID, Host: host}
sourceId := params.SourceID
if params.SourceID == "" {
sourceId = params.PlacementID
}
endpointParams := macros.EndpointTemplateParams{AccountID: params.AccountID, SourceId: sourceId, Host: host}
return macros.ResolveMacros(a.endpoint, endpointParams)
}

Expand Down
150 changes: 150 additions & 0 deletions adapters/bizzclick/bizzclicktest/exemplary/default-host-param.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"mockBidRequest": {
"id": "some-request-id",
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"language": "en",
"dnt": 0
},
"tmax": 1000,
"user": {
"buyeruid": "awesome-user"
},
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"imp": [
{
"id": "some-impression-id",
"tagid": "ogTAGID",
"banner": {
"w": 320,
"h": 50
},
"ext": {
"bidder": {
"accountId": "accountId",
"placementId": "placementId"
}
}
}
]
},
"httpCalls": [
{
"expectedRequest": {
"headers": {
"Content-Type": [
"application/json;charset=utf-8"
],
"Accept": [
"application/json"
],
"X-Openrtb-Version": [
"2.5"
],
"User-Agent": [
"test-user-agent"
],
"X-Forwarded-For": [
"123.123.123.123"
]
},
"uri": "http://us-e-node1.bizzclick.com/bid?rtb_seat_id=placementId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"language": "en",
"dnt": 0
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"w": 320,
"h": 50
},
"tagid": "ogTAGID"
}
],
"app": {
"id": "123456789",
"name": "Awesome App",
"bundle": "com.app.awesome",
"domain": "awesomeapp.com",
"cat": [
"IAB22-1"
],
"publisher": {
"id": "123456789"
}
},
"user": {
"buyeruid": "awesome-user"
},
"tmax": 1000
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "awesome-resp-id",
"seatbid": [
{
"bid": [
{
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "1",
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
"awesome.com"
],
"crid": "20",
"w": 320,
"h": 50
}
],
"type": "banner",
"seat": "bizzclick"
}
],
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"bids": [
{
"bid": {
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "1",
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
"awesome.com"
],
"crid": "20",
"w": 320,
"h": 50
},
"type": "banner"
}
]
}
]
}
7 changes: 4 additions & 3 deletions openrtb_ext/imp_bizzclick.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package openrtb_ext

type ExtBizzclick struct {
AccountID string `json:"accountId"`
SourceID string `json:"sourceId"`
Host string `json:"host"`
AccountID string `json:"accountId"`
SourceID string `json:"sourceId"`
Host string `json:"host"`
PlacementID string `json:"placementId"`
}
21 changes: 18 additions & 3 deletions static/bidder-params/bizzclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,25 @@
"type": "string",
"description": "Server region",
"minLength": 1
},
"placementId": {
"type": "string",
"description": "Deprecated, use sourceId instead",
"minLength": 1
}
},
"required": [
"accountId",
"sourceId"
"oneOf": [
{
"required": [
"accountId",
"placementId"
]
},
{
"required": [
"accountId",
"sourceId"
]
}
]
}

0 comments on commit 16bd598

Please sign in to comment.