Skip to content

Commit

Permalink
add posthog event
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur committed Sep 12, 2024
1 parent e459087 commit c56f1d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ui/docs-bundle/src/utils/getDocsPageProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ async function convertDocsToDocsPageProps({
// however, we should consider rendering a custom 404 page in the future using the customer's branding.
// see: https://nextjs.org/docs/app/api-reference/file-conventions/not-found

try {
const { capturePosthogEvent } = await import("../../../app/src/analytics/posthog");
capturePosthogEvent("broken_link", {
slug,
});
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}

// eslint-disable-next-line no-console
console.error(`Failed to resolve navigation for ${url}`);
if (featureFlags.is404PageHidden && node.redirect != null) {
Expand Down

0 comments on commit c56f1d6

Please sign in to comment.