deepintent bid adapter: adds badv and bcat support#14528
deepintent bid adapter: adds badv and bcat support#14528patmmccann merged 4 commits intoprebid:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bfaaa8f81
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds support for OpenRTB blocking parameters (bcat and badv) to the deepintent bid adapter. These parameters allow publishers to specify blocked advertiser categories and blocked advertiser domains, providing better control over ad content. The implementation follows the established pattern in the codebase of prioritizing ortb2 values over params with a fallback mechanism.
Changes:
- Added bcat and badv extraction from bidderRequest.ortb2 with fallback to params
- Added validation to ensure values are arrays with at least one element before including them
- Added comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| modules/deepintentBidAdapter.js | Implements bcat/badv extraction logic with ortb2 priority and params fallback, includes proper array validation |
| test/spec/modules/deepintentBidAdapter_spec.js | Adds test suite covering ortb2 usage, missing values, and params fallback scenarios |
Comments suppressed due to low confidence (1)
test/spec/modules/deepintentBidAdapter_spec.js:442
- The test coverage for bcat/badv is good, but it would be beneficial to add a test case that verifies the priority when both ortb2 and params contain bcat/badv values. This would explicitly document that ortb2 takes precedence over params, which is the expected behavior based on the implementation.
describe('ortb2 blocking (bcat, badv)', function() {
it('should add bcat and badv to payload when bidderRequest.ortb2 has them', function() {
const bidderReq = {
ortb2: {
bcat: ['IAB1', 'IAB2'],
badv: ['example.com']
}
};
const bRequest = spec.buildRequests(request, bidderReq);
const data = JSON.parse(bRequest.data);
expect(data.bcat).to.deep.equal(['IAB1', 'IAB2']);
expect(data.badv).to.deep.equal(['example.com']);
});
it('should not add bcat or badv when bidderRequest.ortb2 does not have them', function() {
const bidderReq = {ortb2: {}};
const bRequest = spec.buildRequests(request, bidderReq);
const data = JSON.parse(bRequest.data);
expect(data.bcat).to.be.undefined;
expect(data.badv).to.be.undefined;
});
it('should use params.bcat and params.badv as fallback when ortb2 does not set them', function() {
const requestWithParams = [{
bidder: 'deepintent',
bidId: 'test-bid-id',
mediaTypes: { banner: { sizes: [[300, 250]] } },
params: {
tagId: '100013',
bcat: ['IAB25'],
badv: ['blocked-advertiser.com']
}
}];
const bRequest = spec.buildRequests(requestWithParams);
const data = JSON.parse(bRequest.data);
expect(data.bcat).to.deep.equal(['IAB25']);
expect(data.badv).to.deep.equal(['blocked-advertiser.com']);
});
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
please repull master after #14529 merges in |
Pull Request Test Coverage Report for Build 22512421802Details
💛 - Coveralls |
|
@gwhigs checking in here if there is anything blocking this review or any updates are needed before this can be picked for review - happy to get them integrated to move this along |
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Added badv and bact support for deepintent's bid adapter
Other information