chore(client): add view_type meta to analytics (#44999)
parent
09d30d2d14
commit
3cee5509e6
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue