pass trending_algorithm to ga

This commit is contained in:
Sean Yesmunt 2020-03-12 12:36:45 -04:00
parent 1984ee585f
commit bb1c12b050
2 changed files with 16 additions and 1 deletions

View file

@ -202,6 +202,9 @@ const analytics: Analytics = {
openUrlEvent: (url: string) => {
sendGaEvent('Engagement', 'Open-Url', url);
},
trendingAlgorithmEvent: (trendingAlgorithm: string) => {
sendGaEvent('Engagement', 'Trending-Algorithm', trendingAlgorithm);
},
startupEvent: () => {
sendGaEvent('Startup', 'Startup');
},

View file

@ -329,7 +329,19 @@ export function doDaemonReady() {
// TODO: call doFetchDaemonSettings, then get usage data, and call doAuthenticate once they are loaded into the store
const shareUsageData = window.localStorage.getItem(SHARE_INTERNAL) === 'true' || IS_WEB;
dispatch(doAuthenticate(appVersion, undefined, undefined, shareUsageData));
dispatch(
doAuthenticate(appVersion, undefined, undefined, shareUsageData, status => {
const trendingAlgorithm =
status &&
status.wallet &&
status.wallet.connected_features &&
status.wallet.connected_features.trending_algorithm;
if (trendingAlgorithm) {
analytics.trendingAlgorithmEvent(trendingAlgorithm);
}
})
);
dispatch({ type: ACTIONS.DAEMON_READY });
// @if TARGET='app'