From 1a17ac493428524a64e5292d7fbc4b32086cb9da Mon Sep 17 00:00:00 2001 From: Robert Raposa Date: Fri, 10 May 2019 14:01:48 -0400 Subject: [PATCH] add analytics event edx.user.settings.viewed --- src/index.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index d760cc0..b46cf61 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,7 +1,13 @@ import 'babel-polyfill'; import React from 'react'; import ReactDOM from 'react-dom'; -import { identifyAuthenticatedUser, sendPageEvent, configureAnalytics, initializeSegment } from '@edx/frontend-analytics'; +import { + configureAnalytics, + identifyAuthenticatedUser, + initializeSegment, + sendPageEvent, + sendTrackingLogEvent, +} from '@edx/frontend-analytics'; import { configureLoggingService, NewRelicLoggingService } from '@edx/frontend-logging'; import { getAuthenticatedAPIClient } from '@edx/frontend-auth'; @@ -62,11 +68,18 @@ apiClient.ensurePublicOrAuthenticationAndCookies( window.location.pathname, () => { const { store, history } = configure(); + const authState = apiClient.getAuthenticationState(); ReactDOM.render(, document.getElementById('root')); identifyAuthenticatedUser(); sendPageEvent(); + + sendTrackingLogEvent('edx.user.settings.viewed', { + page: 'account', + visibility: null, + user_id: authState.authentication && authState.authentication.userId, + }); }, );