prebid / prebid-server

Open-source solution for running real-time advertising auctions in the cloud.
https://prebid.org/product-suite/prebid-server/
Apache License 2.0
434 stars 744 forks source link

Configure analytics adapters per account #3809

Open bretg opened 4 months ago

bretg commented 4 months ago

Analytics adapters don't currently support being configured per account like a proper module.

Since many PBS instances are multi-tenant, it's important that publishers trust that their traffic is not be analyzed by an analytics adapter being used by a different publisher.

Requirements:

  1. The PBS host company must be able to configure an analytics adapter that is invoked by all requests (adhering to privacy rules). This allows the host company to monitor its traffic, implement reporting, and handle fees if relevant. It's assumed that the host company will have a contract with each hosted account that allows them to enable this particular adapter.
  2. It would be nice if an account could opt out of the globally-configured analytics adapter.
  3. Individual accounts within a Prebid Server should be able to turn on any open source analytics adapter.
    1. Configuration of that analytics adapter should support account-specific details such as IDs, separate endpoints, different sampling rates, etc.
  4. Other accounts within that same Prebid Server should not have their traffic be routed through unapproved analytics adapters.
bretg commented 4 months ago

Discussed in committee. We agreed that in the long term, it makes sense to migrate analytics adapters to just be modules in a new hook, but that's bigger than needed for this project.

So for now, here's a proposed account-level config, based on what's already supported as described in https://github.com/prebid/prebid-server-java/blob/master/docs/application-settings.md:

So the proposal is to add an enabled flag there. This needs to default to true or we could into a breaking change scenario. This of course can be set to false at the host level.

{
  analytics: {
    modules: {
      greenbids: {
        enabled: true,      // Defaults to true. This is the new thing. PBS-core looks for this and doesn't call the module if
        pbuid: "PUBID_FROM_GREENBIDS", // this should get merged into ext.prebid.analytics.greenbids with the request taking precedence.
        greenbidsSampling: 1.0  // this should get merged into ext.prebid.analytics.greenbids with the request taking precedence.
    }
  }
}
bretg commented 2 months ago

Approved.

Global analytics adapters can be enabled at the host level. Vendor-specific analytics would be enabled per account.

bretg commented 1 month ago

done with PBS-Java 3.13