From 8b71ebbdb46c0876d79143babe8e8a8e16e35411 Mon Sep 17 00:00:00 2001 From: Bryan DeLong Date: Thu, 14 Jun 2018 13:47:28 -0400 Subject: [PATCH 1/3] Integration of Realvu analytics in Somo adapter --- modules/somoaudienceBidAdapter.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/somoaudienceBidAdapter.js b/modules/somoaudienceBidAdapter.js index 3c5d9854426..b436329a2bb 100644 --- a/modules/somoaudienceBidAdapter.js +++ b/modules/somoaudienceBidAdapter.js @@ -1,5 +1,6 @@ import {getTopWindowReferrer, getTopWindowLocation} from 'src/utils'; import { registerBidder } from 'src/adapters/bidderFactory'; +const realvuAnalyticsAdapter = require('modules/realvuAnalyticsAdapter.js'); export const spec = { @@ -13,10 +14,21 @@ export const spec = { buildRequests: function(bidRequests) { return bidRequests.map(bidRequest => { + const rv = realvuAnalyticsAdapter.checkIn(bidRequest, 'E321'); + let da = openRtbRequest(bidRequest); + if(rv=='yes') da.imp[0].pmp = { + private_auction: 0, + deals: [ + { + id: 'realvu', + bidfloor: 1.5 + } + ] + }; return { method: 'POST', url: '//publisher-east.mobileadtrading.com/rtb/bid?s=' + bidRequest.params.placementId.toString(), - data: openRtbRequest(bidRequest), + data: da, bidRequest: bidRequest }; }); From bd9c7ff7faed2108bef4a749c1248c8b7ec6af4d Mon Sep 17 00:00:00 2001 From: Bryan DeLong Date: Thu, 14 Jun 2018 14:22:39 -0400 Subject: [PATCH 2/3] Bug Fixes --- modules/somoaudienceBidAdapter.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/somoaudienceBidAdapter.js b/modules/somoaudienceBidAdapter.js index b436329a2bb..ea1e8071e13 100644 --- a/modules/somoaudienceBidAdapter.js +++ b/modules/somoaudienceBidAdapter.js @@ -16,15 +16,17 @@ export const spec = { return bidRequests.map(bidRequest => { const rv = realvuAnalyticsAdapter.checkIn(bidRequest, 'E321'); let da = openRtbRequest(bidRequest); - if(rv=='yes') da.imp[0].pmp = { - private_auction: 0, - deals: [ - { - id: 'realvu', - bidfloor: 1.5 - } - ] - }; + if (rv == 'yes') { + da.imp[0].pmp = { + private_auction: 0, + deals: [ + { + id: 'realvu', + bidfloor: 1.5 + } + ] + }; + } return { method: 'POST', url: '//publisher-east.mobileadtrading.com/rtb/bid?s=' + bidRequest.params.placementId.toString(), From 3cf3b50de7f7ddb8a616eaa94099b6f2d6117b77 Mon Sep 17 00:00:00 2001 From: Bryan DeLong Date: Tue, 19 Jun 2018 09:16:20 -0400 Subject: [PATCH 3/3] Reworked adapter to not require or include the realvu adapter. instead checking for and using the variables directly --- modules/somoaudienceBidAdapter.js | 34 ++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/modules/somoaudienceBidAdapter.js b/modules/somoaudienceBidAdapter.js index ea1e8071e13..7655eb9e2e0 100644 --- a/modules/somoaudienceBidAdapter.js +++ b/modules/somoaudienceBidAdapter.js @@ -1,6 +1,5 @@ import {getTopWindowReferrer, getTopWindowLocation} from 'src/utils'; import { registerBidder } from 'src/adapters/bidderFactory'; -const realvuAnalyticsAdapter = require('modules/realvuAnalyticsAdapter.js'); export const spec = { @@ -14,18 +13,29 @@ export const spec = { buildRequests: function(bidRequests) { return bidRequests.map(bidRequest => { - const rv = realvuAnalyticsAdapter.checkIn(bidRequest, 'E321'); let da = openRtbRequest(bidRequest); - if (rv == 'yes') { - da.imp[0].pmp = { - private_auction: 0, - deals: [ - { - id: 'realvu', - bidfloor: 1.5 - } - ] - }; + if (window.top1 && window.top1.realvu_aa) { + let a = window.top1.realvu_aa.check({ + unit_id: bidRequest.adUnitCode, + size: bidRequest.sizes, + partner_id: 'E321' + }); + a.rq_bids.push({ + bidder: bidRequest.bidder, + adId: bidRequest.bidId, + partner_id: 'E321' + }); + if (a.riff == 'yes') { + da.imp[0].pmp = { + private_auction: 0, + deals: [ + { + id: 'realvu', + bidfloor: 1.5 + } + ] + }; + } } return { method: 'POST',