Skip to content

Commit

Permalink
convert bidders: conversant
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent edf8b41 commit 5cf6955
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions modules/consumableBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const spec = {
const data = Object.assign({
placements: [],
time: Date.now(),
url: bidderRequest.refererInfo.referer,
referrer: document.referrer,
url: bidderRequest.refererInfo.page,
referrer: bidderRequest.refererInfo.ref,
source: [{
'name': 'prebidjs',
'version': '$prebid.version$'
Expand Down Expand Up @@ -123,7 +123,7 @@ export const spec = {
bid.creativeId = decision.adId;
bid.ttl = 30;
bid.netRevenue = true;
bid.referrer = bidRequest.bidderRequest.refererInfo.referer;
bid.referrer = bidRequest.bidderRequest.refererInfo.page;

bid.meta = {
advertiserDomains: decision.adomain || []
Expand Down
3 changes: 2 additions & 1 deletion modules/contentexchangeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ export const spec = {
winLocation = window.location;
}

const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.referer;
const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page;
let refferLocation;
try {
refferLocation = refferUrl && new URL(refferUrl);
} catch (e) {
logMessage(e);
}

// TODO: does the fallback to 'window.location' make sense?
let location = refferLocation || winLocation;
const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
const host = location.host;
Expand Down
2 changes: 1 addition & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const spec = {
* @return {ServerRequest} Info describing the request to the server.
*/
buildRequests: function(validBidRequests, bidderRequest) {
const page = (bidderRequest && bidderRequest.refererInfo) ? bidderRequest.refererInfo.referer : '';
const page = (bidderRequest && bidderRequest.refererInfo) ? bidderRequest.refererInfo.page : '';
let siteId = '';
let requestId = '';
let pubcid = null;
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('Conversant adapter tests', function() {
const page = 'http://test.com?a=b&c=123';
const bidderRequest = {
refererInfo: {
referer: page
page: page
}
};
const request = spec.buildRequests(bidRequests, bidderRequest);
Expand Down Expand Up @@ -362,7 +362,7 @@ describe('Conversant adapter tests', function() {

it('Verify first party data', () => {
const bidderRequest = {
refererInfo: {referer: 'http://test.com?a=b&c=123'},
refererInfo: {page: 'http://test.com?a=b&c=123'},
ortb2: {site: {content: {series: 'MySeries', season: 'MySeason', episode: 3, title: 'MyTitle'}}}
};
const request = spec.buildRequests(bidRequests, bidderRequest);
Expand All @@ -375,7 +375,7 @@ describe('Conversant adapter tests', function() {
});

it('Verify supply chain data', () => {
const bidderRequest = {refererInfo: {referer: 'http://test.com?a=b&c=123'}};
const bidderRequest = {refererInfo: {page: 'http://test.com?a=b&c=123'}};
const schain = {complete: 1, ver: '1.0', nodes: [{asi: 'bidderA.com', sid: '00001', hp: 1}]};
const bidsWithSchain = bidRequests.map((bid) => {
return Object.assign({
Expand Down

0 comments on commit 5cf6955

Please sign in to comment.