From 73fbd90c31e209e6c49c8360dfa79397f51fe105 Mon Sep 17 00:00:00 2001 From: Andrius Versockas Date: Tue, 1 Oct 2024 11:08:20 +0300 Subject: [PATCH] Eskimi Bid Adapter: support string placementId, adjust user-sync processing logic --- modules/eskimiBidAdapter.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/eskimiBidAdapter.js b/modules/eskimiBidAdapter.js index dd3f634462d..6e8eb52166f 100644 --- a/modules/eskimiBidAdapter.js +++ b/modules/eskimiBidAdapter.js @@ -47,7 +47,6 @@ const REGION_SUBDOMAIN_SUFFIX = { export const spec = { code: BIDDER_CODE, - aliases: ['eskimi'], gvlid: GVLID, supportedMediaTypes: [BANNER, VIDEO], isBidRequestValid, @@ -120,7 +119,7 @@ function isBidRequestValid(bidRequest) { } function isPlacementIdValid(bidRequest) { - return utils.isNumber(bidRequest.params.placementId); + return !!parseInt(bidRequest.params.placementId); } function isValidBannerRequest(bidRequest) { @@ -215,7 +214,7 @@ function createRequest(bidRequests, bidderRequest, mediaType) { const bid = bidRequests.find((b) => b.params.placementId) if (!data.site) data.site = {} - data.site.ext = {placementId: bid.params.placementId} + data.site.ext = {placementId: parseInt(bid.params.placementId)} if (bidderRequest.gdprConsent) { if (!data.user) data.user = {}; @@ -255,31 +254,32 @@ function isBannerBid(bid) { * @return {{type: (string), url: (*|string)}[]} */ function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent, gppConsent) { - if ((syncOptions.iframeEnabled || syncOptions.pixelEnabled) && hasSyncConsent(gdprConsent, uspConsent, gppConsent)) { + if ((syncOptions.iframeEnabled || syncOptions.pixelEnabled)) { let pixelType = syncOptions.iframeEnabled ? 'iframe' : 'image'; let query = []; let syncUrl = getUserSyncUrlByRegion(); - // Attaching GDPR Consent Params in UserSync url + // GDPR Consent Params in UserSync url if (gdprConsent) { query.push('gdpr=' + (gdprConsent.gdprApplies & 1)); query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString || '')); } - // CCPA + // US Privacy Consent if (uspConsent) { query.push('us_privacy=' + encodeURIComponent(uspConsent)); } - // GPP Consent + // Global Privacy Platform Consent if (gppConsent?.gppString && gppConsent?.applicableSections?.length) { query.push('gpp=' + encodeURIComponent(gppConsent.gppString)); query.push('gpp_sid=' + encodeURIComponent(gppConsent.applicableSections.join(','))); } return [{ type: pixelType, - url: `${syncUrl}${query.length > 0 ? '?' + query.join('&') : ''}` + url: `${syncUrl}${query.length > 0 ? '&' + query.join('&') : ''}` }]; } } +// eslint-disable-next-line no-unused-vars function hasSyncConsent(gdprConsent, uspConsent, gppConsent) { return hasPurpose1Consent(gdprConsent) && hasUspConsent(uspConsent) && hasGppConsent(gppConsent); }