Skip to content

Commit

Permalink
fix: add onboarding complete event (SigNoz#4140)
Browse files Browse the repository at this point in the history
  • Loading branch information
YounixM authored Dec 1, 2023
1 parent 0b99133 commit a20693f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ROUTES from 'constants/routes';
import { stepsMap } from 'container/OnboardingContainer/constants/stepsConfig';
import { DataSourceType } from 'container/OnboardingContainer/Steps/DataSource/DataSource';
import { hasFrameworks } from 'container/OnboardingContainer/utils/dataSourceUtils';
import useAnalytics from 'hooks/analytics/useAnalytics';
import history from 'lib/history';
import { isEmpty } from 'lodash-es';
import { useState } from 'react';
Expand Down Expand Up @@ -71,6 +72,7 @@ export default function ModuleStepsContainer({

const [current, setCurrent] = useState(0);
const [metaData, setMetaData] = useState<MetaDataProps[]>(defaultMetaData);
const { trackEvent } = useAnalytics();
const lastStepIndex = selectedModuleSteps.length - 1;

const isValidForm = (): boolean => {
Expand Down Expand Up @@ -126,6 +128,10 @@ export default function ModuleStepsContainer({
};

const redirectToModules = (): void => {
trackEvent('Onboarding Complete', {
module: selectedModule.id,
});

if (selectedModule.id === ModulesMap.APM) {
history.push(ROUTES.APPLICATION);
} else if (selectedModule.id === ModulesMap.LogsManagement) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</script>

<script type="text/javascript">
//Set your SEGMENT_ID
//Set your CLARITY_PROJECT_ID
const CLARITY_PROJECT_ID =
'<%= htmlWebpackPlugin.options.CLARITY_PROJECT_ID %>';
Expand Down

0 comments on commit a20693f

Please sign in to comment.