Skip to content

Commit 710edf5

Browse files
PubMatic Analytics Adapter: Preserve original mediaTypes and sizes when copying bid details in analytics (prebid#13888)
* Targetting key set for floor applied from PM RTD module * Test Cases Added * UPR related changes * Minor changes * Added targeting keys in constants * UOE-12412: Added floorProvider = "PM" related check to set the targeting * UOE-12412: Removed modelVersion related check * UOE-12412: Changed Key Name for targeting * UOE-12412: Enabling and disabling targetting key based on adServertargeting coming from config * UOE-12412: RTD provider error handling for undefined configs * Refactor: Improve bid status handling and floor value detection for No Bids scenario in PubMatic RTD provider * Refactor: Extract bid targeting logic into separate functions * Refactor: Improve pubmatic RTD provider targeting logic and add test coverage * Enhance PubMatic RTD floor calculation with multi-size support and targeting precision * UOE-12413: Changed adServerTargeting to pmTargetingKeys * Enhance multiplier handling in pubmatic RTD provider * PubM RTD Module: Update pubmatic RTD provider with enhanced targeting logic and test coverage * PubM RTD Module: Multipliers fallback mechanism implemented and test cases edited * Code changes optimisation * Test case optimized * Test cases: add unit tests for multiplier extraction in pubmatic RTD provider * refactor: reorder multiplier sources in pubmaticRtdProvider to prioritize config.json over floor.json * Fix: update NOBID multiplier from 1.6 to 1.2 in pubmaticRtdProvider module * Refactor: enhance floor value calculation for multi-format ad units and improve logging * Refactor: Add getBidder function and remove unused findWinningBid import in PubMatic RTD provider tests * chore: remove unused pubmaticRtd example and noconfig files * PubMatic RTD module markdown file update having targetingKey details * Fix: Removed extra whitespace and normalize line endings in RTD provider * fix: add colon to RTD targeting log message in pubmaticRtdProvider * Preserve original mediaTypes and sizes when copying bid details in analytics in case of marketplace scenario * UOE-13066: Added mediaTypes and dimensions to raw request of tracker in case of marketplace scenario * Lint Issue: Remove unnecessary whitespace in pubmatic analytics bid handling --------- Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
1 parent 2616a9f commit 710edf5

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

modules/pubmaticAnalyticsAdapter.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ function sendAjaxRequest({ endpoint, method, queryParams = '', body = null }) {
9393
return ajax(url, null, body, { method });
9494
};
9595

96-
function copyRequiredBidDetails(bid) {
96+
function copyRequiredBidDetails(bid, bidRequest) {
97+
// First check if bid has mediaTypes/sizes, otherwise fallback to bidRequest
9798
return pick(bid, [
9899
'bidder',
99100
'bidderCode',
@@ -424,6 +425,15 @@ const eventHandlers = {
424425
if (bid.params) {
425426
args.params = bid.params;
426427
}
428+
if (bid.adUnit) {
429+
// Specifically check for mediaTypes and dimensions
430+
if (!args.mediaTypes && bid.adUnit.mediaTypes) {
431+
args.mediaTypes = bid.adUnit.mediaTypes;
432+
}
433+
if (!args.sizes && bid.adUnit.dimensions) {
434+
args.sizes = bid.adUnit.dimensions;
435+
}
436+
}
427437
bid = copyRequiredBidDetails(args);
428438
cache.auctions[args.auctionId].adUnitCodes[args.adUnitCode].bids[requestId].push(bid);
429439
} else if (args.originalRequestId) {

0 commit comments

Comments
 (0)