Skip to content

Commit

Permalink
Revert "added display count global object to track number of times re…
Browse files Browse the repository at this point in the history
…questBids has been called per ad-unit (#2802)"

This reverts commit 54f23fa.
  • Loading branch information
mkendall07 authored Jul 31, 2018
1 parent 873cb95 commit bccffa0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
3 changes: 1 addition & 2 deletions modules/medianetBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ function slotParams(bidRequest) {
let params = {
id: bidRequest.bidId,
ext: {
dfp_id: bidRequest.adUnitCode,
display_count: bidRequest.displayCount
dfp_id: bidRequest.adUnitCode
},
banner: transformSizes(bidRequest.sizes),
all: bidRequest.params
Expand Down
5 changes: 1 addition & 4 deletions src/adaptermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import { ajaxBuilder } from 'src/ajax';
import { config, RANDOM } from 'src/config';
import includes from 'core-js/library/fn/array/includes';
import find from 'core-js/library/fn/array/find';
import { getGlobal } from './prebidGlobal';

var utils = require('./utils.js');
var CONSTANTS = require('./constants.json');
var events = require('./events');
let s2sTestingModule; // store s2sTesting module if it's loaded
const $$PREBID_GLOBAL$$ = getGlobal();

var _bidderRegistry = {};
exports.bidderRegistry = _bidderRegistry;
Expand Down Expand Up @@ -97,8 +95,7 @@ function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels}) {
sizes: sizes,
bidId: bid.bid_id || utils.getUniqueIdentifierStr(),
bidderRequestId,
auctionId,
displayCount: $$PREBID_GLOBAL$$.displayCount[adUnit.code]
auctionId
}));
}
return bids;
Expand Down
5 changes: 0 additions & 5 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ utils.logInfo('Prebid.js v$prebid.version$ loaded');
// create adUnit array
$$PREBID_GLOBAL$$.adUnits = $$PREBID_GLOBAL$$.adUnits || [];

// store the number of times requestBids has been called per ad Unit
$$PREBID_GLOBAL$$.displayCount = $$PREBID_GLOBAL$$.displayCount || {};

// Allow publishers who enable user sync override to trigger their sync
$$PREBID_GLOBAL$$.triggerUserSyncs = triggerUserSyncs;

Expand Down Expand Up @@ -370,8 +367,6 @@ $$PREBID_GLOBAL$$.requestBids = createHook('asyncSeries', function ({ bidsBackHa
adUnit.bids = adUnit.bids.filter(bid => bid.bidder !== bidder);
}
});
// increment the number of times requestBids has been called for this adUnit
$$PREBID_GLOBAL$$.displayCount[adUnit.code] = ($$PREBID_GLOBAL$$.displayCount[adUnit.code] + 1) || 1;
});

if (!adUnits || adUnits.length === 0) {
Expand Down
36 changes: 12 additions & 24 deletions test/spec/modules/medianetBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ let VALID_BID_REQUEST = [{
'sizes': [[300, 250]],
'bidId': '28f8f8130a583e',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}, {
'bidder': 'medianet',
'params': {
Expand All @@ -34,8 +33,7 @@ let VALID_BID_REQUEST = [{
'sizes': [[300, 251]],
'bidId': '3f97ca71b1e5c2',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}],
VALID_BID_REQUEST_INVALID_BIDFLOOR = [{
'bidder': 'medianet',
Expand All @@ -53,8 +51,7 @@ let VALID_BID_REQUEST = [{
'sizes': [[300, 250]],
'bidId': '28f8f8130a583e',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}, {
'bidder': 'medianet',
'params': {
Expand All @@ -70,8 +67,7 @@ let VALID_BID_REQUEST = [{
'sizes': [[300, 251]],
'bidId': '3f97ca71b1e5c2',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}],
VALID_AUCTIONDATA = {
'timeout': config.getConfig('bidderTimeout'),
Expand Down Expand Up @@ -107,8 +103,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down Expand Up @@ -138,8 +133,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down Expand Up @@ -187,8 +181,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down Expand Up @@ -217,8 +210,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down Expand Up @@ -380,8 +372,7 @@ let VALID_BID_REQUEST = [{
'sizes': [300, 250],
'bidId': '28f8f8130a583e',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}, {
'bidder': 'medianet',
'params': {
Expand All @@ -397,8 +388,7 @@ let VALID_BID_REQUEST = [{
'sizes': [300, 251],
'bidId': '3f97ca71b1e5c2',
'bidderRequestId': '1e9b1f07797c1c',
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d',
'displayCount': 1
'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d'
}],
VALID_BIDDER_REQUEST_WITH_GDPR = {
'gdprConsent': {
Expand Down Expand Up @@ -439,8 +429,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down Expand Up @@ -469,8 +458,7 @@ let VALID_BID_REQUEST = [{
x: 100,
y: 100
}
},
'display_count': 1
}
},
'banner': [{
'w': 300,
Expand Down

0 comments on commit bccffa0

Please sign in to comment.