Skip to content

Commit

Permalink
convert bidders: iprom
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent cead162 commit f95f031
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion modules/integr8BidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const spec = {
bidderRequestId = bidderRequest.bidderRequestId;

if (bidderRequest.refererInfo) {
url = bidderRequest.refererInfo.referer;
url = bidderRequest.refererInfo.page;
}
}

Expand Down
9 changes: 6 additions & 3 deletions modules/interactiveOffersBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { logWarn, isNumber } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {bidderSettings} from '../src/bidderSettings.js';

const BIDDER_CODE = 'interactiveOffers';
const ENDPOINT = 'https://prebid.ioadx.com/bidRequest/?partnerId=';
Expand Down Expand Up @@ -77,13 +78,15 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
payload: {},
partnerId: null
};
// TODO: these should probably look at refererInfo
let pageURL = window.location.href;
let domain = window.location.hostname;
let secure = (window.location.protocol == 'https:' ? 1 : 0);
let openRTBRequest = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequest']));
openRTBRequest.id = prebidRequest.auctionId;
openRTBRequest.ext = {
refererInfo: prebidRequest.refererInfo,
// TODO: please do not send internal data structures over the network
refererInfo: prebidRequest.refererInfo.legacy,
auctionId: prebidRequest.auctionId
};

Expand All @@ -92,11 +95,11 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
openRTBRequest.site.name = domain;
openRTBRequest.site.domain = domain;
openRTBRequest.site.page = pageURL;
openRTBRequest.site.ref = prebidRequest.refererInfo.referer;
openRTBRequest.site.ref = prebidRequest.refererInfo.ref;

openRTBRequest.site.publisher = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestSitePublisher']));
openRTBRequest.site.publisher.id = 0;
openRTBRequest.site.publisher.name = config.getConfig('publisherDomain');
openRTBRequest.site.publisher.name = prebidRequest.refererInfo.domain;
openRTBRequest.site.publisher.domain = domain;
openRTBRequest.site.publisher.domain = domain;

Expand Down
3 changes: 2 additions & 1 deletion modules/ipromBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const spec = {
buildRequests: function (validBidRequests, bidderRequest) {
const payload = {
bids: validBidRequests,
referer: bidderRequest.refererInfo,
// TODO: please do not send internal data structures over the network
referer: bidderRequest.refererInfo.legacy,
version: VERSION
};
const payloadString = JSON.stringify(payload);
Expand Down
16 changes: 9 additions & 7 deletions test/spec/modules/ipromBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ describe('iPROM Adapter', function () {
bidderRequest = {
timeout: 3000,
refererInfo: {
referer: 'https://adserver.si/index.html',
reachedTop: true,
numIframes: 1,
stack: [
'https://adserver.si/index.html',
'https://adserver.si/iframe1.html',
]
legacy: {
referer: 'https://adserver.si/index.html',
reachedTop: true,
numIframes: 1,
stack: [
'https://adserver.si/index.html',
'https://adserver.si/iframe1.html',
]
}
}
}
});
Expand Down

0 comments on commit f95f031

Please sign in to comment.