Skip to content

Commit 55831de

Browse files
Giudici-amarc_tappx
authored and
marc_tappx
committed
adot bid adapter: add publisher path from bidder config to endpoint url (prebid#6476)
1 parent 8aed380 commit 55831de

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

modules/adotBidAdapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { config } from '../src/config.js';
77

88
const ADAPTER_VERSION = 'v1.0.0';
99
const BID_METHOD = 'POST';
10-
const BIDDER_URL = 'https://dsp.adotmob.com/headerbidding/bidrequest';
10+
const BIDDER_URL = 'https://dsp.adotmob.com/headerbidding{PUBLISHER_PATH}/bidrequest';
1111
const FIRST_PRICE = 1;
1212
const NET_REVENUE = true;
1313
// eslint-disable-next-line no-template-curly-in-string
@@ -141,9 +141,10 @@ function validateServerRequest(serverRequest) {
141141
}
142142

143143
function createServerRequestFromAdUnits(adUnits, bidRequestId, adUnitContext) {
144+
const publisherPath = config.getConfig('adot.publisherPath') === undefined ? '' : '/' + config.getConfig('adot.publisherPath');
144145
return {
145146
method: BID_METHOD,
146-
url: BIDDER_URL,
147+
url: BIDDER_URL.replace('{PUBLISHER_PATH}', publisherPath),
147148
data: generateBidRequestsFromAdUnits(adUnits, bidRequestId, adUnitContext),
148149
_adot_internal: generateAdotInternal(adUnits)
149150
}

modules/adotBidAdapter.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Adot Bidder Adapter is a module that enables the communication between the Prebi
66

77
- Module name: Adot Bidder Adapter
88
- Module type: Bidder Adapter
9-
- Maintainer: `maxime.lequain@we-are-adot.com`
9+
- Maintainer: `aurelien.giudici@adotmob.com`
1010
- Supported media types: `banner`, `video`, `native`
1111

1212
## Example ad units
@@ -230,4 +230,22 @@ pbjs.setBidderConfig({
230230
}
231231
}
232232
});
233+
```
234+
235+
### Specific publisher path
236+
237+
You can set a specific publisher path using `pbjs.setBidderConfig` for the bidder `adot`
238+
The bidrequest will add this path to the bidder endpoint
239+
240+
#### Example
241+
242+
```javascript
243+
pbjs.setBidderConfig({
244+
bidders: ['adot'],
245+
config: {
246+
adot: {
247+
publisherPath: '__MY_PUBLISHER_PATH__'
248+
}
249+
}
250+
});
233251
```

0 commit comments

Comments
 (0)