Skip to content

Commit

Permalink
Automatad Bid Adapter: Fix built request json to support multiple bids (
Browse files Browse the repository at this point in the history
#5669)

* added automatad bid adapter

* added automatad bid adapter readme

* added automatad bidder adapter unit test

* updated maintainer email id for automatad adapter

* refactored automatadBidAdapter js

* refactored automatadBidAdapter unit test

* refactored automatadBidAdapter unit test

* added usersync code to automatad bid adapter

* Added unit test for onBidWon in automatadBidAdapter_spec

* removed trailing spaces

* removed trailing space

* changes for getUserSync function

* lint error fixes

* updated usersync url

* additional test for onBidWon function added

* added ajax stub in test

* updated winurl params

* lint fixes

* added adunitCode in bid request

* added test for adunit code

* add placement in impression object
  • Loading branch information
kanchika-kapoor authored Sep 2, 2020
1 parent badaab8 commit bafa139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions modules/automatadBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export const spec = {
}

const siteId = validBidRequests[0].params.siteId
const placementId = validBidRequests[0].params.placementId

const impressions = validBidRequests.map(bidRequest => {
return {
id: bidRequest.bidId,
adUnitCode: bidRequest.adUnitCode,
placement: bidRequest.params.placementId,
banner: {
format: bidRequest.sizes.map(sizeArr => ({
w: sizeArr[0],
Expand All @@ -48,7 +48,6 @@ export const spec = {
imp: impressions,
site: {
id: siteId,
placement: placementId,
domain: window.location.hostname,
page: window.location.href,
ref: bidderRequest.refererInfo ? bidderRequest.refererInfo.referer || null : null,
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/automatadBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ describe('automatadBidAdapter', function () {
expect(rdata.imp.length).to.equal(1)
})

it('should include placement', function () {
let r = rdata.imp[0]
expect(r.placement !== null).to.be.true
})

it('should include media types', function () {
let r = rdata.imp[0]
expect(r.media_types !== null).to.be.true
Expand Down

0 comments on commit bafa139

Please sign in to comment.