---
title: "Analytics Dashboard and Querying"
description: "The analytics and querying system in Dub provides comprehensive traffic, conversion, and revenue tracking across workspace short links, shared public dashboards, partner program portals, and admini..."
last_updated: "2026-10-05T05:07:35.222511+00:00"
canonical_url: "https://www.doc0.dev/docs/934e554a-e6a1-476f-bb2f-23e62d86c3fd/technical/analytics-and-tracking/analytics-dashboard-and-querying"
---

<details>
<summary>Relevant source files</summary>

The following files were used as context for generating this wiki page:

- [apps/web/app/ee/admin.dub.co/dashboard/payouts/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/payouts/page.tsx)
- [apps/web/app/api/analytics/dashboard/route.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts)
- [apps/web/app/app.dub.co/dashboard/slug/ee/settings/billing/usage-chart.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/settings/billing/usage-chart.tsx)
- [apps/web/app/api/analytics/route.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts)
- [apps/web/app/ee/admin.dub.co/dashboard/commissions/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/commissions/page.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-chart.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-chart.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/program-analytics-shell.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/program-analytics-shell.tsx)
- [apps/web/app/ee/api/program-applications/analytics/route.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/program-applications/analytics/route.ts)
- [apps/web/ui/analytics/location-section.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx)
- [apps/web/app/api/og/analytics/route.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/og/analytics/route.tsx)
- [apps/web/app/ee/admin.dub.co/dashboard/revenue/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/revenue/page.tsx)
- [apps/web/ui/analytics/device-section.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx)
- [apps/web/app/ee/partners.dub.co/dashboard/programs/programSlug/enrolled/earnings/earnings-composite-chart.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/%5BprogramSlug%5D/(enrolled)/earnings/earnings-composite-chart.tsx)
- [apps/web/ui/analytics/toggle.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/toggle.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-filters.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-filters.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/links/analytics/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/links/analytics/page.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-query.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-query.ts)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/page.tsx)
- [apps/web/app/ee/admin.dub.co/dashboard/analytics/page.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/analytics/page.tsx)
- [apps/web/ui/analytics/events/events-tabs.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx)
- [apps/web/app/ee/api/admin/payouts/route.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts)
- [apps/web/ui/analytics/chart-section.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/chart-section.tsx)
- [apps/web/lib/swr/use-partner-earnings-timeseries.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-partner-earnings-timeseries.ts)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-timeseries-chart.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-timeseries-chart.tsx)
- [apps/web/ui/analytics/analytics-provider.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx)
- [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-partners-table.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-partners-table.tsx)
- [apps/web/ui/analytics/partner-segments-section.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx)
- [apps/web/ui/analytics/index.tsx](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx)
- [apps/web/lib/swr/use-api-logs-timeseries.ts](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts)
</details>

## Overview

The analytics and querying system in Dub provides comprehensive traffic, conversion, and revenue tracking across workspace short links, shared public dashboards, partner program portals, and administrative consoles. It addresses the complexity of multi-dimensional event monitoring by combining robust backend REST endpoints with Zod parameter validation, workspace authorization checks, and plan-based date range restrictions.

