Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add link & domain write events

Steven Tey75e91c3238eb
diff --git a/apps/web/ui/modals/add-edit-domain-modal/index.tsx b/apps/web/ui/modals/add-edit-domain-modal/index.tsx
index 948f95b547..fdf81e6dc5 100644
--- a/apps/web/ui/modals/add-edit-domain-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-domain-modal/index.tsx
@@ -19,6 +19,7 @@ import { FADE_IN_ANIMATION_SETTINGS, capitalize } from "@dub/utils";
import { motion } from "framer-motion";
import { ChevronRight } from "lucide-react";
import { useParams, useRouter } from "next/navigation";
+import posthog from "posthog-js";
import {
Dispatch,
SetStateAction,
@@ -146,6 +147,11 @@ function AddEditDomainModal({
{ revalidate: true },
),
]);
+ const data = await res.json();
+ posthog.capture(
+ props ? "domain_updated" : "domain_created",
+ data,
+ );
setShowAddEditDomainModal(false);
toast.success(endpoint.successMessage);
} else {
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsx
index c25fb674d3..cd245e7b76 100644
--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx
@@ -418,6 +418,10 @@ function AddEditLinkModal({
{ revalidate: true },
);
const data = await res.json();
+ posthog.capture(
+ props ? "link_updated" : "link_created",
+ data,
+ );
// copy shortlink to clipboard when adding a new link
if (!props) {
try {