Skip to content

Commit c0af432

Browse files
authored
Price Floors update to include modelTimestamp displaying when the floors file was produced (#6061)
Rubicon Anaytics Update to pass modelTimestamp if exists
1 parent a95f1db commit c0af432

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

modules/priceFloors.js

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ export function updateAdUnitsForAuction(adUnits, floorData, auctionId) {
291291
skipRate: floorData.skipRate,
292292
floorMin: floorData.floorMin,
293293
modelVersion: utils.deepAccess(floorData, 'data.modelVersion'),
294+
modelTimestamp: utils.deepAccess(floorData, 'data.modelTimestamp'),
294295
location: utils.deepAccess(floorData, 'data.location', 'noData'),
295296
floorProvider: floorData.floorProvider,
296297
fetchStatus: _floorsConfig.fetchStatus

modules/rubiconAnalyticsAdapter.js

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ function sendMessage(auctionId, bidWonId) {
237237
auction.floors = utils.pick(auctionCache.floorData, [
238238
'location',
239239
'modelVersion as modelName',
240+
'modelTimestamp',
240241
'skipped',
241242
'enforcement', () => utils.deepAccess(auctionCache.floorData, 'enforcements.enforceJS'),
242243
'dealsEnforced', () => utils.deepAccess(auctionCache.floorData, 'enforcements.floorDeals'),

test/spec/modules/priceFloors_spec.js

+23
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('the price floors module', function () {
2323
let clock;
2424
const basicFloorData = {
2525
modelVersion: 'basic model',
26+
modelTimestamp: 1606772895,
2627
currency: 'USD',
2728
schema: {
2829
delimiter: '|',
@@ -184,6 +185,7 @@ describe('the price floors module', function () {
184185
let resultingData = getFloorsDataForAuction(inputFloorData, 'test_div_1');
185186
expect(resultingData).to.deep.equal({
186187
modelVersion: 'basic model',
188+
modelTimestamp: 1606772895,
187189
currency: 'USD',
188190
schema: {
189191
delimiter: '|',
@@ -201,6 +203,7 @@ describe('the price floors module', function () {
201203
resultingData = getFloorsDataForAuction(inputFloorData, 'this_is_a_div');
202204
expect(resultingData).to.deep.equal({
203205
modelVersion: 'basic model',
206+
modelTimestamp: 1606772895,
204207
currency: 'USD',
205208
schema: {
206209
delimiter: '^',
@@ -429,6 +432,7 @@ describe('the price floors module', function () {
429432
skipped: true,
430433
floorMin: undefined,
431434
modelVersion: undefined,
435+
modelTimestamp: undefined,
432436
location: 'noData',
433437
skipRate: 0,
434438
fetchStatus: undefined,
@@ -463,6 +467,7 @@ describe('the price floors module', function () {
463467
skipped: false,
464468
floorMin: undefined,
465469
modelVersion: 'adUnit Model Version',
470+
modelTimestamp: 1606772895,
466471
location: 'adUnit',
467472
skipRate: 0,
468473
fetchStatus: undefined,
@@ -496,6 +501,7 @@ describe('the price floors module', function () {
496501
validateBidRequests(true, {
497502
skipped: false,
498503
modelVersion: 'adUnit Model Version',
504+
modelTimestamp: 1606772895,
499505
location: 'adUnit',
500506
skipRate: 0,
501507
floorMin: 7,
@@ -510,6 +516,7 @@ describe('the price floors module', function () {
510516
skipped: false,
511517
floorMin: undefined,
512518
modelVersion: 'basic model',
519+
modelTimestamp: 1606772895,
513520
location: 'setConfig',
514521
skipRate: 0,
515522
fetchStatus: undefined,
@@ -531,6 +538,7 @@ describe('the price floors module', function () {
531538
skipped: false,
532539
floorMin: undefined,
533540
modelVersion: 'basic model',
541+
modelTimestamp: 1606772895,
534542
location: 'setConfig',
535543
skipRate: 0,
536544
fetchStatus: undefined,
@@ -545,6 +553,7 @@ describe('the price floors module', function () {
545553
skipped: false,
546554
floorMin: undefined,
547555
modelVersion: 'basic model',
556+
modelTimestamp: 1606772895,
548557
location: 'setConfig',
549558
skipRate: 0,
550559
fetchStatus: undefined,
@@ -559,6 +568,7 @@ describe('the price floors module', function () {
559568
skipped: false,
560569
floorMin: undefined,
561570
modelVersion: 'basic model',
571+
modelTimestamp: 1606772895,
562572
location: 'setConfig',
563573
skipRate: 0,
564574
fetchStatus: undefined,
@@ -582,6 +592,7 @@ describe('the price floors module', function () {
582592
skipped: false,
583593
floorMin: undefined,
584594
modelVersion: 'basic model',
595+
modelTimestamp: 1606772895,
585596
location: 'setConfig',
586597
skipRate: 50,
587598
fetchStatus: undefined,
@@ -596,6 +607,7 @@ describe('the price floors module', function () {
596607
skipped: false,
597608
floorMin: undefined,
598609
modelVersion: 'basic model',
610+
modelTimestamp: 1606772895,
599611
location: 'setConfig',
600612
skipRate: 10,
601613
fetchStatus: undefined,
@@ -610,6 +622,7 @@ describe('the price floors module', function () {
610622
skipped: false,
611623
floorMin: undefined,
612624
modelVersion: 'basic model',
625+
modelTimestamp: 1606772895,
613626
location: 'setConfig',
614627
skipRate: 0,
615628
fetchStatus: undefined,
@@ -674,6 +687,7 @@ describe('the price floors module', function () {
674687
skipped: false,
675688
floorMin: undefined,
676689
modelVersion: 'model-1',
690+
modelTimestamp: undefined,
677691
location: 'setConfig',
678692
skipRate: 0,
679693
fetchStatus: undefined,
@@ -687,6 +701,7 @@ describe('the price floors module', function () {
687701
skipped: false,
688702
floorMin: undefined,
689703
modelVersion: 'model-2',
704+
modelTimestamp: undefined,
690705
location: 'setConfig',
691706
skipRate: 0,
692707
fetchStatus: undefined,
@@ -700,6 +715,7 @@ describe('the price floors module', function () {
700715
skipped: false,
701716
floorMin: undefined,
702717
modelVersion: 'model-3',
718+
modelTimestamp: undefined,
703719
location: 'setConfig',
704720
skipRate: 0,
705721
fetchStatus: undefined,
@@ -729,6 +745,7 @@ describe('the price floors module', function () {
729745
skipped: false,
730746
floorMin: undefined,
731747
modelVersion: 'basic model',
748+
modelTimestamp: 1606772895,
732749
location: 'setConfig',
733750
skipRate: 0,
734751
fetchStatus: undefined,
@@ -808,6 +825,7 @@ describe('the price floors module', function () {
808825
skipped: false,
809826
floorMin: undefined,
810827
modelVersion: 'basic model',
828+
modelTimestamp: 1606772895,
811829
location: 'setConfig',
812830
skipRate: 0,
813831
fetchStatus: 'timeout',
@@ -846,6 +864,7 @@ describe('the price floors module', function () {
846864
skipped: false,
847865
floorMin: undefined,
848866
modelVersion: 'fetch model name',
867+
modelTimestamp: 1606772895,
849868
location: 'fetch',
850869
skipRate: 0,
851870
fetchStatus: 'success',
@@ -883,6 +902,7 @@ describe('the price floors module', function () {
883902
skipped: false,
884903
floorMin: undefined,
885904
modelVersion: 'fetch model name',
905+
modelTimestamp: 1606772895,
886906
location: 'fetch',
887907
skipRate: 0,
888908
fetchStatus: 'success',
@@ -923,6 +943,7 @@ describe('the price floors module', function () {
923943
skipped: false,
924944
floorMin: undefined,
925945
modelVersion: 'fetch model name',
946+
modelTimestamp: 1606772895,
926947
location: 'fetch',
927948
skipRate: 95,
928949
fetchStatus: 'success',
@@ -945,6 +966,7 @@ describe('the price floors module', function () {
945966
skipped: false,
946967
floorMin: undefined,
947968
modelVersion: 'basic model',
969+
modelTimestamp: 1606772895,
948970
location: 'setConfig',
949971
skipRate: 0,
950972
fetchStatus: 'error',
@@ -969,6 +991,7 @@ describe('the price floors module', function () {
969991
skipped: false,
970992
floorMin: undefined,
971993
modelVersion: 'basic model',
994+
modelTimestamp: 1606772895,
972995
location: 'setConfig',
973996
skipRate: 0,
974997
fetchStatus: 'success',

test/spec/modules/rubiconAnalyticsAdapter_spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ describe('rubicon analytics adapter', function () {
852852
auctionInit.bidderRequests[0].bids[0].floorData = {
853853
skipped: false,
854854
modelVersion: 'someModelName',
855+
modelTimestamp: 1606772895,
855856
location: 'setConfig',
856857
skipRate: 15,
857858
fetchStatus: 'error',
@@ -953,6 +954,7 @@ describe('rubicon analytics adapter', function () {
953954
expect(message.auctions[0].floors).to.deep.equal({
954955
location: 'setConfig',
955956
modelName: 'someModelName',
957+
modelTimestamp: 1606772895,
956958
skipped: false,
957959
enforcement: true,
958960
dealsEnforced: false,
@@ -998,6 +1000,7 @@ describe('rubicon analytics adapter', function () {
9981000
expect(message.auctions[0].floors).to.deep.equal({
9991001
location: 'setConfig',
10001002
modelName: 'someModelName',
1003+
modelTimestamp: 1606772895,
10011004
skipped: false,
10021005
enforcement: true,
10031006
dealsEnforced: false,

0 commit comments

Comments
 (0)