prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Enhance module A/B testing by adding an ad server targeting keyword into the response

Open justadreamer opened this issue 3 months ago • 4 comments

Motivation

Indicate to a particular ad server consuming targeting keywords whether the module was run and not, so it can be reflected in the reporting and allow to compare control vs. treatment variants in terms of f.e. revenue.

Background

Currently we have the A/B testing for modular infrastructure this implemented in PBS-Java: https://github.com/prebid/prebid-server/issues/3681

The proposal is to add "adserver-targeting": "keyword-name". That will be added as a distinct keyword to the targeting keywords in the response to be sent to GAM. The value should be "skip" if the module was not run and "run" if it was run. Note the "adserver-targeting" param in the abtests[] config:

{
    "hooks": {
        "modules": {
            "my-module": {
                 "params-seen-by-module": { ... }
            }
        },
        "execution-plan": {
            "abtests": [{
              "accounts": [ 123, 456 ],                 // ignore if in account-level config
              "module-code": "my-module",
              "enabled": true,                                // defaults to false
              "percent-active": 5,                         // defaults to 100
              "log-analytics-tag": true,                 // defaults to true
              "adserver-targeting": "keyword-name" 
            },{
               ... abtest config for other modules ...
            }],
            "endpoints": {
                "/openrtb2/auction": {
                    ...
                 }
            }
        }
    }
}

Objectives

  1. Add the above config option.
  2. Implement the functionality in the core to add this keyword with "skip" or "run" value depending on whether the module was run or not (probably that choice of a status is retained in the context until the response forming stages of the auction)

justadreamer avatar Sep 10 '25 12:09 justadreamer

Discussed in backlog, seems straightforward but waiting to meet with @justadreamer to confirm intention before moving to ready for dev.

bsardo avatar Sep 19 '25 14:09 bsardo

@Net-burst just checking if you have any thoughts here. Discussed at the PMC and we are ready to move it to ready-for-dev if you're good with this addition.

bsardo avatar Sep 24 '25 14:09 bsardo

Discussed again backlog. There is a possibility the targeting keyword might need to be moved from the execution plan to the module config to avoid a major refactor.

bsardo avatar Oct 17 '25 14:10 bsardo

Discussed with @Net-burst. The only change we'll make to the spec is that the GAM keyword should rather take a string value reflecting the A/B testing infrastructure status: "run" or "skip" .
The rationale is that this is extendable for future statuses should we ever need them. While what was originally proposed as 0 or 1 status would be too restrictive and would require breaking changes if we ever need to extend.

The corresponding KVP would look like:

{"<keyword-name>" : "run"}

or

{"<keyword-name>" : "skip"}

(also updated the main description, thanks @Net-burst for pointing out this design flaw)

justadreamer avatar Oct 21 '25 14:10 justadreamer