feat: reassign custom dimensions (#44252)

* feat: reassign custom dimentions

* Apply suggestions from code review

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Ahmad Abdolsaheb
2021-11-23 16:56:31 +03:00
committed by GitHub
parent ecd6a73e2b
commit edb1f72708

View File

@ -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);
}
}