Skip to content

Commit

Permalink
description not message
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez committed Sep 16, 2021
1 parent 8058749 commit ca85c21
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 90 deletions.
24 changes: 12 additions & 12 deletions modules/rubiconAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const {
} = CONSTANTS;

let serverConfig;
config.getConfig('s2sConfig', ({s2sConfig}) => {
config.getConfig('s2sConfig', ({ s2sConfig }) => {
serverConfig = s2sConfig;
});

Expand Down Expand Up @@ -74,7 +74,7 @@ config.getConfig('rubicon', config => {

export function getHostNameFromReferer(referer) {
try {
rubiconAdapter.referrerHostname = utils.parseUrl(referer, {noDecodeWholeURL: true}).hostname;
rubiconAdapter.referrerHostname = utils.parseUrl(referer, { noDecodeWholeURL: true }).hostname;
} catch (e) {
utils.logError('Rubicon Analytics: Unable to parse hostname from supplied url: ', referer, e);
rubiconAdapter.referrerHostname = '';
Expand Down Expand Up @@ -371,7 +371,7 @@ export function parseBidResponse(bid, previousBidResponse, auctionFloorData) {
'dimensions', () => {
const width = bid.width || bid.playerWidth;
const height = bid.height || bid.playerHeight;
return (width && height) ? {width, height} : undefined;
return (width && height) ? { width, height } : undefined;
},
// Handling use case where pbs sends back 0 or '0' bidIds
'pbsBidId', pbsBidId => pbsBidId == 0 ? utils.generateUUID() : pbsBidId,
Expand Down Expand Up @@ -472,7 +472,7 @@ function updateRpaCookie() {
// possible that decodedRpaCookie is undefined, and if it is, we probably are blocked by storage or some other exception
if (Object.keys(decodedRpaCookie).length) {
decodedRpaCookie.lastSeen = currentTime;
decodedRpaCookie.fpkvs = {...decodedRpaCookie.fpkvs, ...getFpkvs()};
decodedRpaCookie.fpkvs = { ...decodedRpaCookie.fpkvs, ...getFpkvs() };
decodedRpaCookie.pvid = rubiConf.pvid;
setRpaCookie(decodedRpaCookie)
}
Expand Down Expand Up @@ -516,7 +516,7 @@ function subscribeToGamSlots() {
});
}

let baseAdapter = adapter({analyticsType: 'endpoint'});
let baseAdapter = adapter({ analyticsType: 'endpoint' });
let rubiconAdapter = Object.assign({}, baseAdapter, {
MODULE_INITIALIZED_TIME: Date.now(),
referrerHostname: '',
Expand Down Expand Up @@ -566,7 +566,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
cache.gpt.registered = false;
baseAdapter.disableAnalytics.apply(this, arguments);
},
track({eventType, args}) {
track({ eventType, args }) {
switch (eventType) {
case AUCTION_INIT:
// set the rubicon aliases
Expand All @@ -581,7 +581,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
cacheEntry.referrer = utils.deepAccess(args, 'bidderRequests.0.refererInfo.referer');
const floorData = utils.deepAccess(args, 'bidderRequests.0.bids.0.floorData');
if (floorData) {
cacheEntry.floorData = {...floorData};
cacheEntry.floorData = { ...floorData };
}
cacheEntry.gdprConsent = utils.deepAccess(args, 'bidderRequests.0.gdprConsent');
cacheEntry.session = storage.localStorageIsEnabled() && updateRpaCookie();
Expand All @@ -594,7 +594,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
cache.gpt.registered = true;
window.googletag = window.googletag || {};
window.googletag.cmd = window.googletag.cmd || [];
window.googletag.cmd.push(function() {
window.googletag.cmd.push(function () {
subscribeToGamSlots();
});
}
Expand Down Expand Up @@ -674,7 +674,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
},
'gam', () => {
if (utils.deepAccess(bid, 'ortb2Imp.ext.data.adserver.name') === 'gam') {
return {adSlot: bid.ortb2Imp.ext.data.adserver.adslot}
return { adSlot: bid.ortb2Imp.ext.data.adserver.adslot }
}
},
'pbAdSlot', () => utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'),
Expand All @@ -688,7 +688,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
let auctionEntry = cache.auctions[args.auctionId];

if (!auctionEntry.bids[args.requestId] && args.originalRequestId) {
auctionEntry.bids[args.requestId] = {...auctionEntry.bids[args.originalRequestId]};
auctionEntry.bids[args.requestId] = { ...auctionEntry.bids[args.originalRequestId] };
auctionEntry.bids[args.requestId].bidId = args.requestId;
auctionEntry.bids[args.requestId].bidderDetail = args.targetingBidder;
}
Expand All @@ -700,7 +700,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
}
// if we have not set enforcements yet set it
if (!utils.deepAccess(auctionEntry, 'floorData.enforcements') && utils.deepAccess(args, 'floorData.enforcements')) {
auctionEntry.floorData.enforcements = {...args.floorData.enforcements};
auctionEntry.floorData.enforcements = { ...args.floorData.enforcements };
}
if (!bid) {
utils.logError('Rubicon Anlytics Adapter Error: Could not find associated bid request for bid response with requestId: ', args.requestId);
Expand Down Expand Up @@ -796,7 +796,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
bid.status = 'error';
bid.error = {
code: 'timeout-error',
message: 'marked by prebid.js as timeout' // will help us diff if timeout was set by PBS or PBJS
description: 'marked by prebid.js as timeout' // will help us diff if timeout was set by PBS or PBJS
};
}
});
Expand Down
Loading

0 comments on commit ca85c21

Please sign in to comment.