diff --git a/modules/nanointeractiveBidAdapter.js b/modules/nanointeractiveBidAdapter.js index a76cc90ac10..13944cd5a35 100644 --- a/modules/nanointeractiveBidAdapter.js +++ b/modules/nanointeractiveBidAdapter.js @@ -14,6 +14,8 @@ export const SUB_ID = 'subId'; export const REF = 'ref'; export const LOCATION = 'loc'; +var nanoPid = '5a1ec660eb0a191dfa591172'; + export const spec = { code: BIDDER_CODE, @@ -29,7 +31,7 @@ export const spec = { validBidRequests.forEach( bid => payload.push(createSingleBidRequest(bid, bidderRequest)) ); - const url = getEndpointUrl('main') + '/hb'; + const url = getEndpointUrl() + '/hb'; return { method: 'POST', @@ -45,6 +47,23 @@ export const spec = { } }); return bids; + }, + getUserSyncs: function(syncOptions) { + const syncs = []; + if (syncOptions.iframeEnabled) { + syncs.push({ + type: 'iframe', + url: getEndpointUrl() + '/hb/cookieSync/' + nanoPid + }); + } + + if (syncOptions.pixelEnabled) { + syncs.push({ + type: 'image', + url: getEndpointUrl() + '/hb/cookieSync/' + nanoPid + }); + } + return syncs; } }; @@ -52,6 +71,9 @@ export const spec = { function createSingleBidRequest(bid, bidderRequest) { const location = utils.deepAccess(bidderRequest, 'refererInfo.referer'); const origin = utils.getOrigin(); + + nanoPid = bid.params[SSP_PLACEMENT_ID] || nanoPid; + const data = { [SSP_PLACEMENT_ID]: bid.params[SSP_PLACEMENT_ID], [NQ]: [createNqParam(bid)], @@ -117,10 +139,9 @@ function isEngineResponseValid(response) { /** * Used mainly for debugging * - * @param type * @returns string */ -function getEndpointUrl(type) { +function getEndpointUrl() { const nanoConfig = config.getConfig('nano'); return (nanoConfig && nanoConfig['endpointUrl']) || END_POINT_URL; }