Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaIntentIQ authored Nov 8, 2024
2 parents 6a024f2 + 0ba97f9 commit 4e18140
Show file tree
Hide file tree
Showing 15 changed files with 409 additions and 121 deletions.
24 changes: 18 additions & 6 deletions dev-docs/bidders/taboola.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,30 @@ sidebarType: 1

### Note

- Supports `display` format.
- Supports `native` format only in the Prebid Sever.
- Prebid.js Supports `display` format only.
- Prebid Server Supports `native+display` formats.
- Uses `OpenRTB` standard.

### Bidder Config
We recommend allowing us access to localStorage.
You can allow writing in localStorage `pbjs.bidderSettings` for the bidder `taboola`

```javascript
pbjs.bidderSettings = {
taboola: {
storageAllowed : true
}
}
```

### Registration

The Taboola Adapter requires setup before beginning. Please contact us at <[email protected]>.

### Prebid Server

Please provide to your relevant Taboola contact person the prebid server host domain, so we enable it before the integration starts.

### First Party Data

Publishers can use the `ortb2` configuration parameter to provide First Party Data.
Expand Down Expand Up @@ -113,7 +129,3 @@ Notes:
}]
}];
```

### Native - Prebid Server Adapter

Currently, supporting native and multi-format (banner and native mixed) requests in the prebid server adapter only.
2 changes: 1 addition & 1 deletion dev-docs/bidmatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Contact us at [[email protected]](mailto:[email protected]).
{: .table .table-bordered .table-striped }
| Name | Scope | Description | Example | Type |
|---------------|----------|-----------------------|-----------|-----------|
| `source` | required | Traffic source origin id | `'11111'` | `int` |
| `source` | required | Traffic source origin id | `11111` | `int` |

### Test Parameters

Expand Down
4 changes: 2 additions & 2 deletions dev-docs/modules/humansecurityRtdProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ gulp build --modules="rtdModule,humansecurityRtdProvider,..."
## Configuration

This module is configured as part of the `realTimeData.dataProviders` object.
Please refer to [Prebid Documentation](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html#setConfig-realTimeData)
Please refer to [Prebid Documentation](/dev-docs/publisher-api-reference/setConfig.html#setConfig-realTimeData)
on RTD module configuration for details on required and optional parameters of `realTimeData`.

By default, using this submodule *does not require any prior communication with HUMAN, nor any special configuration*,
Expand Down Expand Up @@ -105,7 +105,7 @@ of type `ERROR`. With `verbose` parameter set to `true`, it may additionally:
* Call `logWarning`, resulting in `auctionDebug` events of type `WARNING`,
* Call `logInfo` with latency information.
* To observe these messages in console, Prebid.js must be run in
[debug mode](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html#debugging) -
[debug mode](/dev-docs/publisher-api-reference/setConfig.html#debugging) -
either by adding `?pbjs_debug=true` to your page's URL, or by configuring with `pbjs.setConfig({ debug: true });`

Example output of the latency information:
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/modules/userId.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ It is possible for a user id submodule to populate several identifiers including

This can be configured inside the `userSync` object in the following manner:

Let's say that the UID2 token populated by the trade desk user id submodule has the value 'uid2_value' and the UID2 token populated by Liveintent user id module has the value 'liveIntentUid2_value' (The actual identifiers populated in this case should be one and the same however the values are written differently in order to help the reader understand the source from which the identifiers get picked up from)
Let's say that the UID2 token populated by the UID2 user ID submodule has the value 'uid2_value' and the UID2 token populated by Liveintent user id module has the value 'liveIntentUid2_value' (The actual identifiers populated in this case should be one and the same however the values are written differently in order to help the reader understand the source from which the identifiers get picked up from)

```javascript
"userSync": {
Expand Down
4 changes: 4 additions & 0 deletions dev-docs/modules/userid-submodules/euid.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ pbjs.setConfig({
});
```

## European Unified ID Client Side Integration for Prebid.js

Prebid.js supports fully client side integration for EUID. See the [official EUID documentation](https://euid.eu/docs/guides/integration-prebid) for the most up-to-date integration instructions.

## European Unified ID Configuration

The following parameters apply only to the European Unified ID module integration.
Expand Down
7 changes: 6 additions & 1 deletion dev-docs/modules/userid-submodules/unified2.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ gulp build --modules=uid2IdSystem

You can set up Unified ID 2.0 in one of these ways:

- Include the module to your pb.js wrapper. You will need to apply for publisher access [on the UID2 website](https://unifiedid.com/request-access). Using this option, you must generate UID2 tokens server-side. There is currently no flow for client-side only, unless you use an SSO provider. You provide these tokens to Prebid.js either by using a cookie or directly in the configuration.
- Include the module to your Prebid.js wrapper. You will need to apply for publisher access [on the UID2 website](https://unifiedid.com/request-access). Using this option, you must generate UID2 tokens server-side. You provide these tokens to Prebid.js either by using a cookie or directly in the configuration.
- Use a [managed services](https://prebid.org/product-suite/managed-services/) company that can do this for you.
- Use UID2 Client Side Integration with Prebid.js

Each publisher’s privacy policy should take UnifiedID 2.0 into account.

Expand Down Expand Up @@ -61,6 +62,10 @@ For a server-side integration, you can create a smaller Prebid.js build by disab
gulp build --modules=uid2IdSystem --disable UID2_CSTG
```

## Unified ID 2.0 Client Side Integration for Prebid.js

Prebid.js supports fully client side integration for UID2. See the [official UID2 documentation](https://unifiedid.com/docs/guides/integration-prebid-client-side) for the most up-to-date integration instructions.

## Unified ID 2.0 Configuration

The following parameters apply only to the Unified ID 2.0 module integration.
Expand Down
24 changes: 12 additions & 12 deletions prebid-server/developers/add-a-module-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import (
"context"
"encoding/json"

"github.com/prebid/prebid-server/hooks/hookstage"
"github.com/prebid/prebid-server/modules/moduledeps"
"github.com/prebid/prebid-server/v3/hooks/hookstage"
"github.com/prebid/prebid-server/v3/modules/moduledeps"
)

func Builder(config json.RawMessage, deps moduledeps.ModuleDeps) (interface{}, error) {
Expand Down Expand Up @@ -121,13 +121,13 @@ The supported stages are described in the [general module overview](/prebid-serv

These are the available hooks that can be implemented in a module:

- github.com/prebid/prebid-server/hooks/hookstage.Entrypoint
- github.com/prebid/prebid-server/hooks/hookstage.RawAuctionRequest
- github.com/prebid/prebid-server/hooks/hookstage.ProcessedAuctionRequest
- github.com/prebid/prebid-server/hooks/hookstage.BidderRequest
- github.com/prebid/prebid-server/hooks/hookstage.RawBidderResponse
- github.com/prebid/prebid-server/hooks/hookstage.AllProcessedBidResponses
- github.com/prebid/prebid-server/hooks/hookstage.AuctionResponse
- github.com/prebid/prebid-server/v3/hooks/hookstage.Entrypoint
- github.com/prebid/prebid-server/v3/hooks/hookstage.RawAuctionRequest
- github.com/prebid/prebid-server/v3/hooks/hookstage.ProcessedAuctionRequest
- github.com/prebid/prebid-server/v3/hooks/hookstage.BidderRequest
- github.com/prebid/prebid-server/v3/hooks/hookstage.RawBidderResponse
- github.com/prebid/prebid-server/v3/hooks/hookstage.AllProcessedBidResponses
- github.com/prebid/prebid-server/v3/hooks/hookstage.AuctionResponse

In a module it is not necessary to implement all mentioned interfaces but at least one is required by your functionality.

Expand All @@ -144,7 +144,7 @@ Notes:
import (
"context"

"github.com/prebid/prebid-server/hooks/hookstage"
"github.com/prebid/prebid-server/v3/hooks/hookstage"
)

type Module struct{}
Expand Down Expand Up @@ -207,8 +207,8 @@ Notes:
import (
"context"
"github.com/prebid/prebid-server/hooks/hookstage"
"github.com/prebid/prebid-server/hooks/hookanalytics"
"github.com/prebid/prebid-server/v3/hooks/hookstage"
"github.com/prebid/prebid-server/v3/hooks/hookanalytics"
)
func (m Module) HandleBidderRequestHook(
Expand Down
42 changes: 24 additions & 18 deletions prebid-server/developers/add-new-bidder-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Please refer to [existing bid adapters](https://github.com/prebid/prebid-server/
Our project is written in the [Go programming language](https://golang.org/). We understand not everyone has prior experience writing Go code. Please try your best and we'll respectfully steer you in the right direction during the review process.

{: .alert.alert-info :}
**Please do not ignore errors from method calls made in your bid adapter code.** Even if it's seemingly impossible for an error to occur, such as from `json.Marshal`, it's still possible under the high throughput multi-threaded nature of Prebid Server.
**Please do not ignore errors from method calls made in your bid adapter code.** Even if it's seemingly impossible for an error to occur, such as from `jsonutil.Marshal`, it's still possible under the high throughput multi-threaded nature of Prebid Server.

### Bidder Info

Expand All @@ -121,6 +121,8 @@ maintainer:
email: [email protected]
gvlVendorID: 42
modifyingVastXmlAllowed: true
openrtb:
version: 2.6
capabilities:
app:
mediaTypes:
Expand Down Expand Up @@ -156,6 +158,7 @@ Modify this template for your bid adapter:
* Values can be negated. e.g. "!EEA"
* Change the maintainer email address to a group distribution list on your ad server's domain. A distribution list is preferred over an individual mailbox to allow for robustness, as roles and team members naturally change.
* Change the `gvlVendorID` from the sample value of `42` to the id of your bidding server as registered with the [GDPR Global Vendor List (GVL)](https://iabeurope.eu/tcf-for-vendors/), or remove this line entirely if your bidding server is not registered with IAB Europe.
* Remove the `openrtb.version` parameter if your adapter cannot receive the OpenRTB 2.6 data model. In this case, Prebid Server will downgrade values back to their 2.5 ext locations. New OpenRTB 2.6 fields are still passed to adapters.
* If absolutely necessary, change the `modifyingVastXmlAllowed` value to `false` to opt-out of [video impression tracking](https://github.com/prebid/prebid-server/issues/1015). However, please note that Prebid Server host companies depend on this feature being enabled to track video analytics. This feature has been live for many years with no known problems.
* Remove the `capabilities` (app/site/dooh) and `mediaTypes` (banner/video/audio/native) combinations which your adapter does not support. (Note: 'dooh' is [Digital Out Of Home](/prebid-server/use-cases/pbs-dooh.html))
* Add an `extra_info` field if you'd like to pass additional values that your adapter may need. See below for an example.
Expand Down Expand Up @@ -554,15 +557,15 @@ Here is a reference implementation for a bidding server which uses the OpenRTB 2
package foo

import (
"encoding/json"
"fmt"
"net/http"

"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/v3/adapters"
"github.com/prebid/prebid-server/v3/config"
"github.com/prebid/prebid-server/v3/errortypes"
"github.com/prebid/prebid-server/v3/util/jsonutil"
"github.com/prebid/prebid-server/v3/openrtb_ext"
)

type adapter struct {
Expand All @@ -578,7 +581,7 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server co
}

func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
requestJSON, err := json.Marshal(request)
requestJSON, err := jsonutil.Marshal(request)
if err != nil {
return nil, []error{err}
}
Expand All @@ -596,7 +599,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
if bid.Ext != nil {
var bidExt openrtb_ext.ExtBid
err := json.Unmarshal(bid.Ext, &bidExt)
err := jsonutil.Unmarshal(bid.Ext, &bidExt)
if err == nil && bidExt.Prebid != nil {
return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type))
}
Expand Down Expand Up @@ -627,7 +630,7 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R
}

var response openrtb2.BidResponse
if err := json.Unmarshal(responseData.Body, &response); err != nil {
if err := jsonutil.Unmarshal(responseData.Body, &response); err != nil {
return nil, []error{err}
}

Expand All @@ -651,6 +654,9 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R
}
```

{: .alert.alert-info :}
Adapters must use `jsonutil.Marshal` and `jsonutil.Unmarshal` instead of the Go standard package functions, as those are not optimized for Prebid Server's high perfomance needs.

#### Builder

The `Builder` method is responsible for validating the adapter configuration, performing any necessary pre-processing steps (such as macro parsing), and storing the configuration values in a new instance of the `adapter` struct.
Expand Down Expand Up @@ -720,7 +726,7 @@ func parseExtraInfo(v string) (extraInfo, error) {
}

var info extraInfo
if err := json.Unmarshal([]byte(v), &info); err != nil {
if err := jsonutil.Unmarshal([]byte(v), &info); err != nil {
return nil, fmt.Errorf("invalid extra info: %v", err)
}

Expand Down Expand Up @@ -786,7 +792,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
for _, imp := range request.Imp {
requestCopy.Imp = []openrtb2.Imp{imp}

requestJSON, err := json.Marshal(request)
requestJSON, err := jsonutil.Marshal(request)
if err != nil {
errors = append(errors, err)
continue
Expand Down Expand Up @@ -837,7 +843,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
}
}

requestJSON, err := json.Marshal(request)
requestJSON, err := jsonutil.Marshal(request)
if err != nil {
return nil, []error{err}
}
Expand Down Expand Up @@ -1090,7 +1096,7 @@ This section will guide you through the creation of automated unit tests to cove
Bid requests and server responses can be quite verbose. To avoid large blobs of text embedded within test code, we've created a framework for bid adapters which use a JSON body and/or a url to send a bid request. We require the use of our test framework as it includes checks to ensure no changes are made to shared memory.
We strive for as much test coverage as possible, but recognize that some code paths are impractical to simulate and rarely occur. You do not need to test the error conditions for `json.Marshal` calls, for template parse errors within `MakeRequests` or `MakeBids`, or for `url.Parse` calls. Following this guidance usually results in a coverage rate of around 90% - 95%, although we don't enforce a specific threshold.
We strive for as much test coverage as possible, but recognize that some code paths are impractical to simulate and rarely occur. You do not need to test the error conditions for `jsonutil.Marshal` calls, for template parse errors within `MakeRequests` or `MakeBids`, or for `url.Parse` calls. Following this guidance usually results in a coverage rate of around 90% - 95%, although we don't enforce a specific threshold.
To use the test framework, create a file with the path `adapters/{bidder}/{bidder}_test.go` with the following template:
Expand All @@ -1100,14 +1106,14 @@ package {bidder}
import (
"testing"

"github.com/prebid/prebid-server/adapters/adapterstest"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/v3/adapters/adapterstest"
"github.com/prebid/prebid-server/v3/config"
"github.com/prebid/prebid-server/v3/openrtb_ext"
)

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.Bidder{Bidder}, config.Adapter{
Endpoint: "http://whatever.url"},
Endpoint: "http://any.url"},
config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
Expand Down Expand Up @@ -1226,7 +1232,7 @@ import (
"encoding/json"
"testing"

"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/v3/openrtb_ext"
)

func TestValidParams(t *testing.T) {
Expand Down
28 changes: 16 additions & 12 deletions prebid-server/endpoints/info/pbs-endpoint-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For detailed info about a specific Bidder, use [`/info/bidders/{bidderName}`](#g

This endpoint returns JSON like:

```
```json
[
"appnexus",
"audienceNetwork",
Expand All @@ -44,7 +44,7 @@ Legal values for `{bidderName}` can be retrieved from the [`/info/bidders`](#get

This endpoint returns JSON like:

```
```json
{
"maintainer": {
"email": "[email protected]"
Expand All @@ -62,20 +62,24 @@ This endpoint returns JSON like:
"video",
"native"
]
},
"dooh": {
"mediaTypes": [
"banner",
"video",
"native"
]
}
}
}
```

The fields hold the following information:

- `maintainer.email`: A contact email for the Bidder's maintainer. In general, Bidder bugs should be logged as [issues](https://github.com/prebid/prebid-server/issues)... but this contact email may be useful in case of emergency.
- `capabilities.app.mediaTypes`: A list of media types this Bidder supports from Mobile Apps.
- `capabilities.site.mediaTypes`: A list of media types this Bidder supports from Web pages.

If `capabilities.app` or `capabilities.site` do not exist, then this Bidder does not support that platform.
OpenRTB Requests which define a `request.app` or `request.site` property will fail if a
`request.
* `maintainer.email`: A contact email for the Bidder's maintainer. In general, Bidder bugs should be logged as [issues](https://github.com/prebid/prebid-server/issues)... but this contact email may be useful in case of emergency.
* `capabilities.app.mediaTypes`: A list of media types this Bidder supports from Mobile Apps.
* `capabilities.site.mediaTypes`: A list of media types this Bidder supports from Web pages.
* `capabilities.dooh.mediaTypes`: A list of media types this Bidder supports from Digital Out Of Home (DOOH)experiences.

## GET /bidders/params

Expand All @@ -88,11 +92,11 @@ A JSON object whose keys are bidder codes, and values are Draft 4 JSON schemas w

For example:

```
```json
{
"appnexus": { /* A json-schema describing AppNexus' bidder params */ },
"rubicon": { /* A json-schema describing Rubicon's bidder params */ }
... all other bidders will have similar keys & values here ...
"magnite": { /* A json-schema describing Rubicon's bidder params */ },
"otherBidder": { /* A json-schema describing Rubicon's bidder params */ }
}
```

Expand Down
Loading

0 comments on commit 4e18140

Please sign in to comment.