Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(onboarding): add explicit telemetry for onboarding resource links (#8774)
Andrew Huang379295f07983
diff --git a/frontend/src/components/auth/AuthPageLayout.tsx b/frontend/src/components/auth/AuthPageLayout.tsxindex a545e104ac..ee9670abd5 100644--- a/frontend/src/components/auth/AuthPageLayout.tsx+++ b/frontend/src/components/auth/AuthPageLayout.tsx@@ -19,6 +19,7 @@ type Props = {children: ReactNode;contentClassName?: string;headerAction?: ReactNode;+ onDocumentationClick?: () => void;showFooter?: boolean;variant?: "focused" | "split";};@@ -30,6 +31,7 @@ export const AuthPageLayout = ({children,contentClassName,headerAction,+ onDocumentationClick,showFooter = true,variant = "split"}: Props) => {@@ -82,7 +84,12 @@ export const AuthPageLayout = ({<AuthPageBackground /><div className="relative z-10 flex h-16 items-center justify-end px-8 xl:px-12"><Button asChild variant="outline" size="sm">- <a href="https://infisical.com/docs" target="_blank" rel="noopener noreferrer">+ <a+ href="https://infisical.com/docs"+ target="_blank"+ rel="noopener noreferrer"+ onClick={onDocumentationClick}+ ><BookOpen />Documentation</a>diff --git a/frontend/src/components/auth/SignupCompleteStep.tsx b/frontend/src/components/auth/SignupCompleteStep.tsxindex f525d46934..c760d18268 100644--- a/frontend/src/components/auth/SignupCompleteStep.tsx+++ b/frontend/src/components/auth/SignupCompleteStep.tsx@@ -15,6 +15,7 @@ import { cn } from "@app/components/v3/utils";import { getProjectHomePage } from "@app/helpers/project";import { submitSignupOnboarding } from "@app/hooks/api/auth/queries";import { Project, ProjectType } from "@app/hooks/api/projects/types";+import { analytics, AnalyticsEvent, OnboardingResource } from "@app/lib/analytics";import { AuthPagePanel } from "./AuthPagePanel";import { SIGNUP_PRODUCTS, SignupProductType } from "./signupProducts";@@ -33,22 +34,26 @@ const COMMUNITY_LINKS: {label: string;isNew?: boolean;href: string;+ resource: OnboardingResource;icon: React.ComponentType<{ className?: string; "aria-hidden"?: boolean | "true" | "false" }>;}[] = [{label: "29k+ Stars",href: "https://github.com/Infisical/infisical",+ resource: "github",icon: SiGithub},{label: "Discussions",isNew: true,href: "https://community.infisical.com/latest",+ resource: "discussions",icon: Users},{label: "50+ Videos",href: "https://www.youtube.com/@infisical_os",+ resource: "youtube",icon: SiYoutube}];@@ -147,7 +152,18 @@ export default function SignupCompleteStep({<div className="flex flex-wrap gap-2">{COMMUNITY_LINKS.map((link) => (<Button key={link.label} asChild variant="outline" size="sm">- <a href={link.href} target="_blank" rel="noopener noreferrer">+ <a+ href={link.href}+ target="_blank"+ rel="noopener noreferrer"+ onClick={() =>+ analytics.captureForOrganization(+ AnalyticsEvent.OnboardingResourceClicked,+ orgId,+ { resource: link.resource }+ )+ }+ ><link.icon aria-hidden />{link.label}{link.isNew && (diff --git a/frontend/src/lib/analytics/events.ts b/frontend/src/lib/analytics/events.tsindex f7434549ec..fa634a182e 100644--- a/frontend/src/lib/analytics/events.ts+++ b/frontend/src/lib/analytics/events.ts@@ -15,7 +15,9 @@ export const AnalyticsEvent = {SecretsAddResourceActionSelected: "Secrets Add Resource Action Selected",ThemePreferenceChanged: "Theme Preference Changed",SignupFlowCompleted: "Signup Flow Completed",- BillingCancellationReasonSubmitted: "Billing Cancellation Reason Submitted"+ BillingCancellationReasonSubmitted: "Billing Cancellation Reason Submitted",+ OnboardingResourceClicked: "Onboarding Resource Clicked",+ OnboardingDocumentationClicked: "Onboarding Documentation Clicked"} as const;export type OverviewCountBucket = "0" | "1" | "2-5" | "6-20" | "21-100" | "101+";@@ -186,6 +188,12 @@ type BillingCancellationReasonSubmittedProperties = {comment?: string;};+export type OnboardingResource = "github" | "discussions" | "youtube";++export type OnboardingResourceClickedProperties = {+ resource: OnboardingResource;+};+export type OrganizationAnalyticsEventMap = {[AnalyticsEvent.SecretsActivationModalViewed]: SecretsActivationProperties;[AnalyticsEvent.SecretsActivationModalMembersInvited]: SecretsActivationProperties & {@@ -208,6 +216,7 @@ export type OrganizationAnalyticsEventMap = {[AnalyticsEvent.SecretsAddResourceMenuOpened]: SecretsAddResourceMenuOpenedProperties;[AnalyticsEvent.SecretsAddResourceActionSelected]: SecretsAddResourceActionSelectedProperties;[AnalyticsEvent.BillingCancellationReasonSubmitted]: BillingCancellationReasonSubmittedProperties;+ [AnalyticsEvent.OnboardingResourceClicked]: OnboardingResourceClickedProperties;};export type OrganizationAnalyticsEvent = keyof OrganizationAnalyticsEventMap;diff --git a/frontend/src/lib/analytics/index.ts b/frontend/src/lib/analytics/index.tsindex 113d452e46..b327552087 100644--- a/frontend/src/lib/analytics/index.ts+++ b/frontend/src/lib/analytics/index.ts@@ -17,6 +17,10 @@ export const analytics = {const telemetry = new Telemetry().getInstance();telemetry.capture(AnalyticsEvent.SignupFlowCompleted, properties);},+ captureOnboardingDocumentationClicked() {+ const telemetry = new Telemetry().getInstance();+ telemetry.capture(AnalyticsEvent.OnboardingDocumentationClicked);+ },captureForOrganization<Event extends OrganizationAnalyticsEvent>(event: Event,orgId: string,@@ -35,6 +39,7 @@ export { AnalyticsEvent };export type {BillingCancellationAction,FolderAccessGrantSheetSource,+ OnboardingResource,SecretsAddResourceAction,SecretsAddResourceMenuLevel,SecretsAddResourceMenuSourcediff --git a/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx b/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsxindex 36dc143338..316d8fff46 100644--- a/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx+++ b/frontend/src/pages/organization/SignupOnboardingPage/SignupOnboardingPage.tsx@@ -22,6 +22,7 @@ import { useSelectOrganization } from "@app/hooks/api/auth/queries";import { fetchOrganizations } from "@app/hooks/api/organization/queries";import { Project, ProjectType } from "@app/hooks/api/projects/types";import { useFetchServerStatus } from "@app/hooks/api/serverDetails";+import { analytics } from "@app/lib/analytics";enum OnboardingSection {Loading = "loading",@@ -194,6 +195,7 @@ export const SignupOnboardingPage = () => {variant={isWorkspaceSetup ? "focused" : "split"}contentClassName={isWorkspaceSetup ? "max-w-3xl" : undefined}bottomContent={section === OnboardingSection.OrgName ? <AuthTermsNotice /> : undefined}+ onDocumentationClick={analytics.captureOnboardingDocumentationClicked}><Helmet><title>{t("common.head-title", { title: t("signup.title") })}</title>