Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: add tracking
Marc Seitzd1d9739cb733
diff --git a/components/datarooms/actions/generate-index-dialog.tsx b/components/datarooms/actions/generate-index-dialog.tsxindex cf8ca4e5..a36a55a8 100644--- a/components/datarooms/actions/generate-index-dialog.tsx+++ b/components/datarooms/actions/generate-index-dialog.tsx@@ -31,6 +31,7 @@ import {} from "@/components/ui/select";import { Separator } from "@/components/ui/separator";+import { useAnalytics } from "@/lib/analytics";import { usePlan } from "@/lib/swr/use-billing";import { useDataroomLinks } from "@/lib/swr/use-dataroom";import { IndexFileFormat } from "@/lib/types/index-file";@@ -48,6 +49,7 @@ export default function GenerateIndexDialog({}: GenerateIndexDialogProps) {const { links } = useDataroomLinks();const { plan, trial } = usePlan();+ const analytics = useAnalytics();const [isLoading, setIsLoading] = useState(false);const [selectedLinkId, setSelectedLinkId] = useState<string>("");@@ -107,6 +109,13 @@ export default function GenerateIndexDialog({window.URL.revokeObjectURL(url);document.body.removeChild(a);+ analytics.capture("Generate Index File", {+ teamId,+ dataroomId,+ linkId: selectedLinkId,+ format: selectedFormat,+ });+toast.success("Index file generated successfully");setIsOpen(false);} catch (error) {