From c0ac6305b355f6c02426d401d48aa28c4c5a0051 Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Thu, 16 Nov 2023 15:26:10 +0530 Subject: [PATCH] fix: edited distinct id logic --- src/v0/destinations/mp/transform.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index ac1209194e..9e80be68cd 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -234,6 +234,11 @@ const createSetOnceResponse = (message, type, destination, setOnce) => { $token: destination.Config.token, $distinct_id: message.userId || message.anonymousId, }; + + if (destination?.Config.identityMergeApi === 'simplified') { + payload.$distinct_id = message.userId || `$device:${message.anonymousId}`; + } + return responseBuilderSimple(payload, message, type, destination.Config); };