From 375a9a566528166c0c225c4f8f611850df4b16db Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Mon, 27 Jan 2025 22:37:01 +0100 Subject: [PATCH 1/7] fix review --- .../greenbids-analytics-reporter.md | 259 ++++++++++++++++-- 1 file changed, 231 insertions(+), 28 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index 2e20710330..c1f47213c8 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -1,55 +1,258 @@ --- layout: page_v2 page_type: pbs-module -title: Prebid Server Greenbids PBS Analytics Reporter -display_name : Prebid Server Greenbids Analytics Reporter +title: Prebid Server Greenbids Real Time Data Module +display_name : Greenbids Real Time Data Module sidebarType : 5 --- -# Overview +# Greenbids Real Time Data Module -This analytics adapter communicates with the Greenbids Analytics Server by sending it the information about bids for the publisher inventory sold through PBS. The Greenbids Analytics module requires setup and approval from the Greenbids team for each publisher. Please reach out to our team for more information [greenbids.ai](https://greenbids.ai). +## Overview + +Greenbids Real Time Data module filters bidders SSPs listed in the `imp[].ext.prebid.bidder` of the bid request. +To perform the filtering the module uses AI to predict the bidding probability of bid per SSP for each `imp` for the given bid request. +This bidding probability is used to choose to send the bid request or not, according to the performance constraints applied by the partner publisher. + +The RTD module uses 2 artefacts that are fetched from the Greenbids Google Cloud Storage bucket + +- ML predictor in `.onnx` format: used to predict the bidding probability +- Probability thresholds in `.json` format: used to convert the bidding probability to a binary choice ## Configuration -The Greenbids Analytics Reporter references global parameters defined in application.yaml. For example: +### Execution Plan + +This module supports running at: + +- processed-auction-request: this is where PBS bid request enrichments + are done before customizing it to a particular bidder in the auction. + +### Account-Level Config + +The module is invoked based on account config. The logic of the config is as follows: +- `BidRequest` extension if defined takes precedence over account configs. +- If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. + The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. +- If the account config is not defined, the default account config is used. It is defined in `settings.default-account-config` field of the Prebid config. + +Here's an example of the account config used in PBS-Java: + +BidRequest extension: +```json +"ext": { + "analytics": { + "greenbids": { + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 1 + }, + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.55, + "exploration-rate": 0.0005 + } + } + } +``` +Account config: ```yaml +hooks: + modules: + greenbids-real-time-data: + pbuid: "PBUID_FROM_GREENBIDS" + target-tpr: 0.96 + exploration-rate: 0.002 analytics: - greenbids: - analytics-server-version: "2.2.0" - analytics-server: http://localhost:8090 - exploratory-sampling-split: 0.9 - timeout-ms: 10000 + modules: + greenbids: + pbuid: "PBUID_FROM_GREENBIDS" + greenbids-sampling: 0.002 +``` + +Default account config: +```yaml +settings: + default-account-config: > + { + "hooks": { + "modules": { + "greenbids-real-time-data": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.95, + "exploration-rate": 0.001 + } + } + }, + "analytics": { + "modules": { + "greenbids": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 0.001 + } + } + } + } +``` + +Execution plan setup: +```yaml +hooks: + greenbids-real-time-data: + enabled: true + host-execution-plan: > + { + "endpoints": { + "/openrtb2/auction": { + "stages": { + "processed-auction-request": { + "groups": [ + { + "timeout": 100, + "hook-sequence": [ + { + "module-code": "greenbids-real-time-data", + "hook-impl-code": "greenbids-real-time-data-processed-auction-request-hook" + } + ] + } + ] + } + } + } + } + } ``` -Here's a description of the global parameters: +### List of module configuration options -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| analytics-server-version | string | Version of Analytics Schema Greenbids side | -| analytics-server | string | Greenbids Analytics Server URL | -| exploratory-sampling-split | float | Exploration vs Exploitation ratio of analytics traffic | -| timeout-ms | int | Timeout limit on sending POST request to Greenbids Analytics Server | +- `google-cloud-greenbids-project`: Google Cloud project associated with Greenbids +- `gcs-bucket-name`: Google Cloud Storage (GCS) bucket used to fetch the artefacts ([ONNX](https://onnx.ai/) model and thresholds `.json`) necessary for prediction +- `cache-expiration-minutes`: The duration (in minutes) after which cached model and thresholds should be considered expired and refreshed +- `geo-lite-country-path`: URL to the geo-ip database +- `onnx-model-cache-key-prefix`: prefix necessary for getting cached ONNX model +- `thresholds-cache-key-prefix`: prefix necessary for getting cached throttling thresholds -The Greenbids Analytics module also includes account-specific parameters for each publisher setup. These parameters should be included in the extension of the bid request json: `ext.prebid.analytics.greenbids` +```yaml +greenbids-real-time-data: + google-cloud-greenbids-project: "greenbids-357713" + gcs-bucket-name: "greenbids-europe-west1-prebid-server-staging" + cache-expiration-minutes: 15 + geo-lite-country-path: "https://git.io/GeoLite2-Country.mmdb" + onnx-model-cache-key-prefix: "onnxModelRunner_" + thresholds-cache-key-prefix: "throttlingThresholds_" +``` + +### Publisher bid request settings + +The activated partner publishers add their configs direclty into `bid-request.json` +where they indicate the activation of our module +in bid request extenstion `bid-request.ext.prebid.analytics.greenbids` +for [Analytics Reporter](https://docs.prebid.org/prebid-server/pbs-modules/greenbids-analytics-reporter.html) and +`bid-request.ext.prebid.analytics.greenbids-rtd` for Greenbids RTD Module. -| Parameter | Scope | Description | Example | Type | -| --------- | ---- | ------------- | ------------- | ----------- | -| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | -| greenbidsSampling | optional | sampling factor [0-1] (a value of 0.1 will filter 90% of the traffic) | 1.0 | float | +The list of the parameters necessary for RTD module activation is as follows: -An example of publisher config in the bid request extension is as follows: +| Parameter | Scope | Description | Example | Type | +|-----------------|-------------------|-----------------------------------------------------------------------------------------------------|-----------------------|--------------| +| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | +| targetTpr | required | Expected retained opportunities ratio [0-1] | 0.9 | float | +| explorationRate | required | Ratio of traffic without filtering used for training ML model [0-1] (a value of 0.1 will filter 90% of the traffic) | 0.1 | float | + +Here's an example of how a PBS partner publisher setup using both Greenbids RTD Module and Greenbids AnalyticsReporter should look like: ```json "ext": { - "prebid": { - "analytics": { - "greenbids": { - "pbuid": "PUBID_FROM_GREENBIDS", - "greenbidsSampling": 1.0 + "prebid": { + "analytics": { + // extension for Greenbids Analytics Reporter + "greenbids": { + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbidsSampling": 0.01 + }, + // extension for Greenbids Real Time Data Module + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "targetTpr": 0.95, + "explorationRate": 0.001 + } } } } +``` + +### Enable for Spring Boot + +In order to allow the module to be picked up by PBS-Java, a Spring Boot configuration property `hooks.greenbids-real-time-data.enabled` must be set to `true`. + +Here's an example of how your PBS configuration YAML should look like: + +```YAML +hooks: + greenbids-real-time-data: + enabled: true +``` + +## Analytics Tags + +The RTD module also communicates the filtering results with the `GreenbidsAnalyticsReporter` via [AnalyticsTags](https://docs.prebid.org/prebid-server/developers/module-atags.html). +Here we populate analytics result of analytics tags for each `imp` the with: + +- `fingerprint`: greenbidsId +- `isKeptInAuction`: map of booleans for each bidder whether we keep them in auction or not for the given imp +- `isExploration`: flag that is necessary to isolate the training data + +The analytics tag is then parsed by the AnalyticsReporter from `HookExecutionContext` +and its content added to the analytics payload sent to Greenbids server. The exploration part of traffic is split randomly with the ratio defined for each partner publisher +per bid requests and is not filtered by the RTD module. + +Here's an example analytics tag that might be produced for use in an analytics adapter: + +```json +{ + "activities": [ + { + "name": "greenbids-filter", + "status": "success", + "results": [ + { + "status": "success", + "values": { + "pub_banniere_haute": { + "greenbids": { + "fingerprint": "ad63524e-b13f-4359-a975-dba9b5dc08f4", + "keptInAuction": { + "improvedigital": false, + "appnexus": true, + "pubmatic": false, + "rubicon": true, + "teads": false + }, + "isExploration": false + }, + "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" + } + }, + "appliedTo": { + "bidders": "bidderA", + "impIds": "impId1" + } + } + ] + } + ] } ``` + +## Maintainer contacts + +For any questions and suggestions please reach out to our team for more information [greenbids.ai](https://greenbids.ai). + +Or just open new [issue](https://github.com/prebid/prebid-server-java/issues/new) or [pull request](https://github.com/prebid/prebid-server-java/pulls) in this repository. + +## Further Reading + +- [Prebid Server Module List](/prebid-server/pbs-modules/index.html) +- [Building a Prebid Server Module](/prebid-server/developers/add-a-module.html) From bbfd5c911561bd361a2547d3c49150a492453de7 Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Mon, 27 Jan 2025 22:40:04 +0100 Subject: [PATCH 2/7] Greenbids RTD: Account config docs --- .../greenbids-analytics-reporter.md | 259 ++---------------- .../pbs-modules/greenbids-real-time-data.md | 68 ++++- 2 files changed, 95 insertions(+), 232 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index c1f47213c8..2e20710330 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -1,258 +1,55 @@ --- layout: page_v2 page_type: pbs-module -title: Prebid Server Greenbids Real Time Data Module -display_name : Greenbids Real Time Data Module +title: Prebid Server Greenbids PBS Analytics Reporter +display_name : Prebid Server Greenbids Analytics Reporter sidebarType : 5 --- -# Greenbids Real Time Data Module +# Overview -## Overview - -Greenbids Real Time Data module filters bidders SSPs listed in the `imp[].ext.prebid.bidder` of the bid request. -To perform the filtering the module uses AI to predict the bidding probability of bid per SSP for each `imp` for the given bid request. -This bidding probability is used to choose to send the bid request or not, according to the performance constraints applied by the partner publisher. - -The RTD module uses 2 artefacts that are fetched from the Greenbids Google Cloud Storage bucket - -- ML predictor in `.onnx` format: used to predict the bidding probability -- Probability thresholds in `.json` format: used to convert the bidding probability to a binary choice +This analytics adapter communicates with the Greenbids Analytics Server by sending it the information about bids for the publisher inventory sold through PBS. The Greenbids Analytics module requires setup and approval from the Greenbids team for each publisher. Please reach out to our team for more information [greenbids.ai](https://greenbids.ai). ## Configuration -### Execution Plan - -This module supports running at: - -- processed-auction-request: this is where PBS bid request enrichments - are done before customizing it to a particular bidder in the auction. - -### Account-Level Config - -The module is invoked based on account config. The logic of the config is as follows: -- `BidRequest` extension if defined takes precedence over account configs. -- If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. - The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. -- If the account config is not defined, the default account config is used. It is defined in `settings.default-account-config` field of the Prebid config. - -Here's an example of the account config used in PBS-Java: - -BidRequest extension: -```json -"ext": { - "analytics": { - "greenbids": { - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 1 - }, - "greenbids-rtd": { - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.55, - "exploration-rate": 0.0005 - } - } - } -``` +The Greenbids Analytics Reporter references global parameters defined in application.yaml. For example: -Account config: ```yaml -hooks: - modules: - greenbids-real-time-data: - pbuid: "PBUID_FROM_GREENBIDS" - target-tpr: 0.96 - exploration-rate: 0.002 analytics: - modules: - greenbids: - pbuid: "PBUID_FROM_GREENBIDS" - greenbids-sampling: 0.002 -``` - -Default account config: -```yaml -settings: - default-account-config: > - { - "hooks": { - "modules": { - "greenbids-real-time-data": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.95, - "exploration-rate": 0.001 - } - } - }, - "analytics": { - "modules": { - "greenbids": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 0.001 - } - } - } - } -``` - -Execution plan setup: -```yaml -hooks: - greenbids-real-time-data: - enabled: true - host-execution-plan: > - { - "endpoints": { - "/openrtb2/auction": { - "stages": { - "processed-auction-request": { - "groups": [ - { - "timeout": 100, - "hook-sequence": [ - { - "module-code": "greenbids-real-time-data", - "hook-impl-code": "greenbids-real-time-data-processed-auction-request-hook" - } - ] - } - ] - } - } - } - } - } + greenbids: + analytics-server-version: "2.2.0" + analytics-server: http://localhost:8090 + exploratory-sampling-split: 0.9 + timeout-ms: 10000 ``` -### List of module configuration options +Here's a description of the global parameters: -- `google-cloud-greenbids-project`: Google Cloud project associated with Greenbids -- `gcs-bucket-name`: Google Cloud Storage (GCS) bucket used to fetch the artefacts ([ONNX](https://onnx.ai/) model and thresholds `.json`) necessary for prediction -- `cache-expiration-minutes`: The duration (in minutes) after which cached model and thresholds should be considered expired and refreshed -- `geo-lite-country-path`: URL to the geo-ip database -- `onnx-model-cache-key-prefix`: prefix necessary for getting cached ONNX model -- `thresholds-cache-key-prefix`: prefix necessary for getting cached throttling thresholds +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| analytics-server-version | string | Version of Analytics Schema Greenbids side | +| analytics-server | string | Greenbids Analytics Server URL | +| exploratory-sampling-split | float | Exploration vs Exploitation ratio of analytics traffic | +| timeout-ms | int | Timeout limit on sending POST request to Greenbids Analytics Server | -```yaml -greenbids-real-time-data: - google-cloud-greenbids-project: "greenbids-357713" - gcs-bucket-name: "greenbids-europe-west1-prebid-server-staging" - cache-expiration-minutes: 15 - geo-lite-country-path: "https://git.io/GeoLite2-Country.mmdb" - onnx-model-cache-key-prefix: "onnxModelRunner_" - thresholds-cache-key-prefix: "throttlingThresholds_" -``` - -### Publisher bid request settings - -The activated partner publishers add their configs direclty into `bid-request.json` -where they indicate the activation of our module -in bid request extenstion `bid-request.ext.prebid.analytics.greenbids` -for [Analytics Reporter](https://docs.prebid.org/prebid-server/pbs-modules/greenbids-analytics-reporter.html) and -`bid-request.ext.prebid.analytics.greenbids-rtd` for Greenbids RTD Module. +The Greenbids Analytics module also includes account-specific parameters for each publisher setup. These parameters should be included in the extension of the bid request json: `ext.prebid.analytics.greenbids` -The list of the parameters necessary for RTD module activation is as follows: +| Parameter | Scope | Description | Example | Type | +| --------- | ---- | ------------- | ------------- | ----------- | +| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | +| greenbidsSampling | optional | sampling factor [0-1] (a value of 0.1 will filter 90% of the traffic) | 1.0 | float | -| Parameter | Scope | Description | Example | Type | -|-----------------|-------------------|-----------------------------------------------------------------------------------------------------|-----------------------|--------------| -| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | -| targetTpr | required | Expected retained opportunities ratio [0-1] | 0.9 | float | -| explorationRate | required | Ratio of traffic without filtering used for training ML model [0-1] (a value of 0.1 will filter 90% of the traffic) | 0.1 | float | - -Here's an example of how a PBS partner publisher setup using both Greenbids RTD Module and Greenbids AnalyticsReporter should look like: +An example of publisher config in the bid request extension is as follows: ```json "ext": { - "prebid": { - "analytics": { - // extension for Greenbids Analytics Reporter - "greenbids": { - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbidsSampling": 0.01 - }, - // extension for Greenbids Real Time Data Module - "greenbids-rtd": { - "pbuid": "PBUID_FROM_GREENBIDS", - "targetTpr": 0.95, - "explorationRate": 0.001 - } + "prebid": { + "analytics": { + "greenbids": { + "pbuid": "PUBID_FROM_GREENBIDS", + "greenbidsSampling": 1.0 } } } -``` - -### Enable for Spring Boot - -In order to allow the module to be picked up by PBS-Java, a Spring Boot configuration property `hooks.greenbids-real-time-data.enabled` must be set to `true`. - -Here's an example of how your PBS configuration YAML should look like: - -```YAML -hooks: - greenbids-real-time-data: - enabled: true -``` - -## Analytics Tags - -The RTD module also communicates the filtering results with the `GreenbidsAnalyticsReporter` via [AnalyticsTags](https://docs.prebid.org/prebid-server/developers/module-atags.html). -Here we populate analytics result of analytics tags for each `imp` the with: - -- `fingerprint`: greenbidsId -- `isKeptInAuction`: map of booleans for each bidder whether we keep them in auction or not for the given imp -- `isExploration`: flag that is necessary to isolate the training data - -The analytics tag is then parsed by the AnalyticsReporter from `HookExecutionContext` -and its content added to the analytics payload sent to Greenbids server. The exploration part of traffic is split randomly with the ratio defined for each partner publisher -per bid requests and is not filtered by the RTD module. - -Here's an example analytics tag that might be produced for use in an analytics adapter: - -```json -{ - "activities": [ - { - "name": "greenbids-filter", - "status": "success", - "results": [ - { - "status": "success", - "values": { - "pub_banniere_haute": { - "greenbids": { - "fingerprint": "ad63524e-b13f-4359-a975-dba9b5dc08f4", - "keptInAuction": { - "improvedigital": false, - "appnexus": true, - "pubmatic": false, - "rubicon": true, - "teads": false - }, - "isExploration": false - }, - "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" - } - }, - "appliedTo": { - "bidders": "bidderA", - "impIds": "impId1" - } - } - ] - } - ] } ``` - -## Maintainer contacts - -For any questions and suggestions please reach out to our team for more information [greenbids.ai](https://greenbids.ai). - -Or just open new [issue](https://github.com/prebid/prebid-server-java/issues/new) or [pull request](https://github.com/prebid/prebid-server-java/pulls) in this repository. - -## Further Reading - -- [Prebid Server Module List](/prebid-server/pbs-modules/index.html) -- [Building a Prebid Server Module](/prebid-server/developers/add-a-module.html) diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index ae8811da4a..ee366b9429 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -30,8 +30,74 @@ are done before customizing it to a particular bidder in the auction. ### Account-Level Config -Here's an example of the account config used in PBS-Java: +The module is invoked based on account config. The logic of the config is as follows: +- `BidRequest` extension if defined takes precedence over account configs. +- If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. + The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. +- If the account config is not defined, the default account config is used. It is defined in `settings.default-account-config` field of the Prebid config. +Here are examples of the config used in PBS-Java: + +BidRequest extension: +```json +"ext": { + "analytics": { + "greenbids": { + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 1 + }, + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.55, + "exploration-rate": 0.0005 + } + } + } +``` + +Account config: +```yaml +hooks: + modules: + greenbids-real-time-data: + pbuid: "PBUID_FROM_GREENBIDS" + target-tpr: 0.96 + exploration-rate: 0.002 +analytics: + modules: + greenbids: + pbuid: "PBUID_FROM_GREENBIDS" + greenbids-sampling: 0.002 +``` + +Default account config: +```yaml +settings: + default-account-config: > + { + "hooks": { + "modules": { + "greenbids-real-time-data": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.95, + "exploration-rate": 0.001 + } + } + }, + "analytics": { + "modules": { + "greenbids": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 0.001 + } + } + } + } +``` + +Execution plan setup: ```yaml hooks: greenbids-real-time-data: From c81d85e08aa61a61256f80b822006bced661f979 Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Mon, 27 Jan 2025 23:54:01 +0100 Subject: [PATCH 3/7] Greenbids: Account config docs Analytics/ RTD --- .../greenbids-analytics-reporter.md | 67 ++++++++++++++++--- .../pbs-modules/greenbids-real-time-data.md | 2 +- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index 2e20710330..56b4dc8366 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -32,24 +32,69 @@ Here's a description of the global parameters: | exploratory-sampling-split | float | Exploration vs Exploitation ratio of analytics traffic | | timeout-ms | int | Timeout limit on sending POST request to Greenbids Analytics Server | -The Greenbids Analytics module also includes account-specific parameters for each publisher setup. These parameters should be included in the extension of the bid request json: `ext.prebid.analytics.greenbids` +The Greenbids Analytics module includes account-specific parameters for the publisher setup. The logic of the config is as follows: +- `BidRequest` extension in `ext.prebid.analytics.greenbids` if defined takes precedence over account configs. +- If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. + The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. +- If the account config is not defined, the default account config is used. It is defined in `settings.default-account-config` field of the Prebid config. -| Parameter | Scope | Description | Example | Type | -| --------- | ---- | ------------- | ------------- | ----------- | -| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | -| greenbidsSampling | optional | sampling factor [0-1] (a value of 0.1 will filter 90% of the traffic) | 1.0 | float | - -An example of publisher config in the bid request extension is as follows: +Here are examples of the config: +BidRequest extension: ```json "ext": { - "prebid": { "analytics": { "greenbids": { - "pbuid": "PUBID_FROM_GREENBIDS", - "greenbidsSampling": 1.0 + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 1 + }, + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.55, + "exploration-rate": 0.0005 } } } -} +``` + +Account config: +```yaml +hooks: + modules: + greenbids-real-time-data: + pbuid: "PBUID_FROM_GREENBIDS" + target-tpr: 0.96 + exploration-rate: 0.002 +analytics: + modules: + greenbids: + pbuid: "PBUID_FROM_GREENBIDS" + greenbids-sampling: 0.002 +``` + +Default account config: +```yaml +settings: + default-account-config: > + { + "hooks": { + "modules": { + "greenbids-real-time-data": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.95, + "exploration-rate": 0.001 + } + } + }, + "analytics": { + "modules": { + "greenbids": { + "enabled": true, + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 0.001 + } + } + } + } ``` diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index ee366b9429..4b5514ded4 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -31,7 +31,7 @@ are done before customizing it to a particular bidder in the auction. ### Account-Level Config The module is invoked based on account config. The logic of the config is as follows: -- `BidRequest` extension if defined takes precedence over account configs. +- `BidRequest` extension in `ext.prebid.analytics.greenbids-rtd` if defined takes precedence over account configs. - If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. - If the account config is not defined, the default account config is used. It is defined in `settings.default-account-config` field of the Prebid config. From ad63738bb5416474365a2644c595357b5611a312 Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Mon, 27 Jan 2025 23:57:34 +0100 Subject: [PATCH 4/7] lint --- prebid-server/pbs-modules/greenbids-analytics-reporter.md | 3 +++ prebid-server/pbs-modules/greenbids-real-time-data.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index 56b4dc8366..d728f5b509 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -41,6 +41,7 @@ The Greenbids Analytics module includes account-specific parameters for the publ Here are examples of the config: BidRequest extension: + ```json "ext": { "analytics": { @@ -58,6 +59,7 @@ BidRequest extension: ``` Account config: + ```yaml hooks: modules: @@ -73,6 +75,7 @@ analytics: ``` Default account config: + ```yaml settings: default-account-config: > diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index 4b5514ded4..4a4b45302a 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -39,6 +39,7 @@ The module is invoked based on account config. The logic of the config is as fol Here are examples of the config used in PBS-Java: BidRequest extension: + ```json "ext": { "analytics": { @@ -56,6 +57,7 @@ BidRequest extension: ``` Account config: + ```yaml hooks: modules: @@ -71,6 +73,7 @@ analytics: ``` Default account config: + ```yaml settings: default-account-config: > @@ -98,6 +101,7 @@ settings: ``` Execution plan setup: + ```yaml hooks: greenbids-real-time-data: From 81f5ff55d9a67b8f83435e7f8c0119a9106f8cf7 Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Mon, 27 Jan 2025 23:58:57 +0100 Subject: [PATCH 5/7] lint --- prebid-server/pbs-modules/greenbids-analytics-reporter.md | 1 + prebid-server/pbs-modules/greenbids-real-time-data.md | 1 + 2 files changed, 2 insertions(+) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index d728f5b509..4991afc1a8 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -33,6 +33,7 @@ Here's a description of the global parameters: | timeout-ms | int | Timeout limit on sending POST request to Greenbids Analytics Server | The Greenbids Analytics module includes account-specific parameters for the publisher setup. The logic of the config is as follows: + - `BidRequest` extension in `ext.prebid.analytics.greenbids` if defined takes precedence over account configs. - If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index 4a4b45302a..a11b0ee504 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -31,6 +31,7 @@ are done before customizing it to a particular bidder in the auction. ### Account-Level Config The module is invoked based on account config. The logic of the config is as follows: + - `BidRequest` extension in `ext.prebid.analytics.greenbids-rtd` if defined takes precedence over account configs. - If the `BidRequest` extension is not defined, the account config is used and defined one per individual publisher. The config is stored in `yaml` file under path `settings.filesystem.settings-filename` of the Prebid config. From 605d887a263b1e90ea39a7341040e3587cc105ce Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Wed, 29 Jan 2025 11:38:30 +0100 Subject: [PATCH 6/7] fix review --- .../greenbids-analytics-reporter.md | 48 +++++-------------- .../pbs-modules/greenbids-real-time-data.md | 48 +++++-------------- 2 files changed, 22 insertions(+), 74 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-analytics-reporter.md b/prebid-server/pbs-modules/greenbids-analytics-reporter.md index 4991afc1a8..236bd0d4ac 100644 --- a/prebid-server/pbs-modules/greenbids-analytics-reporter.md +++ b/prebid-server/pbs-modules/greenbids-analytics-reporter.md @@ -45,15 +45,17 @@ BidRequest extension: ```json "ext": { - "analytics": { - "greenbids": { - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 1 - }, - "greenbids-rtd": { - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.55, - "exploration-rate": 0.0005 + "prebid": { + "analytics": { + "greenbids": { + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 1 + }, + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.55, + "exploration-rate": 0.0005 + } } } } @@ -74,31 +76,3 @@ analytics: pbuid: "PBUID_FROM_GREENBIDS" greenbids-sampling: 0.002 ``` - -Default account config: - -```yaml -settings: - default-account-config: > - { - "hooks": { - "modules": { - "greenbids-real-time-data": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.95, - "exploration-rate": 0.001 - } - } - }, - "analytics": { - "modules": { - "greenbids": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 0.001 - } - } - } - } -``` diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index a11b0ee504..6136b69a3f 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -43,15 +43,17 @@ BidRequest extension: ```json "ext": { - "analytics": { - "greenbids": { - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 1 - }, - "greenbids-rtd": { - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.55, - "exploration-rate": 0.0005 + "prebid": { + "analytics": { + "greenbids": { + "pbuid": "PBUID_FROM_GREENBIDS", + "greenbids-sampling": 1 + }, + "greenbids-rtd": { + "pbuid": "PBUID_FROM_GREENBIDS", + "target-tpr": 0.55, + "exploration-rate": 0.0005 + } } } } @@ -73,34 +75,6 @@ analytics: greenbids-sampling: 0.002 ``` -Default account config: - -```yaml -settings: - default-account-config: > - { - "hooks": { - "modules": { - "greenbids-real-time-data": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "target-tpr": 0.95, - "exploration-rate": 0.001 - } - } - }, - "analytics": { - "modules": { - "greenbids": { - "enabled": true, - "pbuid": "PBUID_FROM_GREENBIDS", - "greenbids-sampling": 0.001 - } - } - } - } -``` - Execution plan setup: ```yaml From 1f79734621c9abd0b801387f15c3f3c76cff4b9d Mon Sep 17 00:00:00 2001 From: EvgeniiMunin Date: Wed, 29 Jan 2025 12:22:19 +0100 Subject: [PATCH 7/7] keep appliedTo field blank --- prebid-server/pbs-modules/greenbids-real-time-data.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index 6136b69a3f..062366d70a 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -214,10 +214,7 @@ Here's an example analytics tag that might be produced for use in an analytics a "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" } }, - "appliedTo": { - "bidders": "bidderA", - "impIds": "impId1" - } + "appliedTo": {} } ] }