Add new nav related analytics (#6125)

Analytics events for the following have been added

- Create new datasource CTA on the property pane
- Run button at the response tab for actions
- Click on associated entity dropdown from the property pane
- Select an associated entity from the associated entity dropdown at the property pane
This commit is contained in:
akash-codemonk 2021-07-26 16:29:15 +05:30 committed by GitHub
parent 667179d5a1
commit 56e29d22f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 13 deletions

View File

@ -212,6 +212,13 @@ function ApiResponseView(props: Props) {
setSelectedIndex(1);
}, []);
const onRunClick = () => {
props.onRunClick();
AnalyticsUtil.logEvent("RESPONSE_TAB_RUN_ACTION_CLICK", {
source: "API_PANE",
});
};
const initialIndex = useSelector(getActionTabsInitialIndex);
const [selectedIndex, setSelectedIndex] = useState(initialIndex);
const messages = response?.messages;
@ -250,7 +257,7 @@ function ApiResponseView(props: Props) {
{EMPTY_RESPONSE_FIRST_HALF()}
<InlineButton
isLoading={isRunning}
onClick={props.onRunClick}
onClick={onRunClick}
size={Size.medium}
tag="button"
text="Run"

View File

@ -76,21 +76,24 @@ function ConnectDataCTA() {
});
}, []);
const onClick = () => {
history.push(
INTEGRATION_EDITOR_URL(
applicationId,
pageId,
INTEGRATION_TABS.NEW,
INTEGRATION_EDITOR_MODES.MOCK,
),
);
AnalyticsUtil.logEvent("CONNECT_DATA_CLICK");
};
return (
<StyledDiv className="t--propertypane-connect-cta">
Data Required
<Button
category={Category.primary}
onClick={() =>
history.push(
INTEGRATION_EDITOR_URL(
applicationId,
pageId,
INTEGRATION_TABS.NEW,
INTEGRATION_EDITOR_MODES.MOCK,
),
)
}
onClick={onClick}
size={Size.large}
text="CONNECT DATA"
/>

View File

@ -26,6 +26,7 @@ import { ENTITY_TYPE } from "entities/DataTree/dataTreeFactory";
import { showDebugger } from "actions/debuggerActions";
import { setActionTabsInitialIndex } from "actions/actionActions";
import { getTypographyByKey } from "constants/DefaultTheme";
import AnalyticsUtil from "utils/AnalyticsUtil";
const CONNECTION_WIDTH = 113;
const CONNECTION_HEIGHT = 28;
@ -321,11 +322,16 @@ const TriggerNode = memo((props: TriggerNodeProps) => {
: `No ${props.connectionType.toLowerCase()} connections`;
const iconColor = props.hasError ? "#f22b2b" : "";
const onClick = () => {
AnalyticsUtil.logEvent("ASSOCIATED_ENTITY_DROPDOWN_CLICK");
};
return (
<SelectedNodeWrapper
className={props.hasError ? "t--connection-error" : "t--connection"}
entityCount={props.entityCount}
hasError={props.hasError}
onClick={onClick}
>
{props.iconAlignment === "LEFT" && (
<Icon

View File

@ -527,6 +527,14 @@ export function EditorJSONtoForm(props: Props) {
);
};
const responeTabOnRunClick = () => {
props.onRunClick();
AnalyticsUtil.logEvent("RESPONSE_TAB_RUN_ACTION_CLICK", {
source: "QUERY_PANE",
});
};
const responseTabs = [
{
key: "Response",
@ -581,7 +589,7 @@ export function EditorJSONtoForm(props: Props) {
🙌 Click on
<InlineButton
isLoading={isRunning}
onClick={props.onRunClick}
onClick={responeTabOnRunClick}
size={Size.medium}
tag="button"
text="Run"

View File

@ -130,7 +130,11 @@ export type EventName =
| "SLASH_COMMAND"
| "DEBUGGER_NEW_ERROR"
| "DEBUGGER_RESOLVED_ERROR"
| "CREATE_DATA_SOURCE_AUTH_API_CLICK";
| "CREATE_DATA_SOURCE_AUTH_API_CLICK"
| "CONNECT_DATA_CLICK"
| "RESPONSE_TAB_RUN_ACTION_CLICK"
| "ASSOCIATED_ENTITY_CLICK"
| "ASSOCIATED_ENTITY_DROPDOWN_CLICK";
function getApplicationId(location: Location) {
const pathSplit = location.pathname.split("/");