Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion modules/adgridBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function isBidRequestValid(bid) {
return false;
}

return !!bid.params.domainId;
return !!bid.params.domainId && !!bid.params.placement;
}

/**
Expand Down Expand Up @@ -160,6 +160,7 @@ function getBidData(bid) {
deviceUa: bid.ortb2?.device?.ua,
domain: bid.ortb2?.site?.publisher?.domain,
domainId: bid.params.domainId,
placement: bid.params.placement,
code: bid.adUnitCode
};

Expand Down
6 changes: 4 additions & 2 deletions modules/adgridBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ var adUnits = [
bids: [{
bidder: 'adgrid',
params: {
domainId: 12345
domainId: 12345,
placement: 'leaderboard'
}
}]
},
Expand All @@ -37,7 +38,8 @@ var adUnits = [
bids: [{
bidder: 'adgrid',
params: {
domainId: 67890
domainId: 67890,
placement: 'adhesion'
}
}]
}
Expand Down
10 changes: 6 additions & 4 deletions test/spec/modules/adgridBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('AdGrid Bid Adapter', function () {
}
},
params: {
domainId: 12345
domainId: 12345,
placement: 'leaderboard'
}
}];

Expand All @@ -32,17 +33,18 @@ describe('AdGrid Bid Adapter', function () {
}
},
params: {
domainId: 12345
domainId: 12345,
placement: 'video1'
}
}];

describe('isBidRequestValid', function () {
it('Should return true when domainId exist inside params object', function () {
it('Should return true when domainId and placement exist inside params object', function () {
const isBidValid = spec.isBidRequestValid(bannerRequest[0]);
expect(isBidValid).to.be.true;
});

it('Should return false when domainId is not exist inside params object', function () {
it('Should return false when domainId and placement are not exist inside params object', function () {
const isBidNotValid = spec.isBidRequestValid(null);
expect(isBidNotValid).to.be.false;
});
Expand Down