chore(client): add view_type meta to analytics (#44999)
This commit is contained in:
@ -5,7 +5,8 @@ import ga from '../analytics';
|
|||||||
import {
|
import {
|
||||||
emailSelector,
|
emailSelector,
|
||||||
completionCountSelector,
|
completionCountSelector,
|
||||||
completedChallengesSelector
|
completedChallengesSelector,
|
||||||
|
recentlyClaimedBlockSelector
|
||||||
} from '../redux';
|
} from '../redux';
|
||||||
import { emailToABVariant } from '../utils/A-B-tester';
|
import { emailToABVariant } from '../utils/A-B-tester';
|
||||||
|
|
||||||
@ -21,6 +22,14 @@ function* callGaType({ payload: { type, data } }) {
|
|||||||
if (email) {
|
if (email) {
|
||||||
const completedChallengeTotal = yield select(completedChallengesSelector);
|
const completedChallengeTotal = yield select(completedChallengesSelector);
|
||||||
const completedChallengeSession = yield select(completionCountSelector);
|
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 = {
|
const customDimensions = {
|
||||||
// URL;
|
// URL;
|
||||||
dimension1: window.location.href,
|
dimension1: window.location.href,
|
||||||
@ -31,7 +40,9 @@ function* callGaType({ payload: { type, data } }) {
|
|||||||
// Test_Type
|
// Test_Type
|
||||||
dimension4: aBTestConfig.type,
|
dimension4: aBTestConfig.type,
|
||||||
// Test_Variation
|
// Test_Variation
|
||||||
dimension5: emailToABVariant(email).isAVariant ? 'A' : 'B'
|
dimension5: emailToABVariant(email).isAVariant ? 'A' : 'B',
|
||||||
|
// View_Type
|
||||||
|
dimension6: viewType
|
||||||
};
|
};
|
||||||
ga.set(customDimensions);
|
ga.set(customDimensions);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user