From 0aa6664d35f056c17d58b88dfc77fabc01165166 Mon Sep 17 00:00:00 2001 From: Manan Date: Thu, 5 Sep 2024 17:13:44 +0530 Subject: [PATCH 1/9] OnBidResponse listener added to add pixel for deals matching to the user deals stored in local storage --- modules/symitriDapRtdProvider.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/symitriDapRtdProvider.js b/modules/symitriDapRtdProvider.js index aed583cbdfa..399ad403a18 100644 --- a/modules/symitriDapRtdProvider.js +++ b/modules/symitriDapRtdProvider.js @@ -151,13 +151,30 @@ export function createRtdProvider(moduleName, moduleCode, headerPrefix) { return true; } + function onBidResponse(bidResponse, config, userConsent) { + if(bidResponse.dealId && typeof (bidResponse.dealId) != typeof (undefined)){ + membership = dapUtils.dapGetMembershipFromLocalStorage(); //Get Membership details from Local Storage + deals = membership.deals; //Get list of Deals the user is mapped to + deals.forEach((deal) => { + deal = JSON.parse(deal); + if(bidResponse.dealId == deal.id){ //Check if the bid response deal Id matches to the deals mapped to the user + let token = dapUtils.dapGetTokenFromLocalStorage(); + let url = "https://" + config.params.apiHostname + '/data-activation/' + config.params.apiVersion + '/token/' + token + '/impression?deal_id=' + bidResponse.dealId; + bidResponse.ad = `${bidResponse.ad}