# @atlaskit/rovo-agent-analytics

> Rovo Agents analytics

Latest version **6.8.0** (published 2026-11-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlaskit/rovo-agent-analytics
pnpm add @atlaskit/rovo-agent-analytics
yarn add @atlaskit/rovo-agent-analytics
bun add @atlaskit/rovo-agent-analytics
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.8.0 |
| Published | 2026-11-11 |
| First published | 2025-11-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 103.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | atlassianartifactteam |

## Links

- npm: https://www.npmjs.com/package/@atlaskit/rovo-agent-analytics
- Repository: https://bitbucket.org/atlassian/atlassian-frontend-monorepo
- Homepage: https://bitbucket.org/atlassian/atlassian-frontend-monorepo#readme
- Issues: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/issues
- npm.io page: https://npm.io/package/@atlaskit/rovo-agent-analytics

## Dependencies (5)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [@compiled/react](https://npm.io/package/@compiled/react.md) ^1.0.2
- [@atlaskit/analytics-next](https://npm.io/package/@atlaskit/analytics-next.md) ^12.6.0
- [@atlaskit/analytics-listeners](https://npm.io/package/@atlaskit/analytics-listeners.md) ^11.4.0
- [@atlaskit/react-compiler-gating](https://npm.io/package/@atlaskit/react-compiler-gating.md) ^0.2.0

## Recent versions

- 6.8.0 (latest) — 2026-11-11
- 6.7.2 — 2026-11-05
- 6.7.1 — 2026-10-29
- 6.7.0 — 2026-10-27
- 6.6.1 — 2026-10-16
- 6.6.0 — 2026-10-16
- 6.5.0 — 2026-09-25
- 6.4.0 — 2026-09-15
- 6.3.0 — 2026-09-11
- 6.2.2 — 2026-09-09
- 6.2.1 — 2026-09-03
- 6.2.0 — 2026-08-20
- 6.1.2 — 2026-08-20
- 6.1.1 — 2026-08-19
- 6.1.0 — 2026-08-06
- … 56 more at https://npm.io/package/@atlaskit/rovo-agent-analytics/versions

## README

# RovoAgentAnalytics

Rovo Agents analytics library for composing and sending typed analytics events.

## Usage

```typescript
import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({});

// Full control over event properties — all fields are type-checked
trackAgentEvent({
  action: 'view',
  actionSubject: 'rovoAgent',
  attributes: { 
    agentId: 'agent-123',
    touchPoint: 'browse-agent-list',
  },
});
```

Detailed docs and example usage can be found
[here](https://atlaskit.atlassian.com/packages/ai-mate/rovo-agent-analytics).

## Examples

### Basic Event Tracking

For fully-typed events with explicit `action`, `actionSubject`, and `attributes`:

```typescript
import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({
  agentId,
  touchPoint: 'browse-agent-list',
});

// Track a user interaction
trackAgentEvent({
  action: 'duplicate',
  actionSubject: 'rovoAgent',
  attributes: {},
});
```

### Event Tracking with Custom Attributes

```typescript
import { useRovoAgentActionAnalytics } from '@atlaskit/rovo-agent-analytics/actions';

const { trackAgentEvent } = useRovoAgentActionAnalytics({});

// Full control over event properties — all fields are type-checked
trackAgentEvent({
  action: 'created',
  actionSubject: 'batchEvaluationDataset',
  attributes: { 
    totalQuestions: 5 
  },
  objectType: 'batchEvaluationDataset',
  objectId: 'dataset-123',
});
```

## Payload Types

Each group file in `src/actions/groups/` exports a **discriminated union payload type** that defines all valid event shapes for that group.

| File | Payload Type | Description |
| --- | --- | --- |
| `agent-interactions.ts` | `AgentInteractionsEventPayload` | User-initiated interactions (view, edit, delete, duplicate, star, chat, verify…) |
| `triggers.ts` | `TriggerEventPayload` | Inline trigger views and completed frontend CRUD operations |
| `editing.ts` | `EditingEventPayload` | Agent save/mutation events (updated) |
| `debug.ts` | `DebugEventPayload` | Debug modal actions (view, copy, toggle skill info) |
| `tools.ts` | `ToolsEventPayload` | Tool execution actions (confirm, stream stop, result viewed, error) |
| `evaluation.ts` | `EvaluationEventPayload` | Batch evaluation events (dataset CRUD, job lifecycle, results viewed) |
| `create-flow.ts` | `CreateFlowEventPayload` | Create agent funnel steps |
| `add-tools-prompt.ts` | `AddToolsPromptEventPayload` | Add tools prompt modal events |
| `value-calculator.ts` | `ValueCalculatorEventPayload` | Agent Insights value calculator funnel |

The combined `EventPayload` type (exported from `types.ts`) is a union of all these payload types.

## Adding a New Action

### To an existing payload type

1. Open the group file (e.g. `src/actions/groups/agent-interactions.ts`)
2. Add a new variant to the payload union type with a data-portal registry link:

```typescript
export type AgentInteractionsEventPayload =
  | {
      // https://data-portal.internal.atlassian.com/analytics/registry/XXXXX
      actionSubject: 'rovoAgent';
      action: 'myNewAction';
      attributes: BaseAgentAnalyticsAttributes & {
        myCustomField: string;
      };
    }
  | // ... existing variants
```

That's it — TypeScript will enforce the correct shape when calling `trackAgentEvent()`.

### To a new group

If your action doesn't fit any existing group, create a new one:

1. Create a new file in `src/actions/groups/` following the existing template
2. Export a discriminated union payload type (e.g. `MyFeatureEventPayload`)
3. Add the new type to the `EventPayload` union in `src/common/types.ts`:

```typescript
import type { MyFeatureEventPayload } from '../actions/groups/my-feature';

export type EventPayload =
  | EditingEventPayload
  | AgentInteractionsEventPayload
  // ... existing types
  | MyFeatureEventPayload;
```

## Defining Custom Attributes

Each action variant in a payload type can have its own specific attributes:

### Using BaseAgentAnalyticsAttributes

For actions that need `touchPoint` and `agentId`:

```typescript
{
  actionSubject: 'rovoAgent';
  action: 'view';
  attributes: BaseAgentAnalyticsAttributes;
}
```

### Using Custom Attributes

For actions that need additional attributes:

```typescript
{
  actionSubject: 'rovoAgent';
  action: 'updated';
  attributes: BaseAgentAnalyticsAttributes & { 
    agentType: string; 
    field: string; 
  };
}
```

## Entry Points

| Entry Point | Description |
| --- | --- |
| `@atlaskit/rovo-agent-analytics/actions` | Main entry point — exports `useRovoAgentActionAnalytics` hook |
| `@atlaskit/rovo-agent-analytics/create` | Create agent flow analytics — exports `useRovoAgentCreateAnalytics` hook and `AgentCreateAction` type |

### Create Flow Analytics

The `useRovoAgentCreateAnalytics` hook is used for tracking the agent creation funnel:

```typescript
import { useRovoAgentCreateAnalytics } from '@atlaskit/rovo-agent-analytics/create';

const [csid, { trackCreateSession, trackCreateSessionStart }] = useRovoAgentCreateAnalytics({
  touchPoint: 'agent-studio',
});

// Track funnel steps using string literal actions
trackCreateSession('createFlowStart');
trackCreateSession('createFlowActivate', { agentType: 'custom' });
```

---
_Source: https://npm.io/package/@atlaskit/rovo-agent-analytics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
