|
| 1 | +--- |
| 2 | +layout: page_v2 |
| 3 | +page_type: pbs-module |
| 4 | +title: Prebid Server Greenbids Real Time Data Module |
| 5 | +display_name : Greenbids Real Time Data Module |
| 6 | +sidebarType : 5 |
| 7 | +--- |
| 8 | + |
| 9 | +# Greenbids Real Time Data Module |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +Greenbids Real Time Data module filters bidders SSPs listed in the `imp[].ext.prebid.bidder` of the bid request. |
| 14 | +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. |
| 15 | +This bidding probability is used to choose to send the bid request or not, according to the performance constraints applied by the partner publisher. |
| 16 | + |
| 17 | +The RTD module uses 2 artefacts that are fetched from the Greenbids Google Cloud Storage bucket |
| 18 | + |
| 19 | +- ML predictor in `.onnx` format: used to predict the bidding probability |
| 20 | +- Probability thresholds in `.json` format: used to convert the bidding probability to a binary choice |
| 21 | + |
| 22 | +## Configuration |
| 23 | + |
| 24 | +### Execution Plan |
| 25 | + |
| 26 | +This module supports running at: |
| 27 | + |
| 28 | +- processed-auction-request: this is where PBS bid request enrichments |
| 29 | +are done before customizing it to a particular bidder in the auction. |
| 30 | + |
| 31 | +### Account-Level Config |
| 32 | + |
| 33 | +Here's an example of the account config used in PBS-Java: |
| 34 | + |
| 35 | +```yaml |
| 36 | +hooks: |
| 37 | + greenbids-real-time-data: |
| 38 | + enabled: true |
| 39 | + host-execution-plan: > |
| 40 | + { |
| 41 | + "endpoints": { |
| 42 | + "/openrtb2/auction": { |
| 43 | + "stages": { |
| 44 | + "processed-auction-request": { |
| 45 | + "groups": [ |
| 46 | + { |
| 47 | + "timeout": 100, |
| 48 | + "hook-sequence": [ |
| 49 | + { |
| 50 | + "module-code": "greenbids-real-time-data", |
| 51 | + "hook-impl-code": "greenbids-real-time-data-processed-auction-request-hook" |
| 52 | + } |
| 53 | + ] |
| 54 | + } |
| 55 | + ] |
| 56 | + } |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + } |
| 61 | +``` |
| 62 | +
|
| 63 | +### List of module configuration options |
| 64 | +
|
| 65 | +- `google-cloud-greenbids-project`: Google Cloud project associated with Greenbids |
| 66 | +- `gcs-bucket-name`: Google Cloud Storage (GCS) bucket used to fetch the artefacts ([ONNX](https://onnx.ai/) model and thresholds `.json`) necessary for prediction |
| 67 | +- `cache-expiration-minutes`: The duration (in minutes) after which cached model and thresholds should be considered expired and refreshed |
| 68 | +- `geo-lite-country-path`: URL to the geo-ip database |
| 69 | +- `onnx-model-cache-key-prefix`: prefix necessary for getting cached ONNX model |
| 70 | +- `thresholds-cache-key-prefix`: prefix necessary for getting cached throttling thresholds |
| 71 | + |
| 72 | +```yaml |
| 73 | +greenbids-real-time-data: |
| 74 | + google-cloud-greenbids-project: "greenbids-357713" |
| 75 | + gcs-bucket-name: "greenbids-europe-west1-prebid-server-staging" |
| 76 | + cache-expiration-minutes: 15 |
| 77 | + geo-lite-country-path: "https://git.io/GeoLite2-Country.mmdb" |
| 78 | + onnx-model-cache-key-prefix: "onnxModelRunner_" |
| 79 | + thresholds-cache-key-prefix: "throttlingThresholds_" |
| 80 | +``` |
| 81 | + |
| 82 | +### Publisher bid request settings |
| 83 | + |
| 84 | +The activated partner publishers add their configs direclty into `bid-request.json` |
| 85 | +where they indicate the activation of our module |
| 86 | +in bid request extenstion `bid-request.ext.prebid.analytics.greenbids` |
| 87 | +for [Analytics Reporter](https://docs.prebid.org/prebid-server/pbs-modules/greenbids-analytics-reporter.html) and |
| 88 | +`bid-request.ext.prebid.analytics.greenbids-rtd` for Greenbids RTD Module. |
| 89 | + |
| 90 | +The list of the parameters necessary for RTD module activation is as follows: |
| 91 | + |
| 92 | +| Parameter | Scope | Description | Example | Type | |
| 93 | +|-----------------|-------------------|-----------------------------------------------------------------------------------------------------|-----------------------|--------------| |
| 94 | +| pbuid | required | The Greenbids Publisher ID | greenbids-publisher-1 | string | |
| 95 | +| targetTpr | required | Expected retained opportunities ratio [0-1] | 0.9 | float | |
| 96 | +| 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 | |
| 97 | + |
| 98 | +Here's an example of how a PBS partner publisher setup using both Greenbids RTD Module and Greenbids AnalyticsReporter should look like: |
| 99 | + |
| 100 | +```json |
| 101 | +"ext": { |
| 102 | + "prebid": { |
| 103 | + "analytics": { |
| 104 | + // extension for Greenbids Analytics Reporter |
| 105 | + "greenbids": { |
| 106 | + "pbuid": "PBUID_FROM_GREENBIDS", |
| 107 | + "greenbidsSampling": 0.01 |
| 108 | + }, |
| 109 | + // extension for Greenbids Real Time Data Module |
| 110 | + "greenbids-rtd": { |
| 111 | + "pbuid": "PBUID_FROM_GREENBIDS", |
| 112 | + "targetTpr": 0.95, |
| 113 | + "explorationRate": 0.001 |
| 114 | + } |
| 115 | + } |
| 116 | + } |
| 117 | + } |
| 118 | +``` |
| 119 | + |
| 120 | +### Enable for Spring Boot |
| 121 | + |
| 122 | +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`. |
| 123 | + |
| 124 | +Here's an example of how your PBS configuration YAML should look like: |
| 125 | + |
| 126 | +```YAML |
| 127 | +hooks: |
| 128 | + greenbids-real-time-data: |
| 129 | + enabled: true |
| 130 | +``` |
| 131 | + |
| 132 | +## Analytics Tags |
| 133 | + |
| 134 | +The RTD module also communicates the filtering results with the `GreenbidsAnalyticsReporter` via [AnalyticsTags](https://docs.prebid.org/prebid-server/developers/module-atags.html). |
| 135 | +Here we populate analytics result of analytics tags for each `imp` the with: |
| 136 | + |
| 137 | +- `fingerprint`: greenbidsId |
| 138 | +- `isKeptInAuction`: map of booleans for each bidder whether we keep them in auction or not for the given imp |
| 139 | +- `isExploration`: flag that is necessary to isolate the training data |
| 140 | + |
| 141 | +The analytics tag is then parsed by the AnalyticsReporter from `HookExecutionContext` |
| 142 | +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 |
| 143 | +per bid requests and is not filtered by the RTD module. |
| 144 | + |
| 145 | +Here's an example analytics tag that might be produced for use in an analytics adapter: |
| 146 | + |
| 147 | +```json |
| 148 | +[{ |
| 149 | + "pub_banniere_haute": { |
| 150 | + "greenbids": { |
| 151 | + "fingerprint": "ad63524e-b13f-4359-a975-dba9b5dc08f4", |
| 152 | + "keptInAuction": { |
| 153 | + "improvedigital": false, |
| 154 | + "appnexus": true, |
| 155 | + "pubmatic": false, |
| 156 | + "rubicon": true, |
| 157 | + "teads": false |
| 158 | + }, |
| 159 | + "isExploration": false |
| 160 | + }, |
| 161 | + "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" |
| 162 | + } |
| 163 | +}] |
| 164 | +``` |
| 165 | + |
| 166 | +## Maintainer contacts |
| 167 | + |
| 168 | +For any questions and suggestions please reach out to our team for more information [greenbids.ai](https://greenbids.ai). |
| 169 | + |
| 170 | +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. |
| 171 | + |
| 172 | +## Further Reading |
| 173 | + |
| 174 | +- [Prebid Server Module List](/prebid-server/pbs-modules/index.html) |
| 175 | +- [Building a Prebid Server Module](/prebid-server/developers/add-a-module.html) |
0 commit comments