diff --git a/client/src/redux/ga-saga.js b/client/src/redux/ga-saga.js index 42c7fa71e8..51fd0b96f0 100644 --- a/client/src/redux/ga-saga.js +++ b/client/src/redux/ga-saga.js @@ -5,7 +5,8 @@ import ga from '../analytics'; import { emailSelector, completionCountSelector, - completedChallengesSelector + completedChallengesSelector, + recentlyClaimedBlockSelector } from '../redux'; import { emailToABVariant } from '../utils/A-B-tester'; @@ -21,6 +22,14 @@ function* callGaType({ payload: { type, data } }) { if (email) { const completedChallengeTotal = yield select(completedChallengesSelector); const completedChallengeSession = yield select(completionCountSelector); + let viewType = null; + + // set the modal type + if (data.action.includes('Modal')) { + const recentlyClaimedBlock = yield select(recentlyClaimedBlockSelector); + viewType = recentlyClaimedBlock ? 'block' : 'progress'; + } + const customDimensions = { // URL; dimension1: window.location.href, @@ -31,7 +40,9 @@ function* callGaType({ payload: { type, data } }) { // Test_Type dimension4: aBTestConfig.type, // Test_Variation - dimension5: emailToABVariant(email).isAVariant ? 'A' : 'B' + dimension5: emailToABVariant(email).isAVariant ? 'A' : 'B', + // View_Type + dimension6: viewType }; ga.set(customDimensions); }