Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

tracking tutorial complete event

ali-inkcodbe479008e7d
diff --git a/packages/app/src/react/features/agents/hooks/useAgentsPageTutorial.ts b/packages/app/src/react/features/agents/hooks/useAgentsPageTutorial.ts
index 1d14805d..af04f846 100644
--- a/packages/app/src/react/features/agents/hooks/useAgentsPageTutorial.ts
+++ b/packages/app/src/react/features/agents/hooks/useAgentsPageTutorial.ts
@@ -1,4 +1,5 @@
import { useAuthCtx } from '@react/shared/contexts/auth.context';
+import { Analytics } from '@src/shared/posthog/services/analytics';
import { useEffect } from 'react';
type UseAgentsPageTutorialOptions = {
@@ -53,6 +54,13 @@ export function useAgentsPageTutorial(options: UseAgentsPageTutorialOptions = {}
popoverElements.popoverTitle.innerText = `${popoverElements.popoverTitle.innerText} (${home_page_onboarding.currentStep + 1}/${home_page_onboarding.getSteps().length})`;
}, 0);
},
+ onReset: () => {
+ // Called when overlay is about to be cleared
+ Analytics.track('home_page_tutorial_completed', {
+ page_url: '/agents',
+ source: 'Tutorial completed on home page onboarding'
+ });
+ },
animate: true,
showButtons: true,
nextBtnText: 'Next',
diff --git a/packages/app/src/shared/posthog/services/analytics.ts b/packages/app/src/shared/posthog/services/analytics.ts
index a19c811e..4e192514 100644
--- a/packages/app/src/shared/posthog/services/analytics.ts
+++ b/packages/app/src/shared/posthog/services/analytics.ts
@@ -1,10 +1,19 @@
import { PostHog } from '@src/shared/posthog';
+import { isProdEnv } from '@src/shared/utils';
export const Analytics = {
- track: (eventName: string, properties: {} = {}) => {
+ track: (eventName: string, properties: Record<string, any> = {}) => {
try {
// so any error doesn't break the app
- PostHog.track(eventName, properties);
+ const enhancedProperties = { ...properties };
+
+ // Add isProd if not already present to differentiate between prod and dev events
+ if (!('isProd' in enhancedProperties)) {
+ enhancedProperties.isProd = isProdEnv();
+ }
+
+ PostHog.track(eventName, enhancedProperties);
+
} catch (error) {
console.info('Error tracking event', error);
}