added tracking for me call and signup / login (#758)

Co-authored-by: Nikhil Nandagopal <nikhil@appsmith.com>
This commit is contained in:
Nikhil Nandagopal 2020-09-28 11:59:41 +05:30 committed by GitHub
parent 0991595b25
commit a8001d0356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 0 deletions

View File

@ -46,6 +46,9 @@ import Menu from "components/ads/Menu";
import { Position } from "@blueprintjs/core/lib/esm/common/position"; import { Position } from "@blueprintjs/core/lib/esm/common/position";
import HelpModal from "components/designSystems/appsmith/help/HelpModal"; import HelpModal from "components/designSystems/appsmith/help/HelpModal";
import { UpdateApplicationPayload } from "api/ApplicationApi"; import { UpdateApplicationPayload } from "api/ApplicationApi";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
const OrgDropDown = styled.div` const OrgDropDown = styled.div`
display: flex; display: flex;
@ -487,6 +490,8 @@ class Applications extends Component<
} }
componentDidMount() { componentDidMount() {
PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK);
PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP);
this.props.getAllApplication(); this.props.getAllApplication();
} }
public render() { public render() {

View File

@ -1,6 +1,9 @@
import React from "react"; import React from "react";
import PageLoadingBar from "pages/common/PageLoadingBar"; import PageLoadingBar from "pages/common/PageLoadingBar";
import { retryPromise } from "utils/AppsmithUtils"; import { retryPromise } from "utils/AppsmithUtils";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
class ApplicationListLoader extends React.PureComponent<any, { Page: any }> { class ApplicationListLoader extends React.PureComponent<any, { Page: any }> {
constructor(props: any) { constructor(props: any) {
@ -12,6 +15,8 @@ class ApplicationListLoader extends React.PureComponent<any, { Page: any }> {
} }
componentDidMount() { componentDidMount() {
PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP);
PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK);
retryPromise(() => retryPromise(() =>
import(/* webpackChunkName: "applications" */ "./index"), import(/* webpackChunkName: "applications" */ "./index"),
).then(module => { ).then(module => {

View File

@ -48,6 +48,9 @@ import AnalyticsUtil from "utils/AnalyticsUtil";
import { getAppsmithConfigs } from "configs"; import { getAppsmithConfigs } from "configs";
import { TncPPLinks } from "./SignUp"; import { TncPPLinks } from "./SignUp";
import { LOGIN_SUBMIT_PATH } from "constants/ApiConstants"; import { LOGIN_SUBMIT_PATH } from "constants/ApiConstants";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
const { enableGithubOAuth, enableGoogleOAuth } = getAppsmithConfigs(); const { enableGithubOAuth, enableGoogleOAuth } = getAppsmithConfigs();
const validate = (values: LoginFormValues) => { const validate = (values: LoginFormValues) => {
@ -151,6 +154,9 @@ export const Login = (props: LoginFormProps) => {
filled filled
size="large" size="large"
onClick={() => { onClick={() => {
PerformanceTracker.startTracking(
PerformanceTransactionName.LOGIN_CLICK,
);
AnalyticsUtil.logEvent("LOGIN_CLICK", { AnalyticsUtil.logEvent("LOGIN_CLICK", {
loginMethod: "EMAIL", loginMethod: "EMAIL",
}); });

View File

@ -50,6 +50,9 @@ import { getAppsmithConfigs } from "configs";
import { SIGNUP_SUBMIT_PATH } from "constants/ApiConstants"; import { SIGNUP_SUBMIT_PATH } from "constants/ApiConstants";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { AppState } from "reducers"; import { AppState } from "reducers";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
const { const {
enableGithubOAuth, enableGithubOAuth,
enableGoogleOAuth, enableGoogleOAuth,
@ -153,6 +156,9 @@ export const SignUp = (props: SignUpFormProps) => {
AnalyticsUtil.logEvent("SIGNUP_CLICK", { AnalyticsUtil.logEvent("SIGNUP_CLICK", {
signupMethod: "EMAIL", signupMethod: "EMAIL",
}); });
PerformanceTracker.startTracking(
PerformanceTransactionName.SIGN_UP,
);
}} }}
/> />
</FormActions> </FormActions>

View File

@ -7,6 +7,9 @@ import {
import { IntentColors, getBorderCSSShorthand } from "constants/DefaultTheme"; import { IntentColors, getBorderCSSShorthand } from "constants/DefaultTheme";
import AnalyticsUtil, { EventName } from "utils/AnalyticsUtil"; import AnalyticsUtil, { EventName } from "utils/AnalyticsUtil";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
const ThirdPartyAuthWrapper = styled.div` const ThirdPartyAuthWrapper = styled.div`
display: flex; display: flex;
@ -84,6 +87,12 @@ const SocialLoginButton = (props: {
if (props.type === "SIGNUP") { if (props.type === "SIGNUP") {
eventName = "SIGNUP_CLICK"; eventName = "SIGNUP_CLICK";
} }
PerformanceTracker.startTracking(
eventName === "SIGNUP_CLICK"
? PerformanceTransactionName.SIGN_UP
: PerformanceTransactionName.LOGIN_CLICK,
{ name: props.name.toUpperCase() },
);
AnalyticsUtil.logEvent(eventName, { AnalyticsUtil.logEvent(eventName, {
loginMethod: props.name.toUpperCase(), loginMethod: props.name.toUpperCase(),
}); });

View File

@ -33,6 +33,9 @@ import {
} from "actions/userActions"; } from "actions/userActions";
import AnalyticsUtil from "utils/AnalyticsUtil"; import AnalyticsUtil from "utils/AnalyticsUtil";
import { INVITE_USERS_TO_ORG_FORM } from "constants/forms"; import { INVITE_USERS_TO_ORG_FORM } from "constants/forms";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
export function* createUserSaga( export function* createUserSaga(
action: ReduxActionWithPromise<CreateUserRequest>, action: ReduxActionWithPromise<CreateUserRequest>,
@ -74,6 +77,9 @@ export function* createUserSaga(
export function* getCurrentUserSaga() { export function* getCurrentUserSaga() {
try { try {
PerformanceTracker.startAsyncTracking(
PerformanceTransactionName.USER_ME_API,
);
const response: ApiResponse = yield call(UserApi.getCurrentUser); const response: ApiResponse = yield call(UserApi.getCurrentUser);
const isValidResponse = yield validateResponse(response); const isValidResponse = yield validateResponse(response);
@ -90,8 +96,15 @@ export function* getCurrentUserSaga() {
type: ReduxActionTypes.FETCH_USER_DETAILS_SUCCESS, type: ReduxActionTypes.FETCH_USER_DETAILS_SUCCESS,
payload: response.data, payload: response.data,
}); });
PerformanceTracker.stopAsyncTracking(
PerformanceTransactionName.USER_ME_API,
);
} }
} catch (error) { } catch (error) {
PerformanceTracker.stopAsyncTracking(
PerformanceTransactionName.USER_ME_API,
{ failed: true },
);
yield put({ yield put({
type: ReduxActionErrorTypes.FETCH_USER_DETAILS_ERROR, type: ReduxActionErrorTypes.FETCH_USER_DETAILS_ERROR,
payload: { payload: {

View File

@ -34,6 +34,9 @@ export enum PerformanceTransactionName {
UPDATE_ACTION_API = "UPDATE_ACTION_API", UPDATE_ACTION_API = "UPDATE_ACTION_API",
OPEN_PROPERTY_PANE = "OPEN_PROPERTY_PANE", OPEN_PROPERTY_PANE = "OPEN_PROPERTY_PANE",
REFACTOR_ACTION_NAME = "REFACTOR_ACTION_NAME", REFACTOR_ACTION_NAME = "REFACTOR_ACTION_NAME",
USER_ME_API = "USER_ME_API",
SIGN_UP = "SIGN_UP",
LOGIN_CLICK = "LOGIN_CLICK",
} }
export enum PerformanceTagNames { export enum PerformanceTagNames {