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

# Analytics

> Track and measure your agent's performance

The Analytics dashboard gives you insights into how users interact with your agent, helping you identify opportunities to improve responses and increase engagement.

## Accessing Analytics

1. Go to **Agents** in the sidebar
2. Select your agent
3. Click **Analytics** in the agent menu

## Overview Metrics

The summary section shows key performance indicators:

| Metric                        | Description                 |
| ----------------------------- | --------------------------- |
| **Total Conversations**       | Number of chat sessions     |
| **Total Messages**            | All messages exchanged      |
| **Avg Messages/Conversation** | Engagement depth            |
| **Thumbs Up**                 | Positive feedback count     |
| **Thumbs Down**               | Negative feedback count     |
| **Feedback Ratio**            | Positive / total feedback % |

## Date Range

Filter analytics by time period:

* **Last 7 days** — Recent performance
* **Last 30 days** — Monthly trends
* **Last 90 days** — Quarterly view
* **Custom range** — Select specific dates

## Daily Trends

The daily chart shows:

* **Conversations** — Chat sessions per day
* **Messages** — Total messages per day
* **Feedback** — Thumbs up/down per day

Use this to identify:

* Peak usage times
* Trends over time
* Impact of changes you make

## Channel Breakdown

See where conversations originate:

| Channel    | Description                   |
| ---------- | ----------------------------- |
| **Widget** | Embedded chat on your website |
| **API**    | Programmatic API calls        |
| **Test**   | Dashboard test conversations  |

## Geographic Distribution

View conversations by country to understand your audience:

* See which regions use your agent most
* Identify localization opportunities
* Understand timezone patterns

## Tool Performance

Track how your tools are performing:

| Metric                 | Description                |
| ---------------------- | -------------------------- |
| **Execution Count**    | Times the tool was called  |
| **Success Count**      | Successful executions      |
| **Failure Count**      | Failed executions          |
| **Success Rate**       | Success percentage         |
| **Avg Execution Time** | Average response time (ms) |

### Identifying Issues

* **Low success rate** — Check API credentials, endpoint availability
* **High execution time** — Optimize external API or add caching
* **Low usage** — Improve tool description or agent prompts

## Form Analytics

For form tools, track the conversion funnel:

| Metric              | Description             |
| ------------------- | ----------------------- |
| **Impressions**     | Times form was shown    |
| **Started**         | Users who began filling |
| **Submitted**       | Completed submissions   |
| **Conversion Rate** | Submitted / Impressions |
| **Completion Rate** | Submitted / Started     |

### Field-Level Analysis

See which fields have the highest drop-off:

| Field   | Completion Rate |
| ------- | --------------- |
| Email   | 98%             |
| Name    | 95%             |
| Phone   | 45%             |
| Message | 85%             |

<Tip>
  High drop-off on a field? Consider making it optional or moving it later in the form.
</Tip>

## Trigger Analytics

Measure automation effectiveness:

| Metric              | Description                |
| ------------------- | -------------------------- |
| **Fired**           | Times trigger activated    |
| **Converted**       | User engaged after trigger |
| **Conversion Rate** | Engaged / Fired            |

Access via **Agents** → **Triggers** tab.

## Feedback Analysis

User feedback helps identify areas for improvement:

### Viewing Feedback

1. Go to **Conversations**
2. Filter by **Has Feedback**
3. Review conversations with thumbs down

### Common Issues

* **Wrong answers** — Update knowledge base
* **Missing information** — Add relevant documents
* **Tool failures** — Check tool configuration
* **Tone issues** — Adjust system prompt

## Exporting Data

Export analytics data for external analysis:

1. Select date range
2. Click **Export** button
3. Choose format (CSV or JSON)

## Best Practices

### Weekly Review

1. Check feedback ratio trend
2. Review negative feedback conversations
3. Identify top-performing tools
4. Monitor form conversion rates

### Monthly Analysis

1. Compare month-over-month trends
2. Analyze geographic patterns
3. Review tool success rates
4. Assess trigger effectiveness

### Continuous Improvement

1. **Low feedback ratio?**
   * Review negative feedback conversations
   * Update knowledge base with missing info
   * Improve system prompt clarity

2. **Declining conversations?**
   * Check widget installation
   * Review trigger configurations
   * Assess content freshness

3. **Poor form conversion?**
   * Simplify form fields
   * Improve form timing (triggers)
   * Add better context/descriptions

4. **Tool failures increasing?**
   * Check external API status
   * Verify credentials
   * Review error logs

## API Access

Access analytics programmatically:

```bash theme={null}
# Get summary metrics
curl "https://api.ansa.so/analytics/summary?agentId=xxx&startDate=2024-12-01" \
  -H "Authorization: Bearer $ANSA_API_KEY"

# Get daily data
curl "https://api.ansa.so/analytics/daily?agentId=xxx" \
  -H "Authorization: Bearer $ANSA_API_KEY"

# Get channel breakdown
curl "https://api.ansa.so/analytics/channels?agentId=xxx" \
  -H "Authorization: Bearer $ANSA_API_KEY"

# Get country data
curl "https://api.ansa.so/analytics/countries?agentId=xxx" \
  -H "Authorization: Bearer $ANSA_API_KEY"

# Get tool performance
curl "https://api.ansa.so/analytics/tools?agentId=xxx" \
  -H "Authorization: Bearer $ANSA_API_KEY"
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Confidence Scores" icon="gauge" href="/user-guides/confidence-scores">
    Understand response confidence
  </Card>

  <Card title="Conversation History" icon="clock-rotate-left" href="/user-guides/history">
    Review past conversations
  </Card>
</CardGroup>
