Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fern/products/docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ navigation:
- page: Mixpanel
path: ./pages/integrations/analytics/mixpanel.mdx
slug: analytics/mixpanel
- page: Analytics events reference
path: ./pages/integrations/analytics/analytics-events.mdx
slug: analytics/events
- page: Postman
path: ./pages/integrations/postman.mdx
- page: Context7
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Analytics events reference
description: Complete reference of the analytics events Fern emits on your documentation site, including page views, feedback, API Playground, search, and error tracking events.
---

Fern automatically emits analytics events on your documentation site. If you have [PostHog](/learn/docs/integrations/analytics/posthog) configured, these events are forwarded to your PostHog instance alongside Fern's internal tracking. Events are also forwarded to any other [analytics provider](/learn/docs/integrations/overview) you configure (GA4, Segment, FullStory, etc.) where supported.

## Page views

| Event | Description |
| --- | --- |
| `$pageview` | Fired on every route change. Includes the current URL. |
| `$pageleave` | Fired when a user navigates away from a page. Captured automatically by PostHog. |

Page view tracking is automatic and requires no additional configuration.

## Feedback events

These events are emitted by the [on-page feedback](/learn/docs/customization/user-feedback) widget and the Ask Fern feedback component.

| Event | Description | Key properties |
| --- | --- | --- |
| `feedback_voted` | User clicked the thumbs up or thumbs down button. | `satisfied` (boolean), `feedbackQuestion` or `type` |
| `feedback_submitted` | User submitted written feedback after voting. | `satisfied` (boolean), `feedback` (text ID) |
| `code_block_feedback_opened` | User opened the feedback prompt on a code block. | Code block context |
| `code_block_feedback_submitted` | User submitted feedback on a code block. | Code block context |

## API playground events

These events track usage of the [API Explorer](/learn/docs/api-references/api-explorer).

| Event | Description | Key properties |
| --- | --- | --- |
| `api_playground_request_sent` | User sent a request from the API Explorer. | `endpointId`, `endpointName` |
| `api_playground_request_received` | A response was received in the API Explorer. | `endpointId`, `endpointName`, response status |

## Search and AI events

These events track [search](/learn/docs/customization/search) and [Ask Fern](/learn/docs/ai-features/ask-fern/overview) usage.

| Event | Description | Key properties |
| --- | --- | --- |
| `ask_ai_suggest` | An Ask Fern suggestion was generated. | Query context |

## Error events

These events help identify broken pages and missing content.

| Event | Description | Key properties |
| --- | --- | --- |
| `not_found` | A visitor hit a 404 page. | `pathname`, `url` |

## Disabling analytics

To disable all analytics events, set `disable-analytics: true` in your [site-level settings](/learn/docs/configuration/site-level-settings#settingsdisable-analytics):

```yaml docs.yml
settings:
disable-analytics: true
```

This disables all analytics integrations configured in the `analytics` section of `docs.yml`, including Google Analytics 4, Google Tag Manager, PostHog, and any other providers.

## CLI and dashboard events

The Fern CLI and [Dashboard](https://dashboard.buildwithfern.com) emit their own analytics events for internal product telemetry (command usage, onboarding funnels, billing events, etc.). These are not forwarded to your analytics providers and are used only by Fern for product improvement.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'aren't' instead of 'are not'.


CLI telemetry can be disabled by setting the `FERN_TELEMETRY_DISABLED` environment variable or adding `telemetry.enabled: false` to `~/.fernrc`.
2 changes: 2 additions & 0 deletions fern/products/docs/pages/integrations/analytics/posthog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ Integrate PostHog to track user behavior and analytics in your documentation, in

</Step>
</Steps>

For a full list of events Fern emits to your PostHog instance, see the [analytics events reference](/learn/docs/integrations/analytics/events).
2 changes: 2 additions & 0 deletions fern/products/docs/pages/integrations/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ description: Connect analytics and support tools to your Fern documentation. Set

</CardGroup>

For a complete list of events Fern emits on your docs site, see the [analytics events reference](/learn/docs/integrations/analytics/events).

## Enable analytics

You can define your analytics configuration in `docs.yml`. You only need to include entries for the platforms you want to connect.
Expand Down
Loading