Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audigent RTD configurable per-bidder segment mappings #5903

Merged
merged 26 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions integrationExamples/gpt/audigentSegments_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,13 @@
name: "audigent",
waitForIt: true,
params: {
mapSegments: ['appnexus'],
mapSegments: {
appnexus: true
},
segmentCache: false,
publisherId: 0
requestParams: {
publisherId: 0
}
}

}
Expand Down
79 changes: 64 additions & 15 deletions modules/audigentRtdProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ Add the Audigent RTD provider to your Prebid config. For any adapters
that you would like to retrieve segments for, add a mapping in the 'mapSegments'
parameter. In this example we will configure publisher 1234 to retrieve
appnexus segments from Audigent. See the "Parameter Descriptions" below for
more detailed information of the configuration parameters.
more detailed information of the configuration parameters. Currently,
OpenRTB compatible fpd data will be added for any bid adapter in the
"mapSegments" objects, and automated bid augmentation exists for the Appnexus
antlauzon marked this conversation as resolved.
Show resolved Hide resolved
bid adapter.

```
pbjs.setConfig(
Expand All @@ -35,7 +38,7 @@ pbjs.setConfig(
waitForIt: true,
params: {
mapSegments: {
'appnexus': true,
appnexus: true,
},
segmentCache: false,
requestParams: {
Expand All @@ -51,21 +54,67 @@ pbjs.setConfig(

### Parameter Descriptions for the Audigent `dataProviders` Configuration Section

params.mapSegments | Required | Object
Dictionary of bidders you would like to supply Audigent segments for.
Maps to boolean values, but also allows functions for custom mapping logic.
The function signature is (bid, segments) => {}.
| Name |Type | Description | Notes |
| :------------ | :------------ | :------------ |:------------ |
| name | String | Real time data module name | Always 'audigent' |
| waitForIt | Boolean | Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false |
| params | Object | | |
| params.mapSegments | Boolean | Dictionary of bidders you would like to supply Audigent segments for. Maps to boolean values, but also allows functions for custom mapping logic. The function signature is (bid, segments) => {}. | Required |
| params.segmentCache | Boolean | This parameter tells the Audigent RTD module to attempt reading segments from a local storage cache instead of always requesting them from the Audigent server. | Optional. Defaults to false. |
| params.requestParams | Boolean | Publisher partner specific configuration options, such as optional publisher id and other segment query related metadata to be submitted to Audigent's backend with each request. Contact prebid@audigent.com for more information. | Optional |
antlauzon marked this conversation as resolved.
Show resolved Hide resolved

### Overriding & Adding Segment Mappers
As indicated above, it is possible to provide your own bid augmentation
functions. This is useful if you know a bid adapter's API supports segment
fields which aren't specifically being added to request objects in the Prebid
bid adapter. You can also override segment mappers by passing a function
instead of a boolean to the Audigent RTD segment module. This might be useful
if you'd like to use custom logic to determine which segments are sent
to a specific backend.

Please see the following example, which provides a function to modify bids for
a bid adapter called adBuzz and overrides the
antlauzon marked this conversation as resolved.
Show resolved Hide resolved

params.segmentCache | Optional | Boolean
This parameter tells the Audigent RTD module to attempt reading segments
from a local storage cache instead of always requesting them from the
Audigent server.

params.requestParams | Optional | Object
Publisher partner specific configuration options, such as optional publisher id
and other segment query related metadata to be submitted to Audigent's
backend with each request. Contact prebid@audigent.com for more information.
```
pbjs.setConfig(
...
realTimeData: {
auctionDelay: auctionDelay,
dataProviders: [
{
name: "audigent",
waitForIt: true,
params: {
mapSegments: {
// adding an adBuzz segment mapper
adBuzz: function(bid, segments) {
bid.params.adBuzzCustomSegments = [];
for (var i = 0; i < segments.length; i++) {
bid.params.adBuzzCustomSegments.push(segments[i].id);
}
},
// overriding the appnexus segment mapper to exclude certain segments
appnexus: function(bid, segments) {
for (var i = 0; i < segments.length; i++) {
if (segments[i].id != 'exclude_segment') {
bid.params.user.segments.push(segments[i].id);
}
}
}
},
segmentCache: false,
requestParams: {
publisherId: 1234
}
}
}
]
}
...
}
```

More examples can be viewed in the audigentRtdAdapter_spec.js tests.

### Testing

Expand Down