From 0fdab76090a5344cabac38332221febbc6abec63 Mon Sep 17 00:00:00 2001 From: bretg Date: Fri, 14 Feb 2025 17:30:22 -0500 Subject: [PATCH] PBS USGen skiprate (#5887) * PBS USGen skiprate * Update pbs-usgen.md --- .../developers/add-a-privacy-module-java.md | 39 +++++++++++++++++++ prebid-server/features/pbs-usgen.md | 20 ++++++++++ 2 files changed, 59 insertions(+) diff --git a/prebid-server/developers/add-a-privacy-module-java.md b/prebid-server/developers/add-a-privacy-module-java.md index f09bca96f9..e8f7c46f39 100644 --- a/prebid-server/developers/add-a-privacy-module-java.md +++ b/prebid-server/developers/add-a-privacy-module-java.md @@ -280,3 +280,42 @@ public class MyPrivacyModule implements PrivacyModule, Loggable { } } ``` + +## Privacy Trace Log and Analytics + +The privacy module interface logs information that analytics adapters may want to consume. For example, if you're an analytics provider +and want to check whether there was a skipRate config present, you can read the log for `skipped:true` and log however your analytics requires. + +For example: + +``` + { + "description": "Invocation of Activity Infrastructure.", + "activity": "transmitUfpd", + "activity_invocation_payload": { + "component_type": "BIDDER", + "component_name": "bidderA" + } + }, + { + "description": "Setting the default invocation result.", + "allow_by_default": true + }, + { + "description": "Processing rule.", + "rule_configuration": { + "and": [ + { + "privacy_module": "iab.usgeneral", + "skipped": true, + "result": "ABSTAIN" + } + ] + }, + "result": "ABSTAIN" + }, +``` + +## Further Reading + +- [Building a privacy module](/prebid-server/developers/add-a-privacy-module.html) diff --git a/prebid-server/features/pbs-usgen.md b/prebid-server/features/pbs-usgen.md index ea5f13a09d..273699d1d6 100644 --- a/prebid-server/features/pbs-usgen.md +++ b/prebid-server/features/pbs-usgen.md @@ -148,6 +148,26 @@ Prebid approach, but they want to process SID 8 with this custom module. } ``` +### Testing + +Before turning on the USGen module 100%, some host companies may want to partially enable it in order to gague impact. This can be done using the privacy module `skipRate` parameter. Here's an example account config: + +```json5 +{ + "privacy": { + "modules": [{ + "code": "iab.usgeneral", + "skipRate": 95, // only run on 5% of requests. Default is to run on 100%, i.e. skipRate 0 + "config": { + "skipSids": [9] + } + }] + } +} +``` + +In order to utilize this test though, you will need an analytics adapter that can read the Activity Infrastructure log. See [privacy module analytics](/prebid-server/developers/add-a-privacy-module-java.html#privacy-trace-log-and-analytics) for more detail. + ### Troubleshooting Additional information about the outcoming of privacy module processing can be obtained by setting `ext.prebid.trace: "basic"`.