Skip to content

Commit

Permalink
Read pos off the adunit
Browse files Browse the repository at this point in the history
  • Loading branch information
wsusrasp committed Aug 8, 2022
1 parent f22ff6e commit da2bf4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/rasBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';
import { isEmpty, getAdUnitSizes, parseSizesInput, deepAccess } from '../src/utils.js';
Expand Down Expand Up @@ -90,13 +91,17 @@ const getSlots = (bidRequests) => {
const batchSize = bidRequests.length;
for (let i = 0; i < batchSize; i++) {
const adunit = bidRequests[i];
const pos = utils.deepAccess(adunit, 'params.pos');

const sizes = parseSizesInput(getAdUnitSizes(adunit)).join(',');

queryString += `&slot${i}=${encodeURIComponent(adunit.params.slot)}&id${i}=${encodeURIComponent(adunit.bidId)}&composition${i}=CHILD`;

if (sizes.length) {
queryString += `&iusizes${i}=${encodeURIComponent(sizes)}`;
}
if (Object.prototype.hasOwnProperty.call(adunit.params, 'pos')) {
queryString += `&pos${i}=${encodeURIComponent(adunit.params.pos)}`;
if (pos !== undefined) {
queryString += `&pos${i}=${encodeURIComponent(pos)}`;
}
}
return queryString;
Expand Down

0 comments on commit da2bf4b

Please sign in to comment.