> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junojourney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Widget Builder

> Build custom analytics widgets — pick an event, an aggregation, and a breakdown to surface a chart on admin and manager dashboards.

export const RelatedPages = ({pages = []}) => {
  if (pages.length === 0) return null;
  return <>
      <br />
      <strong>Related articles</strong>
      <CardGroup cols={2}>
        {pages.map(page => <Card title={page.title} href={page.href} key={page.href} />)}
      </CardGroup>
    </>;
};

export const RoleBadge = ({roles = []}) => {
  const colorMap = {
    Admin: "yellow",
    Manager: "blue",
    Learner: "green",
    "Co-editor": "purple"
  };
  return <>
      {roles.map(role => <span key={role}><Badge color={colorMap[role] || "gray"} size="sm" shape="pill">{role}</Badge>{" "}</span>)}
    </>;
};

export const FeatureAvailability = ({module, feature}) => {
  const label = feature || module;
  return <Info title="Feature availability">
      {label ? <>This feature requires the <strong>{label}</strong> module. </> : <>This feature may not be enabled for your organization. </>}
      If you don't see it in Juno, contact your administrator.
    </Info>;
};

<RoleBadge roles={["Admin", "Manager"]} />

## Overview

**Widget Builder** lets admins (and managers, scoped to their reports) compose custom analytics widgets without writing queries. Pick an event, choose an aggregation, optionally break it down by a dimension — Juno renders a live chart you can save to your dashboards.

<Note>
  Widget Builder is gated by the `CAN_SEE_ANALYTICS_WIDGETS_BUILDER` feature flag. If you don't see the option in **Admin → Reports & Analytics**, ask your admin or contact your CSM to enable it.
</Note>

***

## When to use Widget Builder

Use it when the standard analytics tabs ([Training Analytics](/admin/training-analytics), [Reports](/admin/analytics-reports)) don't show the slice you need. Common examples:

* "How many enrollments per department per month?"
* "What share of budget requests come from external vs internal content?"
* "Top 10 search queries by unique users"
* "Content created per channel this quarter"

For pre-built reports, start with [Reports](/admin/analytics-reports). Drop into Widget Builder when you need a custom view.

***

## Building a widget

### 1. Pick an event

Events are the underlying data points Juno tracks. Available events:

| Event                           | What it represents                                         |
| ------------------------------- | ---------------------------------------------------------- |
| **Content created**             | A new course, Journey, quiz, or other unit was published   |
| **Internal content engagement** | A user opened, played, or interacted with internal content |
| **Internal content enrollment** | A user enrolled in an internal unit                        |
| **Budget request created**      | A user submitted a learning purchase request               |
| **External search**             | A user searched the on-demand catalog                      |

### 2. Pick an aggregation

How to count the events:

| Aggregation        | What it does                                                               |
| ------------------ | -------------------------------------------------------------------------- |
| **Count**          | Total number of events (raw count)                                         |
| **Sum**            | Sum a numeric field on the event (e.g., total cost across budget requests) |
| **Count of users** | Distinct users who triggered the event (deduplicates by `userId`)          |

### 3. Pick a breakdown (optional)

Group results by a dimension:

| Dimension           | When useful                                                    |
| ------------------- | -------------------------------------------------------------- |
| **Type**            | Split by content type (course, quiz, Journey, SCORM, etc.)     |
| **Department**      | Compare across org units                                       |
| **Progress status** | Started vs in-progress vs completed                            |
| **Request status**  | Pending / approved / declined / fulfilled                      |
| **Provider**        | External provider (Udemy, Coursera, etc.) — for catalog events |
| **Search value**    | Free-text query (for external search events)                   |

Without a breakdown, you get a single number or single line. With a breakdown, you get a multi-series chart.

### 4. Apply filters

Narrow the result set with filters — for example, only one department, only one date range, or only one content type. Filters compose with the breakdown.

### 5. Pick a chart type

| Chart    | Best for                                               |
| -------- | ------------------------------------------------------ |
| **Bars** | Comparing categories (e.g., enrollments by department) |
| **Pie**  | Showing share of a whole (e.g., request status mix)    |

### 6. Preview, then save

The chart updates live as you change settings. Once it looks right, click **Save**. The widget is added to your admin dashboard (managers see it on theirs, scoped to their reports).

***

## Permissions and scope

| Role        | What they can build        | What data they see                  |
| ----------- | -------------------------- | ----------------------------------- |
| **Admin**   | Any widget across any data | Org-wide                            |
| **Manager** | Same widgets               | Scoped to their direct reports only |

Widgets are saved per user. Sharing a saved widget across users is not yet supported — recreate it on the other user's dashboard if needed.

***

## Where widgets appear

Saved widgets show up on the user's [Reports & Analytics](/admin/analytics-and-reports) dashboard, alongside the standard pre-built widgets. They behave like any other dashboard widget — hover for tooltips, click to drill in, export underlying data.

***

## Limits

* Aggregations run against a snapshot of events; expect a short lag (typically minutes) for very recent activity to appear.
* Widgets with a breakdown across many categories (e.g., department in a 1,000-team org) cap to the top categories — adjust your filter to surface tail values.
* Date ranges default to the dashboard's global filter; per-widget date overrides are not currently supported.

<RelatedPages
  pages={[
{ href: "/admin/analytics-and-reports", title: "Analytics & Reports (Tab 2)" },
{ href: "/admin/analytics-reports", title: "Reports (sub-tab)" },
{ href: "/admin/training-analytics", title: "Training Analytics" },
{ href: "/admin/budget-and-credits", title: "Budget & Credits" },
]}
/>
