Skip to content

Commit

Permalink
AcuityAds Bid Adapter: add endpointId param (#12644)
Browse files Browse the repository at this point in the history
* add prebid.js adapter

* changes

* changes

* changes

* changes

* fix downolad

* add gpp

* Merge remote-tracking branch 'prebid/master'

* add gvlid

* add endpointId param
  • Loading branch information
AcuityAdsIntegrations authored Jan 16, 2025
1 parent 3fd2066 commit 634ff5d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/acuityadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const spec = {
gvlid: GVLID,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

isBidRequestValid: isBidRequestValid(['placementId']),
isBidRequestValid: isBidRequestValid(),
buildRequests: buildRequests(AD_URL),
interpretResponse,
getUserSyncs: getUserSyncs(SYNC_URL)
Expand Down
49 changes: 49 additions & 0 deletions test/spec/modules/acuityadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,55 @@ describe('AcuityAdsBidAdapter', function () {
}
});

it('Returns valid endpoints', function () {
const bids = [
{
bidId: getUniqueIdentifierStr(),
bidder: bidder,
mediaTypes: {
[BANNER]: {
sizes: [[300, 250]]
}
},
params: {
endpointId: 'testBanner',
},
userIdAsEids
}
];

let serverRequest = spec.buildRequests(bids, bidderRequest);

const { placements } = serverRequest.data;
for (let i = 0, len = placements.length; i < len; i++) {
const placement = placements[i];
expect(placement.endpointId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']);
expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]);
expect(placement.bidId).to.be.a('string');
expect(placement.schain).to.be.an('object');
expect(placement.bidfloor).to.exist.and.to.equal(0);
expect(placement.type).to.exist.and.to.equal('network');
expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);

if (placement.adFormat === BANNER) {
expect(placement.sizes).to.be.an('array');
}
switch (placement.adFormat) {
case BANNER:
expect(placement.sizes).to.be.an('array');
break;
case VIDEO:
expect(placement.playerSize).to.be.an('array');
expect(placement.minduration).to.be.an('number');
expect(placement.maxduration).to.be.an('number');
break;
case NATIVE:
expect(placement.native).to.be.an('object');
break;
}
}
});

it('Returns data with gdprConsent and without uspConsent', function () {
delete bidderRequest.uspConsent;
serverRequest = spec.buildRequests(bids, bidderRequest);
Expand Down

0 comments on commit 634ff5d

Please sign in to comment.