The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add va.track
Steven Teye179ccfb2d28
diff --git a/apps/web/app/api/ai/completion/route.ts b/apps/web/app/api/ai/completion/route.tsindex baa22d0209..4e54dea38b 100644--- a/apps/web/app/api/ai/completion/route.ts+++ b/apps/web/app/api/ai/completion/route.ts@@ -34,8 +34,6 @@ export async function POST(req: NextRequest) {model = "claude-3-sonnet-20240229",} = await req.json();- console.log({ model });-const response = await anthropic.messages.create({messages: [{diff --git a/apps/web/ui/layout/help/portal.tsx b/apps/web/ui/layout/help/portal.tsxindex d22e8cc572..65c7d5983a 100644--- a/apps/web/ui/layout/help/portal.tsx+++ b/apps/web/ui/layout/help/portal.tsx@@ -2,6 +2,7 @@import { Popover, useResizeObserver } from "@dub/ui";import { fetcher } from "@dub/utils";+import va from "@vercel/analytics";import { AnimatePresence, motion } from "framer-motion";import { XIcon } from "lucide-react";import { useSession } from "next-auth/react";@@ -43,7 +44,12 @@ export function HelpButton({><buttontype="button"- onClick={() => setIsOpen((o) => !o)}+ onClick={() => {+ if (!isOpen) {+ va.track("Open help portal");+ }+ setIsOpen((o) => !o);+ }}className="font-lg relative h-12 w-12 overflow-hidden rounded-full border border-gray-200 bg-white shadow-md active:bg-gray-50"><AnimatePresence>diff --git a/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx b/apps/web/ui/modals/add-edit-link-modal/tags-section.tsxindex 26eb6694c0..60d9b7aad7 100644--- a/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx+++ b/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx@@ -9,6 +9,7 @@ import {SimpleTooltipContent,Tooltip,} from "@dub/ui";+import va from "@vercel/analytics";import { useCompletion } from "ai/react";import { Command, useCommandState } from "cmdk";import { Check, ChevronDown, Tag, X } from "lucide-react";@@ -78,7 +79,7 @@ export default function TagsSection({- Meta title: ${title}- Meta description: ${description}.- Only return the tag names, and nothing else. If there are no relevant tags, return an empty string.+ Only return the tag names in comma-separated format, and nothing else. If there are no relevant tags, return an empty string.Available tags: ${availableTags.map(({ name }) => name).join(", ")}`,);@@ -276,6 +277,9 @@ export default function TagsSection({setSuggestedTags((tags) =>tags.filter(({ id }) => id !== tag.id),);+ va.track("Selected AI-suggested tag", {+ metadata: `Tag: ${tag.name} | URL: ${url}`,+ });}}className="group flex items-center transition-all active:scale-95">