Skip to content

Commit

Permalink
Merge branch 'master' into fpd-update
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/org/prebid/server/auction/ExchangeService.java
#	src/main/java/org/prebid/server/proto/openrtb/ext/request/ExtRequestPrebid.java
#	src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
#	src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-brightroll-bid-request-1.json
#	src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json
#	src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-response.json
#	src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-smartrtb-bid-request.json
#	src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-synacormedia-bid-request.json
#	src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-response.json
  • Loading branch information
rpanchyk committed May 6, 2020
2 parents d2de2e5 + 0ac5a89 commit 6fd26e1
Show file tree
Hide file tree
Showing 503 changed files with 14,059 additions and 5,049 deletions.
15 changes: 11 additions & 4 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport">
<property name="excludes" value="java.util.Objects.*,org.assertj.core.api.Assertions.*,org.mockito.Mockito.*,org.mockito.Matchers.*,org.junit.Assert.*" />
</module>
<module name="AvoidStaticImport"/>
<module name="IllegalImport">
<!-- Avoids shaded imports if IDE autosuggests them. Avoid lang in favor of lang3. -->
<property name="illegalPkgs" value="autovalue.shaded.com.google,org.inferred.freebuilder.shaded.com.google,org.apache.commons.lang"/>
Expand Down Expand Up @@ -147,6 +145,15 @@
</module>
<module name="SuppressionSingleFilter">
<property name="id" value="BanVertxJsonImport"/>
<property name="files" value="src/main/java/org/prebid/server/json/ObjectMapperProvider.java"/>
<property name="files" value="src/main/java/org/prebid/server/json/ObjectMapperProvider\.java"/>
</module>

<module name="SuppressionSingleFilter">
<property name="checks" value="AvoidStaticImport"/>
<property name="files" value=".*Test\.java"/>
</module>
<module name="SuppressionSingleFilter">
<property name="checks" value="FileLength"/>
<property name="files" value=".*Test\.java"/>
</module>
</module>
15 changes: 12 additions & 3 deletions docs/config-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ For caching available next options:
- `settings.in-memory-cache.cache-size` - the size of LRU cache.
- `settings.in-memory-cache.notification-endpoints-enabled` - if equals to `true` two additional endpoints will be
available: [/storedrequests/openrtb2](endpoints/storedrequests/openrtb2.md) and [/storedrequests/amp](endpoints/storedrequests/amp.md).
- `settings.in-memory-cache.account-invalidation-enabled` - if equals to `true` additional admin protected endpoints will be
available: `/cache/invalidate?account={accountId}` which remove account from the cache.
- `settings.in-memory-cache.http-update.endpoint` - the url to fetch stored request updates.
- `settings.in-memory-cache.http-update.amp-endpoint` - the url to fetch AMP stored request updates.
- `settings.in-memory-cache.http-update.refresh-rate` - refresh period in ms for stored request updates.
Expand Down Expand Up @@ -243,9 +245,16 @@ If not defined in config all other Health Checkers would be disabled and endpoin
- `gdpr.eea-countries` - comma separated list of countries in European Economic Area (EEA).
- `gdpr.default-value` - determines GDPR in scope default value (if no information in request and no geolocation data).
- `gdpr.host-vendor-id` - the organization running a cluster of Prebid Servers.
- `gdpr.vendorlist.http-endpoint-template` - template string for vendor list url, where `{VERSION}` is used as version number placeholder.
- `gdpr.vendorlist.http-default-timeout-ms` - default operation timeout for obtaining new vendor list.
- `gdpr.vendorlist.filesystem-cache-dir` - directory for local storage cache for vendor list. Should be with `WRITE` permissions for user application run from.
- `gdpr.enabled` - gdpr feature switch. Default `true`.
- `gdpr.purposes.pN.enforce-purpose` - define type of enforcement confirmation: `no`/`basic`/`full`. Default `full`
- `gdpr.purposes.pN.enforce-vendors` - if equals to `true`, user must give consent to use vendors. Purposes will be omitted. Default `true`
- `gdpr.purposes.pN.vendor-exceptions[]` - bidder names that will be treated opposite to `pN.enforce-vendors` value.
- `gdpr.special-features.sfN.enforce` - if equals to `true`, special feature will be enforced for purpose. Default `true`
- `gdpr.special-features.sfN.vendor-exceptions[]` - bidder names that will be treated opposite to `sfN.enforce` value.
- `gdpr.purpose-one-treatment-interpretation` - option that allows to skip the Purpose one enforcement workflow.
- `gdpr.vendorlist.vN.http-endpoint-template` - template string for vendor list url, where `{VERSION}` is used as version number placeholder.
- `gdpr.vendorlist.vN.http-default-timeout-ms` - default operation timeout for obtaining new vendor list.
- `gdpr.vendorlist.vN.cache-dir` - directory for local storage cache for vendor list. Should be with `WRITE` permissions for user application run from.

## CCPA
- `ccpa.enforce` - if equals to `true` enforces to check ccpa policy, otherwise ignore ccpa verification.
Expand Down
10 changes: 10 additions & 0 deletions docs/endpoints/openrtb2/amp.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ An example Stored Request is given below:
},
"ext": {
"prebid": {
"currency": {
"rates": {
"EUR": {
"USD": 1.2406
},
"USD": {
"EUR": 0.8110
}
}
},
"targeting": {
"pricegranularity": { // This is equivalent to the deprecated "pricegranularity": "medium"
"precision": 2,
Expand Down
204 changes: 137 additions & 67 deletions docs/endpoints/openrtb2/auction.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,16 @@ Bidders [are encouraged](../../developers/add-new-bidder.md) to make Net bids. H
If you find that some bidders use Gross bids, publishers can adjust for it with `request.ext.prebid.bidadjustmentfactors`:

```
{
"appnexus: 0.8,
"rubicon": 0.7
}
{
"ext": {
"prebid": {
"bidadjustmentfactors": {
"appnexus: 0.8,
"rubicon": 0.7
}
}
}
}
```

This may also be useful for publishers who want to account for different discrepancies with different bidders.
Expand All @@ -147,27 +153,21 @@ to set these params on the response at `response.seatbid[i].bid[j].ext.prebid.ta

```
{
"pricegranularity": {
"precision": 2,
"ranges": [
{
"max": 20.00,
"increment": 0.10 // This is equivalent to the deprecated "pricegranularity": "medium"
}
]
},
"currency": {
"rates": {
"EUR": {
"USD": 1.2406
},
"USD": {
"EUR": 0.8110
"ext": {
"prebid": {
"targeting": {
"pricegranularity": {
"precision": 2,
"ranges": [{
"max":20.00,
"increment":0.10 // This is equivalent to the deprecated "pricegranularity": "medium"
}]
},
"includewinners": false, // Optional param defaulting to true
"includebidderkeys": false // Optional param defaulting to true
}
}
},
"includewinners": false, // Optional param defaulting to true
"includebidderkeys": false // Optional param defaulting to true
}
}
```

Expand All @@ -184,6 +184,16 @@ MediaType PriceGranularity - when a single OpenRTB request contains multiple imp
```
"ext": {
"prebid": {
"currency": {
"rates": {
"EUR": {
"USD": 1.2406
},
"USD": {
"EUR": 0.8110
}
}
},
"targeting": {
"mediatypepricegranularity": {
"banner": { "ranges": [
Expand All @@ -205,9 +215,20 @@ MediaType PriceGranularity - when a single OpenRTB request contains multiple imp

```
{
"hb_bidder_{bidderName}": "The seatbid.seat which contains this bid",
"hb_size_{bidderName}": "A string like '300x250' using bid.w and bid.h for this bid",
"hb_pb_{bidderName}": "The bid.cpm, rounded down based on the price granularity."
"seatbid": [{
"bid": [{
...
"ext": {
"prebid": {
"targeting": {
"hb_bidder_{bidderName}": "The seatbid.seat which contains this bid",
"hb_size_{bidderName}": "A string like '300x250' using bid.w and bid.h for this bid",
"hb_pb_{bidderName}": "The bid.cpm, rounded down based on the price granularity."
}
}
}
}]
}]
}
```

Expand All @@ -226,8 +247,16 @@ In most cases, this is probably a bad idea.

```
{
"appnexus": "some-appnexus-id",
"rubicon": "some-rubicon-id"
"user": {
"ext": {
"prebid": {
"buyeruids": {
"appnexus": "some-appnexus-id",
"rubicon": "some-rubicon-id"
}
}
}
}
}
```

Expand Down Expand Up @@ -288,11 +317,9 @@ This prevents breaking API changes as new Bidders are added to the project.
For example, if the Request defines an alias like this:

```
{
"aliases": {
"appnexus": "rubicon"
}
}
```

then any `imp.ext.appnexus` params will actually go to the **rubicon** adapter.
Expand All @@ -316,19 +343,17 @@ For example, a request may return this in `response.ext`

```
{
"errors": {
"appnexus": [
{
"code": 2,
"message": "A hybrid Banner/Audio Imp was offered, but Appnexus doesn't support Audio."
}
],
"rubicon": [
{
"code": 1,
"message: "The request exceeded the timeout allocated"
}
]
"ext": {
"errors": {
"appnexus": [{
"code": 2,
"message": "A hybrid Banner/Audio Imp was offered, but Appnexus doesn't support Audio."
}],
"rubicon": [{
"code": 1,
"message": "The request exceeded the timeout allocated"
}]
}
}
}
```
Expand Down Expand Up @@ -362,7 +387,15 @@ A typical `storedrequest` value looks like this:

```
{
"id": "some-id"
"imp": [{
"ext": {
"prebid": {
"storedrequest": {
"id": "some-id"
}
}
}
}]
}
```

Expand All @@ -374,13 +407,19 @@ Bids can be temporarily cached on the server by sending the following data as `r

```
{
"bids": {},
"vastxml": {}
"ext": {
"prebid": {
"cache": {
"bids": {},
"vastxml": {}
}
}
}
}
```

Both `bids` and `vastxml` are optional, but one of the two is required.
This property will have no effect unless `request.ext.prebid.targeting` is also set in the request.
Both `bids` and `vastxml` are optional, but one of the two is required if you want to cache bids. This property will have no effect
unless `request.ext.prebid.targeting` is also set in the request.

If `bids` is present, Prebid Server will make a _best effort_ to include these extra `bid.ext.prebid.targeting` keys:

Expand Down Expand Up @@ -451,6 +490,37 @@ Example:
PBS receiving a request for an interstitial imp and these parameters set, it will rewrite the format object within the interstitial imp. If the format array's first object is a size, PBS will take it as the max size for the interstitial. If that size is 1x1, it will look up the device's size and use that as the max size. If the format is not present, it will also use the device size as the max size. (1x1 support so that you don't have to omit the format object to use the device size)
PBS with interstitial support will come preconfigured with a list of common ad sizes. Preferentially organized by weighing the larger and more common sizes first. But no guarantees to the ordering will be made. PBS will generate a new format list for the interstitial imp by traversing this list and picking the first 10 sizes that fall within the imp's max size and minimum percentage size. There will be no attempt to favor aspect ratios closer to the original size's aspect ratio. The limit of 10 is enforced to ensure we don't overload bidders with an overlong list. All the interstitial parameters will still be passed to the bidders, so they may recognize them and use their own size matching algorithms if they prefer.

#### Currency Support

To set the desired 'ad server currency', use the standard OpenRTB `cur` attribute. Note that Prebid Server only looks at the first currency in the array.

```
"cur": ["USD"]
```

If you want or need to define currency conversion rates (e.g. for currencies that your Prebid Server doesn't support),
define ext.prebid.currency.rates. (Currently supported in PBS-Java only)

```
"ext": {
"prebid": {
"currency": {
"rates": {
"USD": { "UAH": 24.47, "ETB": 32.04 }
}
}
}
}
```

If it exists, a rate defined in ext.prebid.currency.rates has the highest priority.
If a currency rate doesn't exist in the request, the external file will be used.

#### Rewarded Video (PBS-Java only)

Rewarded video is a way to incentivize users to watch ads by giving them 'points' for viewing an ad. A Prebid Server
client can declare a given adunit as eligible for rewards by declaring `imp.ext.prebid.is_rewarded_inventory:1`.

#### Stored Responses

While testing SDK and video integrations, it's important, but often difficult, to get consistent responses back from bidders that cover a range of scenarios like different CPM values, deals, etc. Prebid Server supports a debugging workflow in two ways:
Expand Down Expand Up @@ -615,33 +685,33 @@ It specifies where in the OpenRTB request non-standard attributes should be pass

```
{
ext: {
prebid: {
data: { bidders: [ 'rubicon', 'appnexus' ] } // these are the bidders allowed to see protected data
"ext": {
"prebid": {
"data": { "bidders": [ "rubicon", "appnexus" ] } // these are the bidders allowed to see protected data
}
},
site: {
keywords: "",
search: "",
ext: {
"site": {
"keywords": "",
"search": "",
"ext": {
data: { GLOBAL CONTEXT DATA } // only seen by bidders named in ext.prebid.data.bidders[]
}
},
user: {
keywords: "",
gender: "",
yob: 1999,
geo: {},
ext: {
"user": {
"keywords": "",
"gender": "",
"yob": 1999,
"geo": {},
"ext": {
data: { GLOBAL USER DATA } // only seen by bidders named in ext.prebid.data.bidders[]
}
},
imp: [
ext: {
context: {
keywords: "",
search: "",
data: { ADUNIT SPECFIC CONTEXT DATA } // can be seen by all bidders
"imp": [
"ext": {
"context": {
"keywords": "",
"search": "",
"data": { ADUNIT SPECFIC CONTEXT DATA } // can be seen by all bidders
}
}
]
Expand Down
Loading

0 comments on commit 6fd26e1

Please sign in to comment.