Skip to content

Commit

Permalink
adding module A/B test
Browse files Browse the repository at this point in the history
@AntoxaAntoxic - can you please take a look at the new section 3.2 and make sure I got the A/B test parameter defaults correct? Thanks.
  • Loading branch information
bretg authored Dec 6, 2024
1 parent 21778ea commit a130583
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions prebid-server/pbs-modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,65 @@ hooks:
}
```

### 3.2 A/B Testing Modules

Host companies and accounts might want to try enabling a module on a small percentage of traffic before turning it on all the way.

PBS-Java 3.16 introduced a new A/B testing framework that applies to any module.

```json5
{
"hooks": {
"execution-plan": {
"abtests": [{
"accounts": [ 123, 456 ], // these are ignored if in account-level config
"module-code": "module1",
"enabled": true, // defaults to false
"percent-active": 5, // defaults to 100
"log-analytics-tag": true // defaults to true
},{
... abtest config for other modules ...
}],
"endpoints": {
"/openrtb2/auction": {
...
}
}
]
]
]
```
These are the parameters accepted within the `abtests` object:
{: .table .table-bordered .table-striped }
| Parameter | Scope | Description | Type | Default |
|-----------+-------+-------------+------+---------|
| module-code | required | Which module is being tested. | string | none |
| percent-active | required | What percent of the time the module will run. | integer | none |
| accounts | optional | Defines which accounts this abtest block applies to. This is useful when the execution plan is defined at the host level and is ignored when the plan is at the account level. | array of int | none |
| enabled | optional | Allows the abtest to be disabled without removing it. | boolean | true |
| log-analytics-tag | optional | Directs PBS-core to log an analytics tag for reporting. | boolean | false |
To get reporting on the test results, analytics adapters will need to read the [analytics tag]() created by the A/B test, which looks like this:

Check failure on line 242 in prebid-server/pbs-modules/index.md

View workflow job for this annotation

GitHub Actions / run markdownlint

No empty links

prebid-server/pbs-modules/index.md:242:80 MD042/no-empty-links No empty links [Context: "[analytics tag]()"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md
```json5
{
activities: [{
name: "core-module-abtests",
status: "success",
results: [{ // one results object for each module in the abtests object
"status": STATUS, // "run" or "skipped"
"values": {
"module": "module1"
}
}]
},
... the status of other abtest decisions ...
}]
}
```
## Installing a PBS Privacy Module
Privacy modules are already built into the code base. They just need to be linked to the
Expand Down

0 comments on commit a130583

Please sign in to comment.