Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
c6c4101
Add Amx bidder (#1004)
SerhiiNahornyi Nov 18, 2020
e39955d
readme: updated for repo move (#1021)
bretg Nov 18, 2020
dfa9466
fix documentation link (#1026)
pragnesh Nov 19, 2020
52eed36
Add video support to EMX Digital bidder (#988)
SerhiiNahornyi Nov 19, 2020
d058fbd
Add Nobid bidder (#1005)
SerhiiNahornyi Nov 19, 2020
a4bfad1
Add client/AccountID support into Adoppler adapter (#1010)
SerhiiNahornyi Nov 19, 2020
d68d854
Adman bidder review (#1024)
SerhiiNahornyi Nov 19, 2020
4aa6ad4
AdkernelAdn bidder review (#1023)
SerhiiNahornyi Nov 19, 2020
2d6b248
Update repository reference after transfer under prebid organization …
schernysh Nov 19, 2020
356a66a
Admixer bidder review (#1025)
SerhiiNahornyi Nov 19, 2020
a36c40a
Use POST, preserve original user agent and user ip in the headers (#1…
sander-adhese Nov 20, 2020
97a682f
Avoid serializing analytics event entirely in LogAnalyticsReporter si…
schernysh Nov 20, 2020
47ad1ff
Review SmartadserverBidder (#1037)
SerhiiNahornyi Nov 30, 2020
a7b34ef
Prebid Server prepare release 1.50.0
Dec 2, 2020
c37d812
Prebid Server prepare for next development iteration
Dec 2, 2020
f31d91b
Fix github actions release publishing with set env in new way (#1043)
rpanchyk Dec 2, 2020
4e3bc4e
Prebid Server prepare release 1.50.0
Dec 2, 2020
f326927
Prebid Server prepare for next development iteration
Dec 2, 2020
2fcb8ab
Add currency rates staleness metric (#1030)
schernysh Dec 2, 2020
7e85714
Update conversant adapter for new prebid-server interface (#972)
SerhiiNahornyi Dec 2, 2020
dc27cf1
Add http api for fetching accounts (#1015)
SerhiiNahornyi Dec 2, 2020
59c90ed
Add metrics to track account cache hits and misses (#1018)
schernysh Dec 2, 2020
f721031
Add usage of GDPR and consent string for video (#1019)
DGarbar Dec 2, 2020
dcdca99
Get rid of default boolean configuration value in code (#1029)
schernysh Dec 2, 2020
02631d5
Plug in JVM metrics submission via metrics engine (#1031)
schernysh Dec 2, 2020
8e3d686
Review vendor-id property (#1035)
SerhiiNahornyi Dec 2, 2020
7c32a9d
Add silvermob bidder (#1034)
SerhiiNahornyi Dec 2, 2020
ea7c2d6
DMX Bidfloor fix (#1039)
SerhiiNahornyi Dec 2, 2020
1b4ba3c
Add Adform video bid response support (#1038)
SerhiiNahornyi Dec 2, 2020
a5ac56e
Review smartyAds bidder (#1036)
SerhiiNahornyi Dec 2, 2020
15dc15b
Review Yieldmo bidder (#1041)
DGarbar Dec 2, 2020
19c51fc
Review Vrtcal bidder (#1042)
DGarbar Dec 2, 2020
f86612c
Remove GDPR reqs (#1046)
bretg Dec 2, 2020
ae028c3
Remove out-dated differences matrix (#1045)
bretg Dec 2, 2020
c846c8b
Review deepintent adapter (#1049)
SerhiiNahornyi Dec 3, 2020
ba48c43
Review Triplelift bidder (#1047)
DGarbar Dec 3, 2020
dbe83a6
Bump jetty.version from 9.4.34.v20201102 to 9.4.35.v20201120 (#1048)
dependabot[bot] Dec 3, 2020
17cca28
Add video support to ttx bidder (#1032)
SerhiiNahornyi Dec 3, 2020
d0c70df
Fix Conversant bidder for changing banner or video (#1050)
DGarbar Dec 3, 2020
e27ceb6
updating README docs links (#1051)
bretg Dec 4, 2020
0e805f2
removing in favor of website matrix (#1052)
bretg Dec 4, 2020
271b201
Review conversant adapter (#1053)
SerhiiNahornyi Dec 7, 2020
1281121
Prebid Server prepare release 1.51.0
Dec 8, 2020
81669c4
Prebid Server prepare for next development iteration
Dec 8, 2020
1badbe3
GumGum bidder review (#1059)
SerhiiNahornyi Dec 8, 2020
95efc19
Review Smaato bidder (#1060)
DGarbar Dec 8, 2020
b67d884
Set 1.51.1 project version (#1061)
rpanchyk Dec 8, 2020
16c70c3
Deepintent redirect-url fix (#1062)
SerhiiNahornyi Dec 8, 2020
5f4d70c
Prebid Server prepare release 1.51.1
Dec 9, 2020
7867aee
Prebid Server prepare for next development iteration
Dec 9, 2020
783670e
Add invalid ccpa notification in debug error response (#787)
DGarbar Dec 11, 2020
5e7b6c4
Add configuration for lmt enforcement (#826)
DGarbar Dec 11, 2020
99e31f2
Smaato usersync update (#1064)
SerhiiNahornyi Dec 11, 2020
205560c
Mobilefuse endpoint update (#1066)
SerhiiNahornyi Dec 11, 2020
de4a833
Make TCF metrics to reflect real bidding (#798)
rpanchyk Dec 11, 2020
4d42c2c
Remove DigiTrust support (#911)
schernysh Dec 11, 2020
60bd9ca
Make glv id optional (#839)
BraslavskiyAndrey Dec 11, 2020
cbeaeea
Clean bidder integration tests JSONs (#1068)
rpanchyk Dec 11, 2020
147fb2a
Add removing of all duplicated bids (#821)
DGarbar Dec 11, 2020
7bf95f1
Add an option to discard latest external currency rates after configu…
schernysh Dec 14, 2020
8ba1061
include format targeting flag implemented (#845)
BraslavskiyAndrey Dec 15, 2020
bebb407
Filter not supported types for Rubicon bidder (#855)
BraslavskiyAndrey Dec 15, 2020
7f98043
Add including of targeting for video in case if we had "includeBidder…
DGarbar Dec 15, 2020
3f0ebe2
Make valid request with duplicating eids (#892)
DGarbar Dec 15, 2020
f6bc30f
Remove safari metrics (#1074)
BraslavskiyAndrey Dec 15, 2020
3609032
Handling of eids with duplicate source (#1075)
SerhiiNahornyi Dec 15, 2020
5e331cb
Implement default bid request support (#850)
schernysh Dec 15, 2020
e8f6b8f
Add bid size and secure markup validations, controlled by host throug…
schernysh Dec 17, 2020
3ce7df9
Make SQL query for retrieving account configurable (#811)
schernysh Dec 18, 2020
04616e8
Update deepintent usersync config (#1083)
SerhiiNahornyi Dec 23, 2020
55a4d9c
Support excluded bidders from config in userId/deviceId masking (#1082)
DGarbar Dec 23, 2020
c44b25c
accounts config doc updates (#1096)
bretg Jan 13, 2021
4183e2d
Prebid Server prepare release 1.52.0
Jan 13, 2021
993ecea
Prebid Server prepare for next development iteration
Jan 13, 2021
b508b4b
Log missing video size id for RubiconBidder (#877)
BraslavskiyAndrey Jan 14, 2021
c60c539
Add log with key to not depend on message (#1089)
DGarbar Jan 14, 2021
0817d1e
Update appnexus ext request when include targeting is not null (#913)
BraslavskiyAndrey Jan 14, 2021
0880bb3
Change GVL URL (#1086)
rpanchyk Jan 14, 2021
fa3ce16
Implement new logic for video sizeId in Rubicon bidder (#931)
SerhiiNahornyi Jan 14, 2021
06cd27e
Add adapter prefix to bidder specific metrics (#973)
DGarbar Jan 15, 2021
220481c
Default account configuration and account status support (#959)
schernysh Jan 15, 2021
1f2d59b
Update currencyService to accept bidRequest as parameter (#968)
BraslavskiyAndrey Jan 15, 2021
c1162fa
Add errorWithKey for Conditional logger (#1099)
DGarbar Jan 15, 2021
1e8e9f2
Fix undefined Account status fetching (#1101)
rpanchyk Jan 18, 2021
9a86826
Update IX bidder to support all MediaTypes. (#1098)
DGarbar Jan 18, 2021
d5ea0de
Update PBS to generate bid ids for cache and events (#1100)
BraslavskiyAndrey Jan 18, 2021
6f15040
Fix setting Rubicon size id using video placement (#1103)
rpanchyk Jan 18, 2021
00354f1
Fixed mismatched winUrl and VastXml (#1104)
DGarbar Jan 19, 2021
bb4a22f
Fix passing ext.prebid.targeting.* fields (#1105)
rpanchyk Jan 20, 2021
b31e5f2
Fix passing ext.prebid.targeting.* fields for AMP (#1108)
rpanchyk Jan 20, 2021
0567edb
Prebid Server prepare release 1.53.0
Jan 21, 2021
49fab79
Prebid Server prepare for next development iteration
Jan 21, 2021
5dc8902
Updating contact info for adprime (#1110)
DGarbar Jan 21, 2021
d4b4dc3
Update ucfunnel endpoint (#1111)
DGarbar Jan 21, 2021
936ff1e
Drop duplicated targeting keys (#910)
DGarbar Jan 21, 2021
6ebb602
adding status column to account table doc (#1112)
bretg Jan 21, 2021
dfe9572
Fix broken test (#1114)
DGarbar Jan 22, 2021
3d8b155
Validate that schains do not contain duplicate bidders (#816)
schernysh Jan 22, 2021
5329195
Add support for host defined schain node (#1102)
schernysh Jan 22, 2021
f35f6c8
Update VerizonMedia bidder config (#1087)
rpanchyk Jan 22, 2021
aea2dd8
Add new Rubicon size (#980)
SerhiiNahornyi Jan 22, 2021
d39e9f7
Add app capabilities to VerizonMedia adapter (#1067)
SerhiiNahornyi Jan 22, 2021
9b20db8
Set Kubient email to prebid@kubient.com (#1085)
rpanchyk Jan 22, 2021
756c859
Extract bids removal into separate component (#1080)
schernysh Jan 22, 2021
08d2f0a
Make sure jetty (used by WireMock under the hood) server is gracefull…
schernysh Jan 22, 2021
629ece3
Set the right domain for AMP requests (#1033)
schernysh Jan 22, 2021
e1f8af7
Resolve pubnative bid size from banner's size or formats (#1093)
BraslavskiyAndrey Jan 25, 2021
f680e79
Add generate bid id property for conversant bidder (#1094)
BraslavskiyAndrey Jan 25, 2021
2939c96
Add support for multi-imp requests in ttx bidder (#1069)
SerhiiNahornyi Jan 28, 2021
eed8d5d
Fix setting site domain (#1120)
rpanchyk Jan 28, 2021
439c015
Fix logic around injecting global schain node (#1122)
schernysh Jan 28, 2021
8adab72
Prebid Server prepare release 1.54.0
Jan 29, 2021
eea1cdd
Prebid Server prepare for next development iteration
Jan 29, 2021
2865b07
Apply stash
sander-adhese Jan 29, 2021
05b7ea2
follow same convention for stored request example like stored impress…
pragnesh Jan 29, 2021
1927a30
Use obj serialization
sander-adhese Jan 29, 2021
2d8eecb
Leave out unnecessary field
sander-adhese Jan 29, 2021
cd172bd
throw away unnecessary stuff
sander-adhese Jan 29, 2021
4eaa214
Comply with code style
sander-adhese Jan 29, 2021
f08035a
Support imp.ext.prebid.bidder.<bidder> as a new place for bidder para…
schernysh Jan 29, 2021
8dd5753
Merge branch 'master' into fix_prebid_post
sander-adhese Jan 29, 2021
97453c1
Process feedback
sander-adhese Feb 11, 2021
ff1c90a
Looks like this can't go
sander-adhese Feb 11, 2021
fbea48c
Process feedback
sander-adhese Feb 18, 2021
afc068f
Process feedback
sander-adhese Feb 22, 2021
70e0b75
Replace literal JSON strings with AdheseRequestBody
sander-adhese Apr 28, 2021
c401146
fix over-sized line
sander-adhese Apr 28, 2021
3fe6040
Replace List.of with Arrays.asList
sander-adhese Apr 28, 2021
03c63d7
Replace the other Java 9 shorthands
sander-adhese Apr 28, 2021
50e2eca
Explicit typing
sander-adhese Apr 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Extract tag from commit message
run: |
target_tag=${COMMIT_MSG#"Prebid Server prepare release "}
echo "::set-env name=TARGET_TAG::$target_tag"
echo "TARGET_TAG=$target_tag" >> $GITHUB_ENV
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
- name: Create and publish release
Expand Down
75 changes: 36 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
### This code is being used in production by multiple Prebid.org members, but is not the "official" version. See https://github.com/prebid/prebid-server/
### This is the Java version of Prebid Server. See the Prebid Server [Feature List](https://docs.prebid.org/prebid-server/features/pbs-feature-idx.html) and [FAQ entry](https://docs.prebid.org/faq/prebid-server-faq.html#why-are-there-two-versions-of-prebid-server-are-they-kept-in-sync) to understand the differences between PBS-Java and [PBS-Go](https://github.com/prebid/prebid-server).

# Prebid Server
# Prebid Server (Java)

[![GitHub version](https://badge.fury.io/gh/rubicon-project%2fprebid-server-java.svg)](http://badge.fury.io/gh/rubicon-project%2fprebid-server-java)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/rubicon-project/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rubicon-project/prebid-server-java/context:java)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/rubicon-project/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rubicon-project/prebid-server-java/alerts/)
[![GitHub contributors](https://img.shields.io/github/contributors/rubicon-project/prebid-server-java.svg)](https://GitHub.com/rubicon-project/prebid-server-java/contributors/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/rubicon-project/prebid-server-java/blob/master/docs/contributing.md)
[![GitHub pull-requests closed](https://img.shields.io/github/issues-pr-closed/rubicon-project/prebid-server-java.svg)](https://GitHub.com/rubicon-project/prebid-server-java/pull/)
[![GitHub version](https://badge.fury.io/gh/prebid%2fprebid-server-java.svg)](http://badge.fury.io/gh/prebid%2fprebid-server-java)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/prebid/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/prebid-server-java/context:java)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/prebid/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/prebid-server-java/alerts/)
[![GitHub contributors](https://img.shields.io/github/contributors/prebid/prebid-server-java.svg)](https://GitHub.com/prebid/prebid-server-java/contributors/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/prebid/prebid-server-java/blob/master/docs/contributing.md)
[![GitHub pull-requests closed](https://img.shields.io/github/issues-pr-closed/prebid/prebid-server-java.svg)](https://GitHub.com/prebid/prebid-server-java/pull/)

Prebid Server is an open source implementation of Server-Side Header Bidding.
It is managed by [Prebid.org](http://prebid.org/overview/what-is-prebid-org.html),
and upholds the principles from the [Prebid Code of Conduct](http://prebid.org/wrapper_code_of_conduct.html).
It is managed by Prebid.org,
and upholds the principles from the [Prebid Code of Conduct](https://prebid.org/wrapper_code_of_conduct.html).

This project does not support the same set of Bidders as Prebid.js, although there is overlap.
The current set can be found in the [adapters](./src/main/java/org/prebid/server/bidder) package. If you don't see the one you want, feel free to [contribute it](docs/developers/add-new-bidder.md).

For more information, see:

- [What is Prebid?](http://prebid.org/overview/intro.html)
- [Getting started with Prebid Server](http://prebid.org/dev-docs/get-started-with-prebid-server.html)
- [Current Bidders](http://prebid.org/dev-docs/prebid-server-bidders.html)
- [What is Prebid?](https://prebid.org/why-prebid/)
- [Getting started with Prebid Server](https://docs.prebid.org/prebid-server/overview/prebid-server-overview.html)
- [Current Bidders](https://docs.prebid.org/dev-docs/pbs-bidders.html)

# Getting Started

The server makes the following assumptions:
- No ranking or decisioning is performed by this server. It just proxies requests.
- No ad quality management (e.g., malware, viruses, deceptive creatives) is performed by this server.
- This server does no fraud scanning and does nothing to prevent bad traffic.
- This server does no logging.
- This server has not user profiling or user data collection capabilities.
- This server logs errors but not requests.
- This server has no user profiling or user data collection capabilities.

This project is built upon [Vert.x](http://vertx.io) to achieve high request throughput.
We use [Maven](https://maven.apache.org) and attempt to introduce minimal dependencies.

When running, the server responds to several HTTP [endpoints](docs/endpoints).

To start the Prebid Server you need to do the following steps:

## Building

Follow next steps to create JAR file which can be deployed locally.

- Download or clone a project:
```bash
git clone https://github.com/rubicon-project/prebid-server-java.git
git clone https://github.com/prebid/prebid-server-java.git
```

- Move to project directory:
Expand Down Expand Up @@ -84,28 +82,27 @@ and verify response status is `200 OK`.
# Documentation

## Development
- [Differences Between Prebid Server Go and Java](differenceBetweenPBSGo-and-Java.md)
- [Endpoints](endpoints)
- [Adding new bidder](developers/add-new-bidder.md)
- [Adding new analytics module](developers/add-new-analytics-module.md)
- [Adding viewability support](developers/add-viewability-vendors.md)
- [Auction result post-processing](developers/auction-result-post-processing.md)
- [Cookie Syncs](developers/cookie-syncs.md)
- [Stored Requests](developers/stored-requests.md)
- [Unit Tests](developers/unit-tests.md)
- [GDPR](developers/gdpr.md)
- [Endpoints](docs/endpoints)
- [Adding new bidder](docs/developers/add-new-bidder.md)
- [Adding new analytics module](docs/developers/add-new-analytics-module.md)
- [Adding viewability support](docs/developers/add-viewability-vendors.md)
- [Auction result post-processing](docs/developers/auction-result-post-processing.md)
- [Cookie Syncs](docs/developers/cookie-syncs.md)
- [Stored Requests](docs/developers/stored-requests.md)
- [Unit Tests](docs/developers/unit-tests.md)
- [GDPR](docs/developers/gdpr.md)

## Maintenance
- [Build for local](build.md)
- [Build for AWS](build-aws.md)
- [Configure application](config.md)
- [Full list of configuration options](config-app.md)
- [Application settings](application-settings.md)
- [Run with optimizations](run.md)
- [Metrics](metrics.md)
- [Build for local](docs/build.md)
- [Build for AWS](docs/build-aws.md)
- [Configure application](docs/config.md)
- [Full list of configuration options](docs/config-app.md)
- [Application settings](docs/application-settings.md)
- [Run with optimizations](docs/run.md)
- [Metrics](docs/metrics.md)

## Contributing
- [Contributing](contributing.md)
- [Code Style](code-style.md)
- [Code Review](code-reviews.md)
- [Versioning](versioning.md)
- [Contributing](docs/contributing.md)
- [Code Style](docs/code-style.md)
- [Code Review](docs/code-reviews.md)
- [Versioning](docs/versioning.md)
163 changes: 120 additions & 43 deletions docs/application-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ There are two ways to configure application settings: database and file. This do
- `truncate-target-attr` - Maximum targeting attributes size. Values between 1 and 255.
- `default-integration` - Default integration to assume.
- `analytics-config.auction-events.<channel>` - defines which channels are supported by analytics for this account
- `bid-validations.banner-creative-max-size` - Overrides creative max size validation for banners.
- `status` - allows to mark account as `active` or `inactive`.

Here are the definitions of the "purposes" that can be defined in the GDPR setting configurations:
```
Purpose | Purpose goal | Purpose meaning for PBS (n\a - not affected)
----------|---------------------------------|---------------------------------------------
p1 | Access device | Stops usersync for given vendor and stops settings cookie on `/seuid`
p2 | Select basic ads | Verify consent for each vendor as appropriate for the enforcement method before calling a bid adapter. If consent is not granted, log a metric and skip it.
p3 | Personalized ads profile | n\a
p4 | Select personalized ads | Verify consent for each vendor that passed the Purpose 2. If consent is not granted, remove the bidrequest.userId, user.ext.eids, user.ext.digitrust, device.if attributes and call the adapter.
p4 | Select personalized ads | Verify consent for each vendor that passed the Purpose 2. If consent is not granted, remove the bidrequest.userId, user.ext.eids, device.if attributes and call the adapter.
p5 | Personalized content profile | n\a
p6 | Select personalized content | n\a
p7 | Measure ad performance | Verify consent for each analytics module. If consent is not grantet skip it.
Expand All @@ -42,22 +45,26 @@ sf1 | Precise geo | Verifies user opt-in. If the user
sf2 | Fingerprinting | n\a
```

## File application setting
## Setting Account Configuration in Files

In file based approach all configuration stores in .yaml files, path to which are defined in application properties.

### Configuration in application.yaml

```
The general idea is that you'll place all the account-specific settings in a separate YAML file and point to that file.

```yaml
settings:
filesystem:
settings-filename: <directory to yaml file with settings>
```
### File format

```
Here's an example YAML file containing account-specific settings:

```yaml
accounts:
- id: 14062
- id: 1111
bannerCacheTtl: 100
videoCacheTtl: 100
eventsEnabled: true
Expand All @@ -69,6 +76,7 @@ accounts:
analytics-config:
auction-events:
amp: true
status: active
gdpr:
enabled: true
integration-enabled:
Expand Down Expand Up @@ -151,63 +159,80 @@ accounts:
purpose-one-treatment-interpretation: ignore
```


## Database application setting
## Setting Account Configuration in the Database

In database approach account properties are stored in database table.

In database approach account properties are stored in database table with name accounts_account.
SQL query for retrieving account is configurable and can be specified in [application configuration](config-app.md).
Requirements for the SQL query stated below.

### Configuration in application.yaml
```

```yaml
settings:
database:
type: <mysql or postgres>
pool-size: 20
type: mysql
type: <mysql or postgres>
host: <host>
port: <port>
account-query: <SQL query for account>
```

### Table description
### Configurable SQL query for account requirements

Query to create accounts_account table:
The general approach is that each host company can set up their database however they wish, so long as the configurable query run by
Prebid Server returns expected data in the expected order. Here's an example configuration:

```yaml
settings:
database:
type: mysql
account-query: SELECT uuid, price_granularity, banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, analytics_sampling_factor, truncate_target_attr, default_integration, analytics_config, bid_validations, status FROM accounts_account where uuid = ? LIMIT 1
```
'CREATE TABLE `accounts_account` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(40) NOT NULL,
`price_granularity` enum('low','med','high','auto','dense','unknown') NOT NULL DEFAULT 'unknown',
`granularityMultiplier` decimal(9,3) DEFAULT NULL,
`banner_cache_ttl` int(11) DEFAULT NULL,
`video_cache_ttl` int(11) DEFAULT NULL,
`events_enabled` bit(1) DEFAULT NULL,
`enforce_ccpa` bit(1) DEFAULT NULL,
`enforce_gdpr` bit(1) DEFAULT NULL,
`tcf_config` json DEFAULT NULL,
`analytics_sampling_factor` tinyint(4) DEFAULT NULL,
`truncate_target_attr` tinyint(3) unsigned DEFAULT NULL,
`default_integration` varchar(64) DEFAULT NULL,
`analytics_config` varchar(512) DEFAULT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`updated_by` int(11) DEFAULT NULL,
`updated_by_user` varchar(64) DEFAULT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uuid` (`uuid`))
ENGINE=InnoDB DEFAULT CHARSET=utf8'
```

where tcf_config column is json with next format
The SQL query for account must:
* return following columns, with specified type, in this order:
* account ID, string
* price granularity, string
* banner cache TTL, integer
* video cache TTL, integer
* events enabled flag, boolean
* enforce CCPA flag, boolean
* TCF configuration, JSON string, see below
* analytics sampling factor, integer
* maximum targeting attribute size, integer
* default integration value, string
* analytics configuration, JSON string, see below
* status, string. Expected values: "active", "inactive", NULL. Only "inactive" has any effect and only when settings.enforce-valid-account is on.
* specify a special single `%ACCOUNT_ID%` placeholder in the `WHERE` clause that will be replaced with account ID in
runtime

It is recommended to include `LIMIT 1` clause in the query because only the very first result returned will be taken.

If a host company doesn't support a given field, or they have a different table name, they can just update the query with whatever values are needed. e.g.

```yaml
settings:
database:
type: mysql
account-query: SELECT uuid, 'med', banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, 0, null, default_integration, '{}', '{}' FROM myaccountstable where uuid = ? LIMIT 1
```
### Configuration Details

#### TCF configuration JSON

Here's an example of the value that the `tcf_config` column can take:

```json
{
"enabled": true,
"integration-enabled": {
"video": true,
"web": true,
"app": true,
"amp": true
}
"purpose-one-treatment-interpretation": "ignore"
},
"purpose-one-treatment-interpretation": "ignore",
"purposes": {
"p1": {
"enforce-purpose": "full",
Expand Down Expand Up @@ -309,10 +334,62 @@ where tcf_config column is json with next format
}
```

Query used to get an account:
#### Bid Validations configuration JSON

The `bid_validations` column is json with this format:

```json
{
"banner-creative-max-size": "enforce"
}
```

Valid values are:
- "skip": don't do anything about creative max size for this publisher
- "warn": if a bidder returns a creative that's larger in height or width than any of the allowed sizes, log an operational warning.
- "enforce": if a bidder returns a creative that's larger in height or width than any of the allowed sizes, reject the bid and log an operational warning.

#### Analytics Validations configuration JSON

The `analytics_config` configuration column format:

```json
{
"auction-events": {
"web": true, // the analytics adapter should log auction events when the channel is web
"amp": true, // the analytics adapter should log auction events when the channel is AMP
"app": false // the analytics adapter should not log auction events when the channel is app
}
}
```
SELECT uuid, price_granularity, banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, analytics_sampling_factor, truncate_target_attr, default_integration, analytics_config
FROM accounts_account where uuid = ?
LIMIT 1

#### Creating the accounts table

Traditionally the table name used by Prebid Server is `accounts_account`. No one remembers why. But here's SQL
you could use to create your table:

```sql
'CREATE TABLE `accounts_account` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(40) NOT NULL,
`price_granularity` enum('low','med','high','auto','dense','unknown') NOT NULL DEFAULT 'unknown',
`granularityMultiplier` decimal(9,3) DEFAULT NULL,
`banner_cache_ttl` int(11) DEFAULT NULL,
`video_cache_ttl` int(11) DEFAULT NULL,
`events_enabled` bit(1) DEFAULT NULL,
`enforce_ccpa` bit(1) DEFAULT NULL,
`enforce_gdpr` bit(1) DEFAULT NULL,
`tcf_config` json DEFAULT NULL,
`analytics_sampling_factor` tinyint(4) DEFAULT NULL,
`truncate_target_attr` tinyint(3) unsigned DEFAULT NULL,
`default_integration` varchar(64) DEFAULT NULL,
`analytics_config` varchar(512) DEFAULT NULL,
`bid_validations` json DEFAULT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`updated_by` int(11) DEFAULT NULL,
`updated_by_user` varchar(64) DEFAULT NULL,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uuid` (`uuid`))
ENGINE=InnoDB DEFAULT CHARSET=utf8'
```
12 changes: 8 additions & 4 deletions docs/bidders/appnexus.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ that would match with the test creative.
}]
},
"ext": {
"appnexus": {
"placementId": 13144370
}
}
"prebid": {
"bidder":{
"appnexus": {
"placementId": 13144370
}
}
}
}
}]
```
Loading