Skip to content

Commit

Permalink
adot bid adapter: add publisher path from bidder config to endpoint u…
Browse files Browse the repository at this point in the history
…rl (#6476)
  • Loading branch information
Giudici-a authored and idettman committed May 21, 2021
1 parent 3aef678 commit aaa300f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/adotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config } from '../src/config.js';

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

function createServerRequestFromAdUnits(adUnits, bidRequestId, adUnitContext) {
const publisherPath = config.getConfig('adot.publisherPath') === undefined ? '' : '/' + config.getConfig('adot.publisherPath');
return {
method: BID_METHOD,
url: BIDDER_URL,
url: BIDDER_URL.replace('{PUBLISHER_PATH}', publisherPath),
data: generateBidRequestsFromAdUnits(adUnits, bidRequestId, adUnitContext),
_adot_internal: generateAdotInternal(adUnits)
}
Expand Down
20 changes: 19 additions & 1 deletion modules/adotBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Adot Bidder Adapter is a module that enables the communication between the Prebi

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

## Example ad units
Expand Down Expand Up @@ -230,4 +230,22 @@ pbjs.setBidderConfig({
}
}
});
```

### Specific publisher path

You can set a specific publisher path using `pbjs.setBidderConfig` for the bidder `adot`
The bidrequest will add this path to the bidder endpoint

#### Example

```javascript
pbjs.setBidderConfig({
bidders: ['adot'],
config: {
adot: {
publisherPath: '__MY_PUBLISHER_PATH__'
}
}
});
```

0 comments on commit aaa300f

Please sign in to comment.