From 8c3927c4b27058dca7c98b2e204d862dc2033b93 Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 21 Jun 2024 17:01:33 +0530 Subject: [PATCH 1/7] Audiencelogy Bid Adapter : Initial Release --- modules/audiencelogyBidAdapter.js | 163 +++++++++++ modules/audiencelogyBidAdapter.md | 41 +++ .../modules/audiencelogyBidAdapter_spec.js | 258 ++++++++++++++++++ 3 files changed, 462 insertions(+) create mode 100644 modules/audiencelogyBidAdapter.js create mode 100644 modules/audiencelogyBidAdapter.md create mode 100644 test/spec/modules/audiencelogyBidAdapter_spec.js diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js new file mode 100644 index 00000000000..4e76ed12470 --- /dev/null +++ b/modules/audiencelogyBidAdapter.js @@ -0,0 +1,163 @@ +import { + registerBidder +} from '../src/adapters/bidderFactory.js'; +import { + BANNER +} from '../src/mediaTypes.js'; +import { + deepAccess, + generateUUID, + isArray, + logError +} from '../src/utils.js'; +const BIDDER_CODE = 'audiencelogy'; +const ENDPOINT_URL = 'https://rtb.audiencelogy.com/prebid'; + +function buildRequests(bidRequests, bidderRequest) { + const requests = []; + let nid = 0; + // Loop through each bid request + bidRequests.forEach(bid => { + // Construct the bid request object + const request = { + id: generateUUID(), + placementId: bid.params.placement_id, + imp: [{ + id: bid.bidId, + banner: getBanner(bid), + bidfloor: getFloor(bid) + }], + site: getSite(bidderRequest), + user: buildUser(bid) + }; + // Get uspConsent from bidderRequest + if (bidderRequest && bidderRequest.uspConsent) { + request.us_privacy = bidderRequest.uspConsent; + } + // Get GPP Consent from bidderRequest + if (bidderRequest?.gppConsent?.gppString) { + request.gpp = bidderRequest.gppConsent.gppString; + request.gpp_sid = bidderRequest.gppConsent.applicableSections; + } else if (bidderRequest?.ortb2?.regs?.gpp) { + request.gpp = bidderRequest.ortb2.regs.gpp; + request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; + } + // Get coppa compliance from bidderRequest + if (bidderRequest?.ortb2?.regs?.coppa) { + request.coppa = 1; + } + // Push the constructed bid request to the requests array + requests.push(request); + // Set nid value + nid = bid.params.nid; + }); + // Return the array of bid requests + return { + method: 'POST', + url: `${ENDPOINT_URL}/${nid}`, + data: JSON.stringify(requests), + options: { + contentType: 'application/json', + } + }; +} +// Format the response as per the standards +function interpretResponse(bidResponse, bidRequest) { + let resp = []; + if (bidResponse && bidResponse.body) { + try { + let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; + if (bids) { + bids.forEach(bidObj => { + let newBid = formatResponse(bidObj); + newBid.mediaType = BANNER; + resp.push(newBid); + }); + } + } catch (err) { + logError(err); + } + } + return resp; +} +// Function to check if Bid is valid +function isBidRequestValid(bid) { + return !!(bid.params.placement_id && bid.params.user_id && bid.params.nid); +} +// Function to get banner details +function getBanner(bid) { + if (deepAccess(bid, 'mediaTypes.banner')) { + // Fetch width and height from MediaTypes object, if not provided in bid params + if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { + let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + if (isArray(sizes) && sizes.length > 0) { + return { + h: sizes[0][1], + w: sizes[0][0] + }; + } + } else { + return { + h: bid.params.height, + w: bid.params.width + }; + } + } +} +// Function to get bid_floor +function getFloor(bid) { + if (bid.params && bid.params.bid_floor) { + return bid.params.bid_floor; + } else { + return 0; + } +} +// Function to get site details +function getSite(bidderRequest) { + let site = {}; + if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { + site.name = bidderRequest.refererInfo.domain; + } else { + site.name = ''; + } + return site; +} +// Function to format response +function formatResponse(bid) { + return { + requestId: bid && bid.impid ? bid.impid : undefined, + cpm: bid && bid.price ? bid.price : 0.0, + width: bid && bid.w ? bid.w : 0, + height: bid && bid.h ? bid.h : 0, + ad: bid && bid.adm ? bid.adm : '', + meta: { + advertiserDomains: bid && bid.adomain ? bid.adomain : [] + }, + creativeId: bid && bid.crid ? bid.crid : undefined, + netRevenue: false, + currency: bid && bid.cur ? bid.cur : 'USD', + ttl: 300, + dealId: bid && bid.dealId ? bid.dealId : undefined + }; +} +// Function to build the user object +function buildUser(bid) { + if (bid && bid.params) { + return { + id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', + buyeruid: localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '', + keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '', + customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : '' + }; + } +} +// Export const spec +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: BANNER, + isBidRequestValid, + buildRequests, + interpretResponse +} + +registerBidder(spec); diff --git a/modules/audiencelogyBidAdapter.md b/modules/audiencelogyBidAdapter.md new file mode 100644 index 00000000000..ef705270b02 --- /dev/null +++ b/modules/audiencelogyBidAdapter.md @@ -0,0 +1,41 @@ +# Overview + +``` +Module Name: Audiencelogy Bidder Adapter +Module Type: Bidder Adapter +Maintainer: support@audiencelogy.com +``` + +# Description + +Audiencelogy currently supports the BANNER type ads through prebid js + +Module that connects to audiencelogy's demand sources. + +# Banner Test Request +``` + var adUnits = [ + { + code: 'display-ad', + mediaTypes: { + banner: { + sizes: [[160, 600]], + } + } + bids: [ + { + bidder: 'audiencelogy', + params: { + placement_id: 584, // Required parameter + user_id: '1111111' // Required parameter + nid: 1 // Required parameter + width: 160, // Optional parameter + height: 600, // Optional parameter + domain: '', // Optional parameter + bid_floor: 0.5 // Optional parameter + } + } + ] + } + ]; +``` diff --git a/test/spec/modules/audiencelogyBidAdapter_spec.js b/test/spec/modules/audiencelogyBidAdapter_spec.js new file mode 100644 index 00000000000..a57edba3a1b --- /dev/null +++ b/test/spec/modules/audiencelogyBidAdapter_spec.js @@ -0,0 +1,258 @@ +import { + expect +} from 'chai'; +import { + spec +} from '../../../modules/audiencelogyBidAdapter'; +import * as utils from '../../../src/utils.js'; + +describe('audiencelogy adapter', function() { + let request; + let bannerResponse, invalidResponse; + + beforeEach(function() { + request = [{ + bidder: 'audiencelogy', + mediaTypes: { + banner: { + sizes: [ + [160, 600] + ] + } + }, + params: { + placement_id: 584, + user_id: '11211', + nid: 1, + width: 160, + height: 600, + domain: '', + bid_floor: 0.5 + } + }]; + bannerResponse = { + 'body': { + 'id': 'fffa1bd3-4081-4af4-8c88-ae4818cbb7c0', + 'seatbid': [{ + 'bid': [{ + 'id': '6c773235-bb84-44cb-afaf-2adaa8855393', + 'impid': '291c17291a08a7', + 'price': 0.47, + 'adid': '3418', + 'adm': "", + 'adomain': ['audiencelogy.com'], + 'iurl': 'https://cdn.audiencelogy.com/1_3418_1.png', + 'cid': '1383/3418', + 'crid': '3418', + 'w': 160, + 'h': 600, + 'cat': ['IAB1'] + }], + 'seat': 'audiencelogy', + 'group': 0 + }], + 'cur': 'USD', + 'bidid': 'BIDDER_1256' + } + }; + invalidResponse = { + 'body': { + 'id': 'fffa1bd3-4081-4af4-8c88-ae4818cbb7c0', + 'seatbid': [{ + 'bid': [{ + 'id': '6c773235-bb84-44cb-afaf-2adaa8855393', + 'impid': '291c17291a08a7', + 'price': 0.47, + 'adid': '3418', + 'adm': 'invalid response', + 'adomain': ['audiencelogy.com'], + 'iurl': 'https://cdn.audiencelogy.com/1_3418_1.png', + 'cid': '1383/3418', + 'crid': '3418', + 'w': 160, + 'h': 600, + 'cat': ['IAB1'] + }], + 'seat': 'audiencelogy', + 'group': 0 + }], + 'cur': 'USD', + 'bidid': 'BIDDER_1256' + } + }; + }); + + describe('validations', function() { + it('isBidValid : placement_id, user_id and nid are passed', function() { + let bid = { + bidder: 'audiencelogy', + params: { + placement_id: 584, + user_id: '11211', + nid: 1 + } + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equals(true); + }); + it('isBidValid : placement_id, user_id and nid are not passed', function() { + let bid = { + bidder: 'audiencelogy', + params: { + width: 160, + height: 600, + domain: '', + bid_floor: 0.5 + } + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equals(false); + }); + it('isBidValid : placement_id and nid are passed but user_id is not passed', function() { + let bid = { + bidder: 'audiencelogy', + params: { + placement_id: 584, + nid: 1, + width: 160, + height: 600, + domain: '', + bid_floor: 0.5 + } + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equals(false); + }); + it('isBidValid : user_id and nid are passed but placement_id is not passed', function() { + let bid = { + bidder: 'audiencelogy', + params: { + user_id: '11211', + nid: 1, + width: 160, + height: 600, + domain: '', + bid_floor: 0.5, + } + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equals(false); + }); + it('isBidValid : user_id and placement_id are passed but nid is not passed', function() { + let bid = { + bidder: 'audiencelogy', + params: { + placement_id: 584, + user_id: '11211', + width: 160, + height: 600, + domain: '', + bid_floor: 0.5, + } + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equals(false); + }); + }); + describe('Validate Request', function() { + it('Immutable bid request validate', function() { + let _Request = utils.deepClone(request), + bidRequest = spec.buildRequests(request); + expect(request).to.deep.equal(_Request); + }); + it('Validate bidder connection', function() { + let _Request = spec.buildRequests(request); + expect(_Request.url).to.equal('https://rtb.audiencelogy.com/prebid/1'); + expect(_Request.method).to.equal('POST'); + expect(_Request.options.contentType).to.equal('application/json'); + }); + it('Validate bid request : Impression', function() { + let _Request = spec.buildRequests(request); + let data = JSON.parse(_Request.data); + expect(data[0].imp[0].id).to.equal(request[0].bidId); + expect(data[0].placementId).to.equal(584); + }); + it('Validate bid request : ad size', function() { + let _Request = spec.buildRequests(request); + let data = JSON.parse(_Request.data); + expect(data[0].imp[0].banner).to.be.a('object'); + expect(data[0].imp[0].banner.w).to.equal(160); + expect(data[0].imp[0].banner.h).to.equal(600); + }); + it('Validate bid request : user object', function() { + let _Request = spec.buildRequests(request); + let data = JSON.parse(_Request.data); + expect(data[0].user).to.be.a('object'); + expect(data[0].user.id).to.be.a('string'); + }); + it('Validate bid request : CCPA Check', function() { + let bidRequest = { + uspConsent: '1NYN' + }; + let _Request = spec.buildRequests(request, bidRequest); + let data = JSON.parse(_Request.data); + expect(data[0].us_privacy).to.equal('1NYN'); + }); + }); + describe('Validate response ', function() { + it('Validate bid response : valid bid response', function() { + let bResponse = spec.interpretResponse(bannerResponse, request); + expect(bResponse).to.be.an('array').with.length.above(0); + expect(bResponse[0].requestId).to.equal(bannerResponse.body.seatbid[0].bid[0].impid); + expect(bResponse[0].width).to.equal(bannerResponse.body.seatbid[0].bid[0].w); + expect(bResponse[0].height).to.equal(bannerResponse.body.seatbid[0].bid[0].h); + expect(bResponse[0].currency).to.equal('USD'); + expect(bResponse[0].netRevenue).to.equal(false); + expect(bResponse[0].mediaType).to.equal('banner'); + expect(bResponse[0].meta.advertiserDomains).to.deep.equal(['audiencelogy.com']); + expect(bResponse[0].ttl).to.equal(300); + expect(bResponse[0].creativeId).to.equal(bannerResponse.body.seatbid[0].bid[0].crid); + expect(bResponse[0].dealId).to.equal(bannerResponse.body.seatbid[0].bid[0].dealId); + }); + it('Invalid bid response check ', function() { + let bRequest = spec.buildRequests(request); + let response = spec.interpretResponse(invalidResponse, bRequest); + expect(response[0].ad).to.equal('invalid response'); + }); + }); + describe('GPP and coppa', function() { + it('Request params check with GPP Consent', function() { + let bidderReq = { + gppConsent: { + gppString: 'gpp-string-test', + applicableSections: [5] + } + }; + let _Request = spec.buildRequests(request, bidderReq); + let data = JSON.parse(_Request.data); + expect(data[0].gpp).to.equal('gpp-string-test'); + expect(data[0].gpp_sid[0]).to.equal(5); + }); + it('Request params check with GPP Consent read from ortb2', function() { + let bidderReq = { + ortb2: { + regs: { + gpp: 'gpp-test-string', + gpp_sid: [5] + } + } + }; + let _Request = spec.buildRequests(request, bidderReq); + let data = JSON.parse(_Request.data); + expect(data[0].gpp).to.equal('gpp-test-string'); + expect(data[0].gpp_sid[0]).to.equal(5); + }); + it(' Bid request should have coppa flag if its true', () => { + let bidderReq = { + ortb2: { + regs: { + coppa: 1 + } + } + }; + let _Request = spec.buildRequests(request, bidderReq); + let data = JSON.parse(_Request.data); + expect(data[0].coppa).to.equal(1); + }); + }); +}); From e93b6b4f0221112d97ea2e612e4e053be0b2e151 Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 21 Jun 2024 17:41:34 +0530 Subject: [PATCH 2/7] removed duplicates --- modules/audiencelogyBidAdapter.js | 72 +++++++++++++++---------------- modules/audiencelogyBidAdapter.md | 4 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js index 4e76ed12470..91dade857d4 100644 --- a/modules/audiencelogyBidAdapter.js +++ b/modules/audiencelogyBidAdapter.js @@ -16,25 +16,21 @@ const ENDPOINT_URL = 'https://rtb.audiencelogy.com/prebid'; function buildRequests(bidRequests, bidderRequest) { const requests = []; let nid = 0; - // Loop through each bid request + // Loop for each bid request bidRequests.forEach(bid => { - // Construct the bid request object + // Create the bid request object const request = { id: generateUUID(), - placementId: bid.params.placement_id, imp: [{ id: bid.bidId, - banner: getBanner(bid), - bidfloor: getFloor(bid) + bidfloor: fetchFloor(bid), + banner: fetchBanner(bid) }], - site: getSite(bidderRequest), - user: buildUser(bid) + placementId: bid.params.placement_id, + site: fetchSite(bidderRequest), + user: setUser(bid) }; - // Get uspConsent from bidderRequest - if (bidderRequest && bidderRequest.uspConsent) { - request.us_privacy = bidderRequest.uspConsent; - } - // Get GPP Consent from bidderRequest + // Fetch GPP Consent from bidderRequest if (bidderRequest?.gppConsent?.gppString) { request.gpp = bidderRequest.gppConsent.gppString; request.gpp_sid = bidderRequest.gppConsent.applicableSections; @@ -42,11 +38,15 @@ function buildRequests(bidRequests, bidderRequest) { request.gpp = bidderRequest.ortb2.regs.gpp; request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; } - // Get coppa compliance from bidderRequest + // Fetch coppa compliance from bidderRequest if (bidderRequest?.ortb2?.regs?.coppa) { request.coppa = 1; } - // Push the constructed bid request to the requests array + // Fetch uspConsent from bidderRequest + if (bidderRequest && bidderRequest.uspConsent) { + request.us_privacy = bidderRequest.uspConsent; + } + // Push the created bid request to the requests array requests.push(request); // Set nid value nid = bid.params.nid; @@ -69,7 +69,7 @@ function interpretResponse(bidResponse, bidRequest) { let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; if (bids) { bids.forEach(bidObj => { - let newBid = formatResponse(bidObj); + let newBid = buildResponse(bidObj); newBid.mediaType = BANNER; resp.push(newBid); }); @@ -80,12 +80,20 @@ function interpretResponse(bidResponse, bidRequest) { } return resp; } -// Function to check if Bid is valid +// Function for checking validity of Bid function isBidRequestValid(bid) { return !!(bid.params.placement_id && bid.params.user_id && bid.params.nid); } -// Function to get banner details -function getBanner(bid) { +// Function to fetch bid_floor +function fetchFloor(bid) { + if (bid.params && bid.params.bid_floor) { + return bid.params.bid_floor; + } else { + return 0; + } +} +// Function to fetch banner details +function fetchBanner(bid) { if (deepAccess(bid, 'mediaTypes.banner')) { // Fetch width and height from MediaTypes object, if not provided in bid params if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { @@ -104,16 +112,8 @@ function getBanner(bid) { } } } -// Function to get bid_floor -function getFloor(bid) { - if (bid.params && bid.params.bid_floor) { - return bid.params.bid_floor; - } else { - return 0; - } -} -// Function to get site details -function getSite(bidderRequest) { +// Function to fetch site details +function fetchSite(bidderRequest) { let site = {}; if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { site.name = bidderRequest.refererInfo.domain; @@ -122,30 +122,30 @@ function getSite(bidderRequest) { } return site; } -// Function to format response -function formatResponse(bid) { +// Function to create response +function buildResponse(bid) { return { requestId: bid && bid.impid ? bid.impid : undefined, - cpm: bid && bid.price ? bid.price : 0.0, width: bid && bid.w ? bid.w : 0, height: bid && bid.h ? bid.h : 0, + cpm: bid && bid.price ? bid.price : 0.0, ad: bid && bid.adm ? bid.adm : '', + creativeId: bid && bid.crid ? bid.crid : undefined, meta: { advertiserDomains: bid && bid.adomain ? bid.adomain : [] }, - creativeId: bid && bid.crid ? bid.crid : undefined, netRevenue: false, currency: bid && bid.cur ? bid.cur : 'USD', - ttl: 300, - dealId: bid && bid.dealId ? bid.dealId : undefined + dealId: bid && bid.dealId ? bid.dealId : undefined, + ttl: 300 }; } // Function to build the user object -function buildUser(bid) { +function setUser(bid) { if (bid && bid.params) { return { - id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', buyeruid: localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '', + id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '', customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : '' }; diff --git a/modules/audiencelogyBidAdapter.md b/modules/audiencelogyBidAdapter.md index ef705270b02..fa24feffa26 100644 --- a/modules/audiencelogyBidAdapter.md +++ b/modules/audiencelogyBidAdapter.md @@ -26,9 +26,9 @@ Module that connects to audiencelogy's demand sources. { bidder: 'audiencelogy', params: { - placement_id: 584, // Required parameter user_id: '1111111' // Required parameter - nid: 1 // Required parameter + nid: 1, // Required parameter + placement_id: 584, // Required parameter width: 160, // Optional parameter height: 600, // Optional parameter domain: '', // Optional parameter From bf55f4171e9cf603a104c815acab56f258d7cb1d Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 21 Jun 2024 20:05:17 +0530 Subject: [PATCH 3/7] removed duplicates --- modules/audiencelogyBidAdapter.js | 210 +++++++++++++++--------------- 1 file changed, 104 insertions(+), 106 deletions(-) diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js index 91dade857d4..5fcd50706c2 100644 --- a/modules/audiencelogyBidAdapter.js +++ b/modules/audiencelogyBidAdapter.js @@ -1,91 +1,98 @@ -import { - registerBidder -} from '../src/adapters/bidderFactory.js'; -import { - BANNER -} from '../src/mediaTypes.js'; import { deepAccess, generateUUID, isArray, logError } from '../src/utils.js'; +import { + BANNER +} from '../src/mediaTypes.js'; +import { + registerBidder +} from '../src/adapters/bidderFactory.js'; + const BIDDER_CODE = 'audiencelogy'; const ENDPOINT_URL = 'https://rtb.audiencelogy.com/prebid'; -function buildRequests(bidRequests, bidderRequest) { - const requests = []; - let nid = 0; - // Loop for each bid request - bidRequests.forEach(bid => { - // Create the bid request object - const request = { - id: generateUUID(), - imp: [{ - id: bid.bidId, - bidfloor: fetchFloor(bid), - banner: fetchBanner(bid) - }], - placementId: bid.params.placement_id, - site: fetchSite(bidderRequest), - user: setUser(bid) +// Export const spec +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: BANNER, + // Determines whether or not the given bid request is valid + isBidRequestValid: function (bid) { + return !!(bid.params.placement_id && bid.params.user_id && bid.params.nid); + }, + // Make a server request from the list of BidRequests + buildRequests: function (bidRequests, bidderRequest) { + const requests = []; + let nid = 0; + // Loop for each bid request + bidRequests.forEach(bid => { + // Create the bid request object + const request = { + id: generateUUID(), + imp: [{ + id: bid.bidId, + bidfloor: fetchFloor(bid), + banner: fetchBanner(bid) + }], + placementId: bid.params.placement_id, + site: fetchSite(bidderRequest), + user: setUser(bid) + }; + // Fetch GPP Consent from bidderRequest + if (bidderRequest?.gppConsent?.gppString) { + request.gpp = bidderRequest.gppConsent.gppString; + request.gpp_sid = bidderRequest.gppConsent.applicableSections; + } else if (bidderRequest?.ortb2?.regs?.gpp) { + request.gpp = bidderRequest.ortb2.regs.gpp; + request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; + } + // Fetch coppa compliance from bidderRequest + if (bidderRequest?.ortb2?.regs?.coppa) { + request.coppa = 1; + } + // Fetch uspConsent from bidderRequest + if (bidderRequest && bidderRequest.uspConsent) { + request.us_privacy = bidderRequest.uspConsent; + } + // Push the created bid request to the requests array + requests.push(request); + // Set nid value + nid = bid.params.nid; + }); + // Return the array of bid requests + return { + method: 'POST', + url: `${ENDPOINT_URL}/${nid}`, + data: JSON.stringify(requests), + options: { + contentType: 'application/json', + } }; - // Fetch GPP Consent from bidderRequest - if (bidderRequest?.gppConsent?.gppString) { - request.gpp = bidderRequest.gppConsent.gppString; - request.gpp_sid = bidderRequest.gppConsent.applicableSections; - } else if (bidderRequest?.ortb2?.regs?.gpp) { - request.gpp = bidderRequest.ortb2.regs.gpp; - request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; - } - // Fetch coppa compliance from bidderRequest - if (bidderRequest?.ortb2?.regs?.coppa) { - request.coppa = 1; - } - // Fetch uspConsent from bidderRequest - if (bidderRequest && bidderRequest.uspConsent) { - request.us_privacy = bidderRequest.uspConsent; - } - // Push the created bid request to the requests array - requests.push(request); - // Set nid value - nid = bid.params.nid; - }); - // Return the array of bid requests - return { - method: 'POST', - url: `${ENDPOINT_URL}/${nid}`, - data: JSON.stringify(requests), - options: { - contentType: 'application/json', - } - }; -} -// Format the response as per the standards -function interpretResponse(bidResponse, bidRequest) { - let resp = []; - if (bidResponse && bidResponse.body) { - try { - let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; - if (bids) { - bids.forEach(bidObj => { - let newBid = buildResponse(bidObj); - newBid.mediaType = BANNER; - resp.push(newBid); - }); + }, + // Unpack the response from the server into a list of bids. + interpretResponse: function (bidResponse, bidRequest) { + let resp = []; + if (bidResponse && bidResponse.body) { + try { + let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; + if (bids) { + bids.forEach(bidObj => { + let newBid = buildResponse(bidObj); + newBid.mediaType = BANNER; + resp.push(newBid); + }); + } + } catch (err) { + logError(err); } - } catch (err) { - logError(err); } + return resp; } - return resp; -} -// Function for checking validity of Bid -function isBidRequestValid(bid) { - return !!(bid.params.placement_id && bid.params.user_id && bid.params.nid); } // Function to fetch bid_floor -function fetchFloor(bid) { +const fetchFloor = (bid) => { if (bid.params && bid.params.bid_floor) { return bid.params.bid_floor; } else { @@ -93,7 +100,7 @@ function fetchFloor(bid) { } } // Function to fetch banner details -function fetchBanner(bid) { +const fetchBanner = (bid) => { if (deepAccess(bid, 'mediaTypes.banner')) { // Fetch width and height from MediaTypes object, if not provided in bid params if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { @@ -113,7 +120,7 @@ function fetchBanner(bid) { } } // Function to fetch site details -function fetchSite(bidderRequest) { +const fetchSite = (bidderRequest) => { let site = {}; if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { site.name = bidderRequest.refererInfo.domain; @@ -123,41 +130,32 @@ function fetchSite(bidderRequest) { return site; } // Function to create response -function buildResponse(bid) { - return { - requestId: bid && bid.impid ? bid.impid : undefined, - width: bid && bid.w ? bid.w : 0, - height: bid && bid.h ? bid.h : 0, - cpm: bid && bid.price ? bid.price : 0.0, - ad: bid && bid.adm ? bid.adm : '', - creativeId: bid && bid.crid ? bid.crid : undefined, - meta: { - advertiserDomains: bid && bid.adomain ? bid.adomain : [] - }, - netRevenue: false, - currency: bid && bid.cur ? bid.cur : 'USD', - dealId: bid && bid.dealId ? bid.dealId : undefined, - ttl: 300 +const buildResponse = (bid) => { + let response = {}; + response.requestId = bid && bid.impid ? bid.impid : undefined; + response.width = bid && bid.w ? bid.w : 0; + response.height = bid && bid.h ? bid.h : 0; + response.cpm = bid && bid.price ? bid.price : 0.0; + response.ad = bid && bid.adm ? bid.adm : ''; + response.creativeId = bid && bid.crid ? bid.crid : undefined; + response.meta = { + advertiserDomains: bid && bid.adomain ? bid.adomain : [] }; + response.netRevenue = false; + response.currency = bid && bid.cur ? bid.cur : 'USD'; + response.dealId = bid && bid.dealId ? bid.dealId : undefined; + response.ttl = 300; + return response; } // Function to build the user object -function setUser(bid) { +const setUser = (bid) => { + let user = {}; if (bid && bid.params) { - return { - buyeruid: localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '', - id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', - keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '', - customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : '' - }; + user.buyeruid = localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : ''; + user.id = bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : ''; + user.keywords = bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : ''; + user.customdata = bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : ''; } + return user; } -// Export const spec -export const spec = { - code: BIDDER_CODE, - supportedMediaTypes: BANNER, - isBidRequestValid, - buildRequests, - interpretResponse -} - registerBidder(spec); From 4e1f22bf2b4a4b6bc3edeb7439bd0d53fc461155 Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 28 Jun 2024 14:29:52 +0530 Subject: [PATCH 4/7] added common code in library libraries/audiencelogyUtils --- libraries/audiencelogyUtils/bidderUtils.js | 72 +++++++++++++++++ modules/audiencelogyBidAdapter.js | 93 ++++------------------ 2 files changed, 88 insertions(+), 77 deletions(-) create mode 100644 libraries/audiencelogyUtils/bidderUtils.js diff --git a/libraries/audiencelogyUtils/bidderUtils.js b/libraries/audiencelogyUtils/bidderUtils.js new file mode 100644 index 00000000000..b886a9e2668 --- /dev/null +++ b/libraries/audiencelogyUtils/bidderUtils.js @@ -0,0 +1,72 @@ +import { + deepAccess, + isArray, + } from '../../src/utils.js'; + + // Function to get banner details + export const getBanner = (bid) => { + if (deepAccess(bid, 'mediaTypes.banner')) { + // Fetch width and height from MediaTypes object, if not provided in bid params + if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { + let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + if (isArray(sizes) && sizes.length > 0) { + return { + h: sizes[0][1], + w: sizes[0][0] + }; + } + } else { + return { + h: bid.params.height, + w: bid.params.width + }; + } + } + } + // Function to get bid_floor + export const getFloor = (bid) => { + if (bid.params && bid.params.bid_floor) { + return bid.params.bid_floor; + } else { + return 0; + } + } + // Function to get site details + export const getSite = (bidderRequest) => { + let site = {}; + if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { + site.name = bidderRequest.refererInfo.domain; + } else { + site.name = ''; + } + return site; + } + // Function to format response + export const formatResponse = (bid) => { + return { + requestId: bid && bid.impid ? bid.impid : undefined, + cpm: bid && bid.price ? bid.price : 0.0, + width: bid && bid.w ? bid.w : 0, + height: bid && bid.h ? bid.h : 0, + ad: bid && bid.adm ? bid.adm : '', + meta: { + advertiserDomains: bid && bid.adomain ? bid.adomain : [] + }, + creativeId: bid && bid.crid ? bid.crid : undefined, + netRevenue: false, + currency: bid && bid.cur ? bid.cur : 'USD', + ttl: 300, + dealId: bid && bid.dealId ? bid.dealId : undefined + }; + } + // Function to build the user object + export const buildUser = (bid) => { + if (bid && bid.params) { + return { + id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', + buyeruid: localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '', + keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '', + customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : '' + }; + } + } \ No newline at end of file diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js index 5fcd50706c2..5f3fdb2946a 100644 --- a/modules/audiencelogyBidAdapter.js +++ b/modules/audiencelogyBidAdapter.js @@ -1,7 +1,5 @@ import { - deepAccess, generateUUID, - isArray, logError } from '../src/utils.js'; import { @@ -10,6 +8,13 @@ import { import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { + getBanner, + getFloor, + getSite, + formatResponse, + buildUser +} from '../libraries/audiencelogyUtils/bidderUtils.js'; const BIDDER_CODE = 'audiencelogy'; const ENDPOINT_URL = 'https://rtb.audiencelogy.com/prebid'; @@ -33,14 +38,14 @@ export const spec = { id: generateUUID(), imp: [{ id: bid.bidId, - bidfloor: fetchFloor(bid), - banner: fetchBanner(bid) + bidfloor: getFloor(bid), + banner: getBanner(bid) }], placementId: bid.params.placement_id, - site: fetchSite(bidderRequest), - user: setUser(bid) + site: getSite(bidderRequest), + user: buildUser(bid) }; - // Fetch GPP Consent from bidderRequest + // Get GPP Consent from bidderRequest if (bidderRequest?.gppConsent?.gppString) { request.gpp = bidderRequest.gppConsent.gppString; request.gpp_sid = bidderRequest.gppConsent.applicableSections; @@ -48,11 +53,11 @@ export const spec = { request.gpp = bidderRequest.ortb2.regs.gpp; request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; } - // Fetch coppa compliance from bidderRequest + // Get coppa compliance from bidderRequest if (bidderRequest?.ortb2?.regs?.coppa) { request.coppa = 1; } - // Fetch uspConsent from bidderRequest + // Get uspConsent from bidderRequest if (bidderRequest && bidderRequest.uspConsent) { request.us_privacy = bidderRequest.uspConsent; } @@ -79,7 +84,7 @@ export const spec = { let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; if (bids) { bids.forEach(bidObj => { - let newBid = buildResponse(bidObj); + let newBid = formatResponse(bidObj); newBid.mediaType = BANNER; resp.push(newBid); }); @@ -91,71 +96,5 @@ export const spec = { return resp; } } -// Function to fetch bid_floor -const fetchFloor = (bid) => { - if (bid.params && bid.params.bid_floor) { - return bid.params.bid_floor; - } else { - return 0; - } -} -// Function to fetch banner details -const fetchBanner = (bid) => { - if (deepAccess(bid, 'mediaTypes.banner')) { - // Fetch width and height from MediaTypes object, if not provided in bid params - if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { - let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); - if (isArray(sizes) && sizes.length > 0) { - return { - h: sizes[0][1], - w: sizes[0][0] - }; - } - } else { - return { - h: bid.params.height, - w: bid.params.width - }; - } - } -} -// Function to fetch site details -const fetchSite = (bidderRequest) => { - let site = {}; - if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { - site.name = bidderRequest.refererInfo.domain; - } else { - site.name = ''; - } - return site; -} -// Function to create response -const buildResponse = (bid) => { - let response = {}; - response.requestId = bid && bid.impid ? bid.impid : undefined; - response.width = bid && bid.w ? bid.w : 0; - response.height = bid && bid.h ? bid.h : 0; - response.cpm = bid && bid.price ? bid.price : 0.0; - response.ad = bid && bid.adm ? bid.adm : ''; - response.creativeId = bid && bid.crid ? bid.crid : undefined; - response.meta = { - advertiserDomains: bid && bid.adomain ? bid.adomain : [] - }; - response.netRevenue = false; - response.currency = bid && bid.cur ? bid.cur : 'USD'; - response.dealId = bid && bid.dealId ? bid.dealId : undefined; - response.ttl = 300; - return response; -} -// Function to build the user object -const setUser = (bid) => { - let user = {}; - if (bid && bid.params) { - user.buyeruid = localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : ''; - user.id = bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : ''; - user.keywords = bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : ''; - user.customdata = bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : ''; - } - return user; -} + registerBidder(spec); From 8b36ffc94c0608ca2cf96974f5b2d5167033faad Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 28 Jun 2024 14:42:45 +0530 Subject: [PATCH 5/7] solved linter issues --- libraries/audiencelogyUtils/bidderUtils.js | 124 ++++++++++----------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/libraries/audiencelogyUtils/bidderUtils.js b/libraries/audiencelogyUtils/bidderUtils.js index b886a9e2668..7b7c18675cc 100644 --- a/libraries/audiencelogyUtils/bidderUtils.js +++ b/libraries/audiencelogyUtils/bidderUtils.js @@ -1,72 +1,72 @@ import { deepAccess, isArray, - } from '../../src/utils.js'; - - // Function to get banner details - export const getBanner = (bid) => { - if (deepAccess(bid, 'mediaTypes.banner')) { - // Fetch width and height from MediaTypes object, if not provided in bid params - if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { - let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); - if (isArray(sizes) && sizes.length > 0) { - return { - h: sizes[0][1], - w: sizes[0][0] - }; - } - } else { +} from '../../src/utils.js'; + +// Function to get banner details +export const getBanner = (bid) => { + if (deepAccess(bid, 'mediaTypes.banner')) { + // Fetch width and height from MediaTypes object, if not provided in bid params + if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { + let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + if (isArray(sizes) && sizes.length > 0) { return { - h: bid.params.height, - w: bid.params.width + h: sizes[0][1], + w: sizes[0][0] }; } - } - } - // Function to get bid_floor - export const getFloor = (bid) => { - if (bid.params && bid.params.bid_floor) { - return bid.params.bid_floor; - } else { - return 0; - } - } - // Function to get site details - export const getSite = (bidderRequest) => { - let site = {}; - if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { - site.name = bidderRequest.refererInfo.domain; } else { - site.name = ''; - } - return site; - } - // Function to format response - export const formatResponse = (bid) => { - return { - requestId: bid && bid.impid ? bid.impid : undefined, - cpm: bid && bid.price ? bid.price : 0.0, - width: bid && bid.w ? bid.w : 0, - height: bid && bid.h ? bid.h : 0, - ad: bid && bid.adm ? bid.adm : '', - meta: { - advertiserDomains: bid && bid.adomain ? bid.adomain : [] - }, - creativeId: bid && bid.crid ? bid.crid : undefined, - netRevenue: false, - currency: bid && bid.cur ? bid.cur : 'USD', - ttl: 300, - dealId: bid && bid.dealId ? bid.dealId : undefined - }; - } - // Function to build the user object - export const buildUser = (bid) => { - if (bid && bid.params) { return { - id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '', - buyeruid: localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '', - keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '', - customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : '' + h: bid.params.height, + w: bid.params.width }; } - } \ No newline at end of file + } +} +// Function to get bid_floor +export const getFloor = (bid) => { + if (bid.params && bid.params.bid_floor) { + return bid.params.bid_floor; + } else { + return 0; + } +} +// Function to get site details +export const getSite = (bidderRequest) => { + let site = {}; + if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { + site.name = bidderRequest.refererInfo.domain; + } else { + site.name = ''; + } + return site; +} +// Function to format response +export const formatResponse = (bid) => { + let response = {}; + response.requestId = bid && bid.impid ? bid.impid : undefined; + response.cpm = bid && bid.price ? bid.price : 0.0; + response.width = bid && bid.w ? bid.w : 0; + response.height = bid && bid.h ? bid.h : 0; + response.ad = bid && bid.adm ? bid.adm : ''; + response.meta = { + advertiserDomains: bid && bid.adomain ? bid.adomain : [] + }; + response.creativeId = bid && bid.crid ? bid.crid : undefined; + response.netRevenue = false; + response.currency = bid && bid.cur ? bid.cur : 'USD'; + response.ttl = 300; + response.dealId = bid && bid.dealId ? bid.dealId : undefined; + return response; +} +// Function to build the user object +export const buildUser = (bid) => { + let user = {}; + if (bid && bid.params) { + user.id = bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : ''; + user.buyeruid = localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : ''; + user.keywords = bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : ''; + user.customdata = bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : ''; + } + return user; +} From ea88fbe00d0cea88812f9e7526082feb3ebc2653 Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 28 Jun 2024 15:27:39 +0530 Subject: [PATCH 6/7] imported getRequest from library and solved linting issue --- libraries/audiencelogyUtils/bidderUtils.js | 46 ++++++++++++++++++---- modules/audiencelogyBidAdapter.js | 36 ++--------------- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/libraries/audiencelogyUtils/bidderUtils.js b/libraries/audiencelogyUtils/bidderUtils.js index 7b7c18675cc..12dc7a9fd0c 100644 --- a/libraries/audiencelogyUtils/bidderUtils.js +++ b/libraries/audiencelogyUtils/bidderUtils.js @@ -1,10 +1,42 @@ import { - deepAccess, - isArray, + deepAccess, + generateUUID, + isArray, } from '../../src/utils.js'; - + +// Function to get Request +export const getRequest = (bid, bidderRequest) => { + let request = { + id: generateUUID(), + imp: [{ + id: bid.bidId, + bidfloor: getFloor(bid), + banner: getBanner(bid) + }], + placementId: bid.params.placement_id, + site: getSite(bidderRequest), + user: buildUser(bid) + }; + // Get GPP Consent from bidderRequest + if (bidderRequest?.gppConsent?.gppString) { + request.gpp = bidderRequest.gppConsent.gppString; + request.gpp_sid = bidderRequest.gppConsent.applicableSections; + } else if (bidderRequest?.ortb2?.regs?.gpp) { + request.gpp = bidderRequest.ortb2.regs.gpp; + request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; + } + // Get coppa compliance from bidderRequest + if (bidderRequest?.ortb2?.regs?.coppa) { + request.coppa = 1; + } + // Get uspConsent from bidderRequest + if (bidderRequest && bidderRequest.uspConsent) { + request.us_privacy = bidderRequest.uspConsent; + } + return request; +} // Function to get banner details -export const getBanner = (bid) => { +const getBanner = (bid) => { if (deepAccess(bid, 'mediaTypes.banner')) { // Fetch width and height from MediaTypes object, if not provided in bid params if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { @@ -24,7 +56,7 @@ export const getBanner = (bid) => { } } // Function to get bid_floor -export const getFloor = (bid) => { +const getFloor = (bid) => { if (bid.params && bid.params.bid_floor) { return bid.params.bid_floor; } else { @@ -32,7 +64,7 @@ export const getFloor = (bid) => { } } // Function to get site details -export const getSite = (bidderRequest) => { +const getSite = (bidderRequest) => { let site = {}; if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) { site.name = bidderRequest.refererInfo.domain; @@ -60,7 +92,7 @@ export const formatResponse = (bid) => { return response; } // Function to build the user object -export const buildUser = (bid) => { +const buildUser = (bid) => { let user = {}; if (bid && bid.params) { user.id = bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : ''; diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js index 5f3fdb2946a..37459eba430 100644 --- a/modules/audiencelogyBidAdapter.js +++ b/modules/audiencelogyBidAdapter.js @@ -1,5 +1,4 @@ import { - generateUUID, logError } from '../src/utils.js'; import { @@ -9,11 +8,8 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { - getBanner, - getFloor, - getSite, + getRequest, formatResponse, - buildUser } from '../libraries/audiencelogyUtils/bidderUtils.js'; const BIDDER_CODE = 'audiencelogy'; @@ -33,34 +29,8 @@ export const spec = { let nid = 0; // Loop for each bid request bidRequests.forEach(bid => { - // Create the bid request object - const request = { - id: generateUUID(), - imp: [{ - id: bid.bidId, - bidfloor: getFloor(bid), - banner: getBanner(bid) - }], - placementId: bid.params.placement_id, - site: getSite(bidderRequest), - user: buildUser(bid) - }; - // Get GPP Consent from bidderRequest - if (bidderRequest?.gppConsent?.gppString) { - request.gpp = bidderRequest.gppConsent.gppString; - request.gpp_sid = bidderRequest.gppConsent.applicableSections; - } else if (bidderRequest?.ortb2?.regs?.gpp) { - request.gpp = bidderRequest.ortb2.regs.gpp; - request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; - } - // Get coppa compliance from bidderRequest - if (bidderRequest?.ortb2?.regs?.coppa) { - request.coppa = 1; - } - // Get uspConsent from bidderRequest - if (bidderRequest && bidderRequest.uspConsent) { - request.us_privacy = bidderRequest.uspConsent; - } + // Get the bid request object + const request = getRequest(bid,bidderRequest); // Push the created bid request to the requests array requests.push(request); // Set nid value From 529a38d33cbe4efa470bc7d4103f44610b83b6c8 Mon Sep 17 00:00:00 2001 From: Deepak Hasani Date: Fri, 28 Jun 2024 15:33:05 +0530 Subject: [PATCH 7/7] solved trailing space issue --- libraries/audiencelogyUtils/bidderUtils.js | 2 +- modules/audiencelogyBidAdapter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/audiencelogyUtils/bidderUtils.js b/libraries/audiencelogyUtils/bidderUtils.js index 12dc7a9fd0c..338427803c6 100644 --- a/libraries/audiencelogyUtils/bidderUtils.js +++ b/libraries/audiencelogyUtils/bidderUtils.js @@ -3,7 +3,7 @@ import { generateUUID, isArray, } from '../../src/utils.js'; - + // Function to get Request export const getRequest = (bid, bidderRequest) => { let request = { diff --git a/modules/audiencelogyBidAdapter.js b/modules/audiencelogyBidAdapter.js index 37459eba430..d1c5794c316 100644 --- a/modules/audiencelogyBidAdapter.js +++ b/modules/audiencelogyBidAdapter.js @@ -30,7 +30,7 @@ export const spec = { // Loop for each bid request bidRequests.forEach(bid => { // Get the bid request object - const request = getRequest(bid,bidderRequest); + const request = getRequest(bid, bidderRequest); // Push the created bid request to the requests array requests.push(request); // Set nid value