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

Criteo: Add pubid/uid fields in the configuration #4132

Open
wants to merge 1 commit 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
11 changes: 11 additions & 0 deletions adapters/criteo/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ var validParams = []string{
`{"zoneId": 123456, "networkId": 78910}`,
`{"zoneid": 0, "networkid": 0}`,
`{"zoneId": 0, "networkId": 0}`,
`{"zoneid": 123456, "pubid": "testpubid"}`,
`{"zoneid": 123456, "uid": 100}`,
`{"zoneid": 123456, "networkid": 78910, "pubid": "testpubid"}`,
`{"zoneid": 123456, "networkid": 78910, "uid": 100}`,
`{"zoneid": 123456, "networkid": 78910, "uid": 100, "pubid": "testpubid"}`,
`{"networkId": 78910, "pubid": "testpubid"}`,
`{"networkid": 78910, "uid": 100}`,
`{"networkid": 78910, "uid": 100, "pubid": "testpubid"}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: please add a test with invalid params too.

}

var invalidParams = []string{
Expand All @@ -67,4 +75,7 @@ var invalidParams = []string{
`{"zoneid": -1}`,
`{"networkid": -1}`,
`{"zoneid": -1, "networkid": -1}`,
`{"zoneid": 0, "networkid": 0, "pubid": ""}`,
`{"zoneid": 0, "networkid": 0, "pubid": null}`,
`{"zoneid": 0, "networkid": 0, "uid": null}`,
}
6 changes: 4 additions & 2 deletions openrtb_ext/imp_criteo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package openrtb_ext

// ExtImpCriteo defines the contract for bidrequest.imp[i].ext.prebid.bidder.criteo
type ExtImpCriteo struct {
ZoneID int64 `json:"zoneId"`
NetworkID int64 `json:"networkId"`
ZoneID int64 `json:"zoneId"`
NetworkID int64 `json:"networkId"`
UID int64 `json:"uid"`
PubID string `json:"pubid"`
}
10 changes: 10 additions & 0 deletions static/bidder-params/criteo.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
"type": "integer",
"description": "Impression's network ID, preferred.",
"minimum": 0
},
"pubid": {
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 test cases to your params_test.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review, I have added test cases.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@vraybaud can you add the following invalid test cases as well?

  • {"zoneid": 0, "networkid": 0, "pubid": ""}
  • {"zoneid": 0, "networkid": 0, "pubid": null}
  • {"zoneid": 0, "networkid": 0, "uid": null}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done !

"type": "string",
"description": "Impression's publisher ID.",
"minLength": 1
},
"uid": {
"type": "integer",
"description": "Impression's ad unit id.",
"minimum": 0
Comment on lines +27 to +35
Copy link
Contributor

Choose a reason for hiding this comment

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

This will make more sense if you keep it in sync with ExtImpCriteo, even if you don't use it in code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, please update openrtb_ext/imp_criteo.go so that all fields listed in this file appear in ExtImpCriteo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review, I have updated the pull request.

}
},
"anyOf": [
Expand Down
Loading