Sources: [apps/web/app/api/analytics/route.ts:1-139](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts#L1-L139), [apps/web/app/api/analytics/dashboard/route.ts:1-223](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts#L1-L223)

Design decisions prioritize client-side query string synchronization, context-based filter management via SWR data-fetching hooks, and modular visual components ranging from interactive timeseries area charts and conversion funnels to geographic bar lists and device breakdown cards.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/program-analytics-shell.tsx:1-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/program-analytics-shell.tsx#L1-L40), [apps/web/ui/analytics/analytics-provider.tsx:1-313](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L1-L313), [apps/web/ui/analytics/location-section.tsx:1-176](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L1-L176)

By integrating specialized enterprise partner program queries, commission tracking, and application funnels directly alongside standard link analytics, the system offers a unified architecture for monitoring digital performance and monetization metrics.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:1-212](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L1-L212), [apps/web/app/ee/admin.dub.co/dashboard/commissions/page.tsx:1-228](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/commissions/page.tsx#L1-L228)

## Analytics API Endpoints and Security

The analytics system exposes public and internal REST API endpoints designed to ingest query parameters, validate inputs via Zod schemas, enforce workspace-level permissions, and check plan-based date restrictions. Query parameters are parsed and validated using schemas defined in `apps/web/lib/zod/schemas/analytics`, while administrative endpoints enforce role-based access control and invoice filtering.

Sources: [apps/web/app/api/analytics/dashboard/route.ts:1-223](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts#L1-L223), [apps/web/app/api/analytics/route.ts:1-139](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts#L1-L139), [apps/web/app/ee/api/admin/payouts/route.ts:1-123](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L1-L123)

The internal analytics route (`/api/analytics`) executes a strict sequence of validation and authorization checks wrapped by the `withWorkspace` middleware with required permission `analytics.read`.

Sources: [apps/web/app/api/analytics/route.ts:20-138](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts#L20-L138)

1. `throwIfClicksUsageExceeded(workspace)` — Verifies that the workspace has not exceeded its click usage limits.
2. `analyticsPathParamsSchema.parse(params)` — Parses path parameters to extract event and endpoint types, supporting legacy routes.
3. `parseAnalyticsQuery(searchParams)` — Parses URL search parameters into structured query filters.
4. `getDefaultProgramIdOrThrow(workspace)` and `getProgramOrThrow(...)` — Validates program IDs when a partner program filter is applied.
5. `verifyFolderAccess(...)` — Ensures the requesting user possesses `folders.read` permissions for the target folder.
6. `assertValidDateRangeForPlan(...)` — Restricts queried date intervals according to the workspace plan tier.

Sources: [apps/web/app/api/analytics/route.ts:22-109](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts#L22-L109)

> [!WARNING]
> Requests referencing invalid program IDs or exceeding workspace click thresholds trigger a `DubApiError` with status code `forbidden` or `bad_request`, halting execution before query generation.

Sources: [apps/web/app/api/analytics/route.ts:55-60](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/route.ts#L55-L60)

The public dashboard endpoint (`/api/analytics/dashboard`) allows unauthenticated or password-protected viewing of link and folder metrics without requiring workspace membership.

Sources: [apps/web/app/api/analytics/dashboard/route.ts:16-202](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts#L16-L202)

- **Lookup Resolution**: Resolves targets via `folderId` or a combination of `domain` and `key`, checking demo links (`DUB_DEMO_LINKS`) and database entries.
- **Password Protection**: `assertDashboardPassword` verifies cookies matching `dub_password_${dashboard.id}` against stored dashboard passwords.
- **Redis Caching**: Caches successful responses in Upstash Redis for 60 seconds using a key derived from JSON-serialized query parameters (`analyticsDashboardCache:${JSON.stringify(parsedParams)}`). Background writes use Vercel's `waitUntil`.

Sources: [apps/web/app/api/analytics/dashboard/route.ts:44-197](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts#L44-L197), [apps/web/app/api/analytics/dashboard/route.ts:204-222](https://github.com/blade47/dub/blob/HEAD/apps/web/app/api/analytics/dashboard/route.ts#L204-L222)

The enterprise admin payouts route (`/api/admin/payouts`) is protected by `withAdmin` and validates queries using `adminPayoutsQuerySchema`.

Sources: [apps/web/app/ee/api/admin/payouts/route.ts:12-22](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L12-L22)

| Parameter | Type / Schema | Default / Notes | Sources |
| :--- | :--- | :--- | :--- |
| `programId` | `z.string().optional()` | Optional program filter identifier | [apps/web/app/ee/api/admin/payouts/route.ts:14](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L14) |
| `status` | `z.enum(InvoiceStatus).optional()` | Defaults to excluding `failed` status | [apps/web/app/ee/api/admin/payouts/route.ts:15](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L15), [apps/web/app/ee/api/admin/payouts/route.ts:65-67](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L65-L67) |
| `interval` | Analytics schema interval | Defaults to `"mtd"` | [apps/web/app/ee/api/admin/payouts/route.ts:18](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L18), [apps/web/app/ee/api/admin/payouts/route.ts:26](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L26) |
| `page` | Pagination schema | Defaults to page 1 via skip calculation | [apps/web/app/ee/api/admin/payouts/route.ts:20](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L20), [apps/web/app/ee/api/admin/payouts/route.ts:88](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L88) |
| `pageSize` | Pagination schema | Fixed pageSize of 100 | [apps/web/app/ee/api/admin/payouts/route.ts:20](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L20) |

Sources: [apps/web/app/ee/api/admin/payouts/route.ts:12-90](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L12-L90)

> [!NOTE]
> When `programId` is omitted, the admin payouts query automatically excludes internal test constants (`ACME_PROGRAM_ID`, `DEMO_PROGRAM_ID`) and staging slugs ending with `-staging`.

Sources: [apps/web/app/ee/api/admin/payouts/route.ts:43-64](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/admin/payouts/route.ts#L43-L64)

## State Management and Query Hooks

State management and client-side querying across Dub analytics dashboards rely on specialized React hooks, context providers, URL search parameter synchronization, and SWR caching wrappers. These utilities coordinate view selections, filter states for dimensions such as partners, countries, and referral sources, and asynchronous timeseries data fetching.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-filters.tsx:22-235](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-filters.tsx#L22-L235), [apps/web/ui/analytics/analytics-provider.tsx:22-235](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L22-L235)

The `AnalyticsProvider` component initializes dashboard state by reading URL search parameters and persisting user preferences via local storage hooks. It supplies configuration context down the component tree through `AnalyticsContext`.

Sources: [apps/web/ui/analytics/analytics-provider.tsx:56-100](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L56-L100), [apps/web/ui/analytics/analytics-provider.tsx:128-156](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L128-L156)

```typescript
export default function AnalyticsProvider({
  adminPage,
  dashboardProps,
  children,
}: PropsWithChildren<{
  adminPage?: boolean;
  dashboardProps?: AnalyticsDashboardProps;
}>) {
  const searchParams = useSearchParams();
  const { slug: workspaceSlug, plan: workspacePlan, domains } = useWorkspace();
  const [requiresUpgrade, setRequiresUpgrade] = useState(false);
  // ... resolves base paths, query parameters, and SWR total events fetching
}
```

Sources: [apps/web/ui/analytics/analytics-provider.tsx:101-113](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L101-L113)

> [!NOTE]
> The provider automatically detects whether the current view is an admin console, workspace dashboard, partner profile page, or public stats page, dynamically mapping API base paths and event endpoints accordingly.

Sources: [apps/web/ui/analytics/analytics-provider.tsx:158-201](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/analytics-provider.tsx#L158-L201)

Client components synchronize filter states and view modes directly with URL search parameters using helper hooks such as `useApplicationsAnalyticsQuery`, `useApplicationAnalyticsFilters`, and `useApiLogsTimeseries`.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-query.ts:20-37](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-query.ts#L20-L37), [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-filters.tsx:22-235](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-filters.tsx#L22-L235), [apps/web/lib/swr/use-api-logs-timeseries.ts:7-45](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts#L7-L45)

- **`useApplicationsAnalyticsQuery`**: Parses `applicationEvent` parameters into typed application stages (`started`, `submitted`, `approved`, defaulting to `visited`) and `view` parameters into views (`timeseries` or `funnel`).
- **`useApplicationAnalyticsFilters`**: Manages multidimensional filtering across `partnerId`, `country`, and `referralSource`, providing callbacks to select, remove, toggle negative operators (prefixing values with `-`), and clear all active filters while updating the URL via `queryParams`.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-query.ts:9-37](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-query.ts#L9-L37), [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/use-applications-analytics-filters.tsx:20-235](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/use-applications-analytics-filters.tsx#L20-L235)

Data fetching relies on `useSWR` coupled with custom helper hooks that construct query strings and enforce deduplication intervals or keep previous data during transitions.

Sources: [apps/web/lib/swr/use-partner-earnings-timeseries.ts:9-54](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-partner-earnings-timeseries.ts#L9-L54), [apps/web/lib/swr/use-api-logs-timeseries.ts:7-45](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts#L7-L45)

| Hook Name | Target API Route | Key Configuration Options | Sources |
| :--- | :--- | :--- | :--- |
| `usePartnerEarningsTimeseries` | `/api/partner-profile/programs/[programId]/earnings/timeseries` | `dedupingInterval: 60000`, `keepPreviousData: true`, timezone resolution | [apps/web/lib/swr/use-partner-earnings-timeseries.ts:23-47](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-partner-earnings-timeseries.ts#L23-L47) |
| `useApiLogsTimeseries` | `/api/logs/timeseries` | `keepPreviousData: true`, workspace ID check, method/status/route inclusion | [apps/web/lib/swr/use-api-logs-timeseries.ts:32-38](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts#L32-L38) |

Sources: [apps/web/lib/swr/use-partner-earnings-timeseries.ts:23-47](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-partner-earnings-timeseries.ts#L23-L47), [apps/web/lib/swr/use-api-logs-timeseries.ts:32-38](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts#L32-L38)

> [!WARNING]
> When `enabled` evaluates to false or required identifiers like `partnerId` or `workspaceId` are missing, SWR hooks return `null` keys to safely skip fetching until context is fully established.

Sources: [apps/web/lib/swr/use-partner-earnings-timeseries.ts:23-26](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-partner-earnings-timeseries.ts#L23-L26), [apps/web/lib/swr/use-api-logs-timeseries.ts:32-33](https://github.com/blade47/dub/blob/HEAD/apps/web/lib/swr/use-api-logs-timeseries.ts#L32-L33)

## Main Dashboard Shell and Layout

The top-level analytics interface is unified across workspace dashboards, public stats pages, and enterprise admin consoles by wrapping child views in the `Analytics` component and supplying context via `AnalyticsProvider`.

Sources: [apps/web/ui/analytics/index.tsx:4-31](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L4-L31)

The core shell mounts an `AnalyticsProvider` configured with optional `adminPage` and `dashboardProps` flags. Inside its consumer tree, it renders the sticky toolbar header (`AnalyticsToggle`) alongside a responsive grid containing the primary chart and `StatsGrid`.

Sources: [apps/web/ui/analytics/index.tsx:31-48](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L31-L48)

```typescript
export default function Analytics({
  adminPage,
  dashboardProps,
}: {
  adminPage?: boolean;
  dashboardProps?: AnalyticsDashboardProps;
}) {
  return (
    <AnalyticsProvider {...{ adminPage, dashboardProps }}>
      <AnalyticsContext.Consumer>
        {({ dashboardProps }) => {
          return (
            <div
              className={cn("pb-10", dashboardProps && "bg-neutral-50 pt-10")}
            >
              <AnalyticsToggle />
              <div
                className={cn(
                  "mx-auto grid max-w-screen-xl gap-5 px-3 lg:px-10",
                  !dashboardProps && !adminPage && "lg:px-6",
                )}
              >
                <ChartSection />
                <StatsGrid />
              </div>
            </div>
          );
        }}
      </AnalyticsContext.Consumer>
    </AnalyticsProvider>
  );
}
```

Sources: [apps/web/ui/analytics/index.tsx:23-55](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L23-L55)

Within `StatsGrid`, specific conversion tabs (`leads`, `sales`) or funnel views are conditionally hidden for workspaces on `free` or `pro` plans, preventing restricted metric rendering. Otherwise, it organizes top links, referrers, UTMs, locations, and device breakdowns into a responsive two-column grid.

Sources: [apps/web/ui/analytics/index.tsx:57-73](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L57-L73)

| Component / Subview | Containing Shell Condition | Purpose / Layout Role | Sources |
| :--- | :--- | :--- | :--- |
| `WorkspaceAnalytics` | `app.dub.co/(dashboard)/[slug]/links/analytics/page.tsx` | Workspace-scoped view wrapped in `Suspense`, `PageContent`, and `AnalyticsClient`. | [apps/web/app/app.dub.co/dashboard/slug/links/analytics/page.tsx:7-17](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/links/analytics/page.tsx#L7-L17) |
| `AdminAnalytics` | `admin.dub.co/(dashboard)/analytics/page.tsx` | Enterprise admin console view passing the `adminPage` prop to the `Analytics` shell. | [apps/web/app/ee/admin.dub.co/dashboard/analytics/page.tsx:5-13](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/analytics/page.tsx#L5-L13) |
| `TopLinks` | `!dashboardProps?.key` | Renders top performing links when viewing a broader workspace context rather than a single link slug. | [apps/web/ui/analytics/index.tsx:66-67](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L66-L67) |

Sources: [apps/web/app/app.dub.co/dashboard/slug/links/analytics/page.tsx:7-17](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/links/analytics/page.tsx#L7-L17), [apps/web/app/ee/admin.dub.co/dashboard/analytics/page.tsx:5-13](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/analytics/page.tsx#L5-L13), [apps/web/ui/analytics/index.tsx:66-67](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/index.tsx#L66-L67)

The `AnalyticsToggle` component manages sticky positioning rules and computes layout styling based on whether `dashboardProps` or `adminPage` are present. It integrates advanced filtering selectors (`Filter.Select`) and date range pickers (`DateRangePicker`) with preset validations tied to workspace plans.

Sources: [apps/web/ui/analytics/toggle.tsx:40-165](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/toggle.tsx#L40-L165)

```typescript
export function AnalyticsToggle({
  page = "analytics",
}: {
  page?: "analytics" | "events";
}) {
  const { slug, programSlug } = useParams();
  const { plan, createdAt } = useWorkspace();
  const { product } = useCurrentProduct();

  const { queryParams, getQueryString } = useRouterStuff();

  const {
    domain,
    key,
    url,
    adminPage,
    partnerPage,
    dashboardProps,
    start,
    end,
    interval,
  } = useContext(AnalyticsContext);

  const scrolled = useScroll(120);
  const { isMobile } = useMediaQuery();
...
```

Sources: [apps/web/ui/analytics/toggle.tsx:40-66](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/toggle.tsx#L40-L66)

> [!NOTE]
> Sticky positioning on `AnalyticsToggle` dynamically adjusts its top threshold depending on the context: `top-14` when rendering `dashboardProps` and `top-16` when rendering inside `adminPage`.

Sources: [apps/web/ui/analytics/toggle.tsx:173-176](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/toggle.tsx#L173-L176)

## Timeseries and Funnel Chart Visualizations

The chart visualization layer handles rendering for timeseries area charts, conversion funnels, event selection tabs, and tooltip formatting across workspace settings, enterprise program analytics, and general link analytics. The primary components powering this layer include `ChartSection`, `AnalyticsTimeseriesChart`, `AnalyticsChart`, and `EventsTabs`. These components coordinate with `AnalyticsContext` to fetch timeseries metrics from `/api/analytics` and switch between distinct view modes (`timeseries` and `funnel`).

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-chart.tsx:13-33](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-chart.tsx#L13-L33), [apps/web/ui/analytics/chart-section.tsx:26-36](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/chart-section.tsx#L26-L36)

Event tabs let users toggle between tracking categories (`clicks`, `leads`, `sales`), updating URL parameters through `onEventTabClick` and resetting conflicting sort parameters (such as `timestamp` or `saleAmount`) when switching tabs. For sales analytics, a secondary toggle group allows users to switch between sales count (`sales`) and monetary amounts (`saleAmount`), formatting values via `currencyFormatter` or `nFormatter`.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-chart.tsx:92-113](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-chart.tsx#L92-L113), [apps/web/ui/analytics/events/events-tabs.tsx:52-75](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L52-L75)

| Event Category | Default Sort Field | Number Formatting Option | Sources |
| :--- | :--- | :--- | :--- |
| `clicks` | `date` | Standard notation / compact if > 999,999 | [apps/web/ui/analytics/events/events-tabs.tsx:52-55](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L52-L55), [apps/web/ui/analytics/events/events-tabs.tsx:119-126](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L119-L126) |
| `leads` | `date` | Standard notation / compact if > 999,999 | [apps/web/ui/analytics/events/events-tabs.tsx:52-55](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L52-L55), [apps/web/ui/analytics/events/events-tabs.tsx:119-126](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L119-L126) |
| `sales` | `timestamp`, `saleAmount` | Currency (`USD`, strip trailing zeros if integer) | [apps/web/ui/analytics/events/events-tabs.tsx:52-55](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L52-L55), [apps/web/ui/analytics/events/events-tabs.tsx:111-118](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L111-L118) |

Sources: [apps/web/ui/analytics/events/events-tabs.tsx:52-126](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/events/events-tabs.tsx#L52-L126)

The chart container evaluates the current view setting (`timeseries` or `funnel`) alongside workspace plan entitlements (`free`, `pro`, `business`) to determine whether to render the `AnalyticsTimeseriesChart`, `AnalyticsAreaChart`, or `AnalyticsFunnelChart`. When free or pro workspaces attempt to view conversion events or funnel views, a paywall overlay masks the chart component and prompts the user to upgrade.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-chart.tsx:85-91](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-chart.tsx#L85-L91), [apps/web/ui/analytics/chart-section.tsx:69-116](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/chart-section.tsx#L69-L116)

```typescript
const TAB_COLOR: Record<string, string> = {
  clicks: "text-blue-500",
  leads: "text-violet-600",
  sales: "text-teal-400",
};
```

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-timeseries-chart.tsx:7-11](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-timeseries-chart.tsx#L7-L11)

> [!NOTE]
> `AnalyticsTimeseriesChart` uses a composite React `key` built from `start`, `end`, `interval`, `selectedTab`, and `saleUnit` to force clean re-mounting when date filters or metric dimensions change.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-timeseries-chart.tsx:29-31](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-timeseries-chart.tsx#L29-L31)

Interactive tooltips within `AnalyticsTimeseriesChart` pass tooltip date objects to `formatDateTooltip(d.date, { interval, start, end })`. The tooltip content layout renders a categorized breakdown row containing a color-coded indicator square matching the active tab (`text-blue-500`, `text-violet-600`, or `text-teal-400`) and the formatted metric value.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/analytics-timeseries-chart.tsx:40-67](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/analytics-timeseries-chart.tsx#L40-L67)

## Geographic and Device Breakdown Cards

The geographic, device, and partner segment breakdowns within the analytics dashboard are powered by dedicated section components (`LocationSection`, `DeviceSection`, and `PartnerSegmentsSection`) that render multi-tabbed cards encapsulating `BarList` visualizations. Each section retrieves analytics data via `useAnalyticsFilterOption` hooks, sorting items by count or sales value and synchronizing active filters directly to URL search parameters.

Sources: [apps/web/ui/analytics/location-section.tsx:19-32](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L19-L32), [apps/web/ui/analytics/device-section.tsx:14-25](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L14-L25), [apps/web/ui/analytics/partner-segments-section.tsx:56-140](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx#L56-L140)

The `LocationSection` manages four discrete tabs (`countries`, `cities`, `regions`, `continents`), mapping each tab identifier to its corresponding singular endpoint name using `SINGULAR_ANALYTICS_ENDPOINTS`. When rendering rows, it resolves country flags, continent display icons, and region labels—handling region codes ending in `-Unknown` by falling back to country names. Similarly, the `DeviceSection` provides tabs for `devices`, `browsers`, `os`, and `triggers`, utilizing `DeviceIcon` and `TRIGGER_DISPLAY` mappings to render icons and titles.

Sources: [apps/web/ui/analytics/location-section.tsx:1-119](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L1-L119), [apps/web/ui/analytics/device-section.tsx:1-102](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L1-L102)

| Section Component | Supported Tabs / Subtabs | Default Tab | Filter Query Parameter | Sources |
| :--- | :--- | :--- | :--- | :--- |
| `LocationSection` | `countries`, `cities`, `regions`, `continents` | `countries` | `country`, `city`, `region`, `continent` | [apps/web/ui/analytics/location-section.tsx:25-33](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L25-L33), [apps/web/ui/analytics/location-section.tsx:74-79](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L74-L79) |
| `DeviceSection` | `devices`, `browsers`, `os`, `triggers` | `devices` | `device`, `browser`, `os`, `trigger` | [apps/web/ui/analytics/device-section.tsx:20-25](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L20-L25), [apps/web/ui/analytics/device-section.tsx:66-71](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L66-L71) |
| `PartnerSegmentsSection` | `segments` (`groups`, `tags`), `links` (`short_links`, `destination_urls`) | `segments` (`groups`) | `groupId`, `partnerTagId`, `linkId`, `url` | [apps/web/ui/analytics/partner-segments-section.tsx:14-54](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx#L14-L54) |

Sources: [apps/web/ui/analytics/location-section.tsx:25-79](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L25-L79), [apps/web/ui/analytics/device-section.tsx:20-71](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L20-L71), [apps/web/ui/analytics/partner-segments-section.tsx:14-54](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx#L14-L54)

User interactions with individual bar list items invoke toggle and apply handlers that update local selection states and modify URL query strings. The filter execution sequence follows a strict callback chain across components:

`onToggleFilter(val)` → updates local `selectedItems` array → `onApplyFilterValues(values)` → checks if `values.length === 0` to delete the parameter via `queryParams({ del: singularTabName })` or set comma-joined values via `queryParams({ set: { [singularTabName]: values.join(",") } })`.

Sources: [apps/web/ui/analytics/location-section.tsx:41-59](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L41-L59), [apps/web/ui/analytics/device-section.tsx:33-51](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L33-L51)

> [!WARNING]
> Switching between category tabs within `LocationSection`, `DeviceSection`, or `PartnerSegmentsSection` automatically triggers an `useEffect` hook that clears all currently selected filter items (`setSelectedItems([])`), preventing stale filter identifiers from bleeding across different metric dimensions.

Sources: [apps/web/ui/analytics/location-section.tsx:37-39](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/location-section.tsx#L37-L39), [apps/web/ui/analytics/device-section.tsx:29-31](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/device-section.tsx#L29-L31), [apps/web/ui/analytics/partner-segments-section.tsx:73-75](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx#L73-L75)

The `PartnerSegmentsSection` supports hierarchical grouping through two primary tabs (`segments` and `links`) and four nested subtabs (`groups`, `tags`, `short_links`, `destination_urls`). It resolves group color circles via `GroupColorCircle`, partner tags via `Tag`, and destination domains via `LinkLogo` using `getApexDomain`. When workspace link display preferences include title properties, short link rows prioritize rendering the link title over its short link slug.

Sources: [apps/web/ui/analytics/partner-segments-section.tsx:14-168](https://github.com/blade47/dub/blob/HEAD/apps/web/ui/analytics/partner-segments-section.tsx#L14-L168)

## Program Applications and Revenue Analytics

Enterprise partner program analytics cover specialized operations such as tracking application conversion funnels, administering payouts and commission structures, and monitoring multi-tenant revenue metrics across administrative dashboards and workspace views. Querying these dimensions involves dedicated API endpoints, SWR hooks, and specialized visualization components.

Sources: [apps/web/app/ee/api/program-applications/analytics/route.ts:37-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/program-applications/analytics/route.ts#L37-L40), [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:42-48](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L42-L48)

The program applications endpoint `GET /api/program-applications/analytics` resolves the workspace default program identifier through `getDefaultProgramIdOrThrow(workspace)` and validates query parameters against `applicationEventAnalyticsQuerySchema`. Depending on the requested `groupBy` parameter, the execution flow diverges into absolute counts, grouped property queries, partner breakdowns, or timeseries aggregations.

Sources: [apps/web/app/ee/api/program-applications/analytics/route.ts:38-155](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/program-applications/analytics/route.ts#L38-L155)

The query execution chain follows a precise sequence:
`withWorkspace()` wrapper → `getDefaultProgramIdOrThrow()` → `applicationEventAnalyticsQuerySchema.parse()` → `getStartEndDates()` → `parseFilterValue()` → conditional branch on `groupBy` (`count` | `referralSource` | `country` | `partnerId` | `timeseries`).

Sources: [apps/web/app/ee/api/program-applications/analytics/route.ts:38-155](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/program-applications/analytics/route.ts#L38-L155)

> [!WARNING]
> When `groupBy` is set to `partnerId`, the API executes a two-step query: first grouping program application events by `referredByPartnerId`, and then performing a secondary relational lookup in `prisma.partner.findMany` filtered by partners associated with the active `programId`.

Sources: [apps/web/app/ee/api/program-applications/analytics/route.ts:137-196](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/api/program-applications/analytics/route.ts#L137-L196)

The `ApplicationsFunnelChart` component renders a four-stage conversion funnel mapping raw visits to final partner approvals. Each stage links to filtered query parameters and maps to specific event counts and color tokens.

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-92](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L92)

| Stage ID | Metric Key | Color Token | Description | Sources |
| :--- | :--- | :--- | :--- | :--- |
| `visited` | `visits` | `text-blue-500` | Raw visitor traffic landing on program pages | [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L40) |
| `started` | `starts` | `text-violet-600` | Applications initiated by prospective partners | [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L40) |
| `submitted` | `submissions` | `text-pink-500` | Completed application forms submitted for review | [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L40) |
| `approved` | `approvals` | `text-teal-400` | Successfully approved partner applications | [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L40) |

Sources: [apps/web/app/app.dub.co/dashboard/slug/ee/program/analytics/applications/applications-funnel-chart.tsx:25-40](https://github.com/blade47/dub/blob/HEAD/apps/web/app/app.dub.co/(dashboard)/%5Bslug%5D/(ee)/program/analytics/applications/applications-funnel-chart.tsx#L25-L40)

Administrative consoles in `admin.dub.co` utilize dedicated page components to render financial timeseries, payout status metrics, and commission metrics. The `RevenuePageClient` component computes period-over-period percentage changes by evaluating rolling timestamp boundaries from `timeseries` and `previousPeriodTimeseries` datasets.

Sources: [apps/web/app/ee/admin.dub.co/dashboard/revenue/page.tsx:47-146](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/revenue/page.tsx#L47-L146), [apps/web/app/ee/admin.dub.co/dashboard/payouts/page.tsx:83-133](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/payouts/page.tsx#L83-L133)

| Administrative View | Primary SWR Endpoint | Key Metrics Tracked | Design Trade-Off / Behavior | Sources |
| :--- | :--- | :--- | :--- | :--- |
| **Revenue Dashboard** | `/api/admin/revenue` | `totalRevenue`, `mrr`, `payoutFees` | Annualizes final metrics dynamically using a 12-month multiplier based on rolling period bounds. | [apps/web/app/ee/admin.dub.co/dashboard/revenue/page.tsx:52-61](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/revenue/page.tsx#L52-L61) |
| **Payouts Dashboard** | `/api/admin/payouts` | `invoices`, `timeseriesData`, `fees` | Extracts unique programs from invoice lists on the client side to build filter options. | [apps/web/app/ee/admin.dub.co/dashboard/payouts/page.tsx:90-153](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/payouts/page.tsx#L90-L153) |
| **Commissions Dashboard** | `/api/admin/commissions` | `commissions`, `fees`, `programs` | Fetches filtered and unfiltered program scopes concurrently to populate filter dropdowns and charts. | [apps/web/app/ee/admin.dub.co/dashboard/commissions/page.tsx:46-68](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/commissions/page.tsx#L46-L68) |

Sources: [apps/web/app/ee/admin.dub.co/dashboard/revenue/page.tsx:52-61](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/revenue/page.tsx#L52-L61), [apps/web/app/ee/admin.dub.co/dashboard/payouts/page.tsx:90-153](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/payouts/page.tsx#L90-L153), [apps/web/app/ee/admin.dub.co/dashboard/commissions/page.tsx:46-68](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/commissions/page.tsx#L46-L68)

> [!TIP]
> Payout fees displayed in the revenue administration view are computed based on a trailing 6-month rolling average.

Sources: [apps/web/app/ee/admin.dub.co/dashboard/revenue/page.tsx:26-28](https://github.com/blade47/dub/blob/HEAD/apps/web/app/(ee)/admin.dub.co/(dashboard)/revenue/page.tsx#L26-L28)

## Related

- [Tinybird Analytics Engine](https://www.doc0.dev/docs/934e554a-e6a1-476f-bb2f-23e62d86c3fd/technical/analytics-and-tracking/tinybird-analytics-engine)
- [Data Exports](https://www.doc0.dev/docs/934e554a-e6a1-476f-bb2f-23e62d86c3fd/technical/analytics-and-tracking/data-exports)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/934e554a-e6a1-476f-bb2f-23e62d86c3fd/llms.txt) for all pages in this wiki.
