From edb1f72708a24b96d04ada0278a433e21f3ecbcc Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Tue, 23 Nov 2021 16:56:31 +0300 Subject: [PATCH] feat: reassign custom dimensions (#44252) * feat: reassign custom dimentions * Apply suggestions from code review Co-authored-by: Shaun Hamilton Co-authored-by: Shaun Hamilton --- client/src/redux/ga-saga.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/client/src/redux/ga-saga.js b/client/src/redux/ga-saga.js index 578dde4fb4..2e422e45e3 100644 --- a/client/src/redux/ga-saga.js +++ b/client/src/redux/ga-saga.js @@ -24,13 +24,18 @@ function* callGaType({ payload: { type, data } }) { const completedChallengeTotal = yield select(completedChallengesSelector); const completedChallengeSession = yield select(completionCountSelector); const customDimensions = { - Test_Variation: emailToABVariant(email).isAVariant ? 'A' : 'B', - Test_Type: aBTestConfig.type, - Challenges_Completed_Session: completedChallengeSession, - Challenges_Completed_Total: completedChallengeTotal.length, - URL: window.location.href + // URL; + dimension1: window.location.href, + // Challenges_Completed_Session + dimension2: completedChallengeSession, + // Challenges_Completed_Total + dimension3: completedChallengeTotal.length, + // Test_Type + dimension4: aBTestConfig.type, + // Test_Variation + dimension5: emailToABVariant(email).isAVariant ? 'A' : 'B' }; - data = { ...data, ...customDimensions }; + ga.set(customDimensions); } }