diff --git a/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx b/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx index 17ae86e567..3639f78006 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx @@ -8,6 +8,7 @@ import { addMockDatasourceToOrg } from "actions/datasourceActions"; import { getCurrentOrgId } from "selectors/organizationSelectors"; import { getQueryParams } from "../../../utils/AppsmithUtils"; import { AppState } from "../../../reducers"; +import AnalyticsUtil from "../../../utils/AnalyticsUtil"; const MockDataSourceWrapper = styled.div` overflow: auto; @@ -105,6 +106,10 @@ function MockDatasourceCard(props: MockDatasourceCardProps) { } const addMockDataSource = () => { + AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", { + mockDatasourceName: datasource.name, + plugin: currentPlugin, + }); const queryParams = getQueryParams(); dispatch( addMockDatasourceToOrg( diff --git a/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx b/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx index 84a5697db4..45104a9d83 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx @@ -173,6 +173,9 @@ function NewApiScreen(props: Props) { AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_AUTH_API_CLICK", { pluginId: authApiPlugin.id, }); + AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", { + plugin: authApiPlugin, + }); props.createDatasourceFromForm({ pluginId: authApiPlugin.id, }); @@ -180,6 +183,9 @@ function NewApiScreen(props: Props) { }, [authApiPlugin, props.createDatasourceFromForm]); const handleCreateNew = () => { + AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", { + source: "CREATE_NEW_API", + }); if (pageId) { createNewApiAction(pageId, "API_PANE"); } @@ -211,6 +217,9 @@ function NewApiScreen(props: Props) { AnalyticsUtil.logEvent("IMPORT_API_CLICK", { importSource: CURL, }); + AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", { + source: CURL, + }); delete queryParams.isGeneratePageMode; const curlImportURL = @@ -289,11 +298,14 @@ function NewApiScreen(props: Props) { + onClick={() => { + AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", { + plugin: p, + }); handleOnClick(API_ACTION.CREATE_DATASOURCE_FORM, { pluginId: p.id, - }) - } + }); + }} >
diff --git a/app/client/src/pages/Editor/PropertyPane/ConnectDataCTA.tsx b/app/client/src/pages/Editor/PropertyPane/ConnectDataCTA.tsx index 6d05d02a88..56b0a6cf87 100644 --- a/app/client/src/pages/Editor/PropertyPane/ConnectDataCTA.tsx +++ b/app/client/src/pages/Editor/PropertyPane/ConnectDataCTA.tsx @@ -19,7 +19,7 @@ import { } from "actions/globalSearchActions"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { getTypographyByKey } from "constants/DefaultTheme"; -import { WidgetTypes } from "constants/WidgetConstants"; +import { WidgetType, WidgetTypes } from "constants/WidgetConstants"; const StyledDiv = styled.div` color: ${(props) => props.theme.colors.propertyPane.ctaTextColor}; @@ -63,7 +63,13 @@ export const excludeList = [ export const actionsExist = (state: AppState): boolean => !!state.entities.actions.length; -function ConnectDataCTA() { +type ConnectDataCTAProps = { + widgetTitle: string; + widgetId?: string; + widgetType?: WidgetType; +}; + +function ConnectDataCTA(props: ConnectDataCTAProps) { const applicationId = useSelector(getCurrentApplicationId); const pageId = useSelector(getCurrentPageId); const dispatch = useDispatch(); @@ -77,15 +83,20 @@ function ConnectDataCTA() { }, []); const onClick = () => { + const { widgetId, widgetTitle, widgetType } = props; history.push( INTEGRATION_EDITOR_URL( applicationId, pageId, INTEGRATION_TABS.NEW, - INTEGRATION_EDITOR_MODES.MOCK, + INTEGRATION_EDITOR_MODES.AUTO, ), ); - AnalyticsUtil.logEvent("CONNECT_DATA_CLICK"); + AnalyticsUtil.logEvent("CONNECT_DATA_CLICK", { + widgetTitle, + widgetId, + widgetType, + }); }; return ( diff --git a/app/client/src/pages/Editor/PropertyPane/index.tsx b/app/client/src/pages/Editor/PropertyPane/index.tsx index 14844eb294..5279c4b65a 100644 --- a/app/client/src/pages/Editor/PropertyPane/index.tsx +++ b/app/client/src/pages/Editor/PropertyPane/index.tsx @@ -184,7 +184,13 @@ function PropertyPaneView( widgetType={widgetProperties?.type} /> - {!doActionsExist && !hideConnectDataCTA && } + {!doActionsExist && !hideConnectDataCTA && ( + + )}