diff --git a/app/_components/integration-card.tsx b/app/_components/integration-card.tsx index 4e758eddc..b87e6cad1 100644 --- a/app/_components/integration-card.tsx +++ b/app/_components/integration-card.tsx @@ -2,6 +2,7 @@ import { Card, CardContent } from "@arcadeai/design-system"; import { cn } from "@arcadeai/design-system/lib/utils"; import type { LucideIcon } from "lucide-react"; +import { usePostHog } from "posthog-js/react"; type IntegrationCardProps = { id: string; @@ -13,12 +14,24 @@ type IntegrationCardProps = { }; export function IntegrationCard({ + id, icon: Icon, title, description, isActive = false, onClick, }: IntegrationCardProps) { + const posthog = usePostHog(); + + const handleClick = () => { + posthog?.capture("integration_card_clicked", { + integration_id: id, + integration_title: title, + is_active: isActive, + }); + onClick(); + }; + return (
{ process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://us.i.posthog.com", ui_host: process.env.NEXT_PUBLIC_POSTHOG_UI_HOST || "https://us.posthog.com", - disable_session_recording: true, + // Enable session recording for user behavior analysis + disable_session_recording: false, + session_recording: { + maskAllInputs: true, // Privacy: mask sensitive input fields + blockClass: "ph-no-capture", // Allow opting out specific elements + recordCrossOriginIframes: false, // Don't record third-party iframes + }, + // Enable heatmaps for click tracking + enable_heatmaps: true, + // Enable surveys for CSAT feedback + disable_surveys: false, loaded: (posthogInstance) => { - if ( - process.env.NODE_ENV === "development" || - process.env.NEXT_PUBLIC_POSTHOG_DEBUG - ) { + if (process.env.NEXT_PUBLIC_POSTHOG_DEBUG === "true") { posthogInstance.debug(); } }, diff --git a/app/_components/quick-start-card.tsx b/app/_components/quick-start-card.tsx index 38b7b0056..f172444a7 100644 --- a/app/_components/quick-start-card.tsx +++ b/app/_components/quick-start-card.tsx @@ -7,6 +7,7 @@ import { } from "@arcadeai/design-system"; import { motion } from "motion/react"; import Link from "next/link"; +import { usePostHog } from "posthog-js/react"; type QuickStartCardProps = { icon: React.ElementType; @@ -25,6 +26,16 @@ export function QuickStartCard({ onClick, code, }: QuickStartCardProps) { + const posthog = usePostHog(); + + const handleCardClick = () => { + posthog?.capture("quickstart_card_clicked", { + card_title: title, + card_href: href || null, + has_custom_onclick: !!onClick, + }); + }; + const content = ( <> @@ -48,12 +59,17 @@ export function QuickStartCard({ ); + const handleClick = () => { + handleCardClick(); + onClick?.(); + }; + let wrapper: React.ReactElement | null = null; if (onClick) { wrapper = ( ) : ( - {cardContent} + + {cardContent} + )} {isComingSoon && (