Skip to content
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,72 @@
---
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 emits analytics events on every documentation site. These events are always sent to Fern's internal [PostHog](https://posthog.com/) instance for product analytics. When you [configure analytics providers](/learn/docs/integrations/overview) in `docs.yml`, Fern also forwards events to your providers — but not every provider receives every event. The **Forwarded to** column in the tables below shows which customer-configured providers receive each event.

<Note>
[FullStory](/learn/docs/integrations/analytics/fullstory) and [Intercom](/learn/docs/integrations/support/intercom) provide session recording and live chat respectively. They don't receive the named events listed below.
</Note>

## Page views

| Event | Description | Forwarded to |
| --- | --- | --- |
| `$pageview` | Fired on every route change. Includes the current URL. | PostHog, Segment |
| `$pageleave` | Fired when a user navigates away from a page. | PostHog |

Page view tracking is automatic and requires no additional configuration. GA4 and GTM handle their own page view tracking natively when configured.
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.


## 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 | Forwarded to |
| --- | --- | --- |
| `feedback_voted` | User clicked the thumbs up or thumbs down button. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.

| `feedback_submitted` | User submitted written feedback after voting. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.

| `code_block_feedback_opened` | User opened the feedback prompt on a code block. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.

| `code_block_feedback_submitted` | User submitted feedback on a code block. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.


## API playground events

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

| Event | Description | Forwarded to |
| --- | --- | --- |
| `api_playground_request_sent` | User sent a request from the API Explorer. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.

| `api_playground_request_received` | A response was received in the API Explorer. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.


## 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 | Forwarded to |
| --- | --- | --- |
| `ask_ai_suggest` | An Ask Fern suggestion was generated. | None (Fern internal only) |

## Error events

These events help identify broken pages and missing content.

| Event | Description | Forwarded to |
| --- | --- | --- |
| `not_found` | A visitor hit a 404 page. | PostHog, GA4, GTM |
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 🐶
[FernStyles.Acronyms] 'GTM' has no definition.


## 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 aren't forwarded to your analytics providers and are used only by Fern for product improvement.

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 forwards 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