# Campaign Analytics

> Track and analyze campaign performance with real-time monitoring

Source: https://edesy.in/docs/voice-agent/campaigns/analytics

Monitor campaign performance with real-time updates, detailed call logs, and exportable reports. View metrics as calls happen and analyze results after completion.

> **View analytics:** [Open the Campaigns page](https://voice-agent.edesy.in/campaigns), select a campaign, and click **Analytics** to see detailed metrics.

## Real-Time Monitoring

Running campaigns show live updates via Server-Sent Events (SSE):

```
┌────────────────────────────────────────────────────────────┐
│                 Real-Time Campaign Dashboard                │
├────────────────────────────────────────────────────────────┤
│                                                             │
│   ● Live        Campaign: January Follow-ups                │
│                                                             │
│   ┌──────────┐  ┌──────────┐  ┌──────────┐                 │
│   │    5     │  │    12    │  │    20    │                 │
│   │  Active  │  │ Calls/min│  │ Max Prll │                 │
│   └──────────┘  └──────────┘  └──────────┘                 │
│                                                             │
│   Progress: ████████████░░░░░░░░░  156/300 (52%)           │
│                                                             │
│   Recent Calls:                                             │
│   +919876543210  ✓ completed  45s                          │
│   +919876543211  ✗ no_answer  --                           │
│   +919876543212  ● in_call    23s                          │
│                                                             │
└────────────────────────────────────────────────────────────┘
```

### Live Metrics

| Metric | Description | Updates |
|--------|-------------|---------|
| **Active Calls** | Currently in-progress calls | Real-time |
| **Calls/Min** | Recent call rate | Every 10s |
| **Progress** | Completed / Total contacts | Per call |
| **Recent Calls** | Last 5 call results | Per call |

### SSE Connection

- Auto-connects when viewing running campaign
- Green "Live" badge indicates active connection
- Reconnects automatically on disconnect
- Falls back to polling if SSE unavailable

## Campaign Metrics

### Summary View

Click **Analytics** on any campaign (except DRAFT) to see:

| Metric | Description | Formula |
|--------|-------------|---------|
| **Total Contacts** | Contacts in campaign | - |
| **Calls Made** | Total dial attempts | - |
| **Connected** | Answered calls | - |
| **Connection Rate** | Answer percentage | Connected / Calls Made |
| **Avg Duration** | Average call length | Sum(duration) / Connected |
| **Completion Rate** | Progress percentage | Completed / Total |
| **Success Rate** | Successful outcomes | Successful / Completed |

### Call Outcomes

| Outcome | Description | Icon |
|---------|-------------|------|
| **completed** | Full conversation | ✓ green |
| **answered** | Connected but short | ✓ yellow |
| **no_answer** | No pickup | ○ gray |
| **busy** | Line busy | ○ orange |
| **voicemail** | Reached voicemail | ○ purple |
| **failed** | Technical error | ✗ red |
| **invalid** | Bad phone number | ✗ red |

## Call Logs

View detailed information for every call in the campaign.

### Accessing Call Logs

1. Select a campaign (any status except DRAFT)
2. Click **Call Logs** button
3. Browse, filter, and search call records

### Call Log Fields

| Field | Description |
|-------|-------------|
| **Phone Number** | Recipient number |
| **Contact Name** | Name from contact list |
| **Status** | Call outcome |
| **Duration** | Call length in seconds |
| **Attempt** | Which retry attempt |
| **Started At** | Call start timestamp |
| **Completed At** | Call end timestamp |
| **Error** | Error message (if failed) |

### Filtering

Filter call logs by:

| Filter | Options |
|--------|---------|
| **Status** | All, Completed, Failed, Pending, etc. |
| **Search** | Phone number or contact name |
| **Date Range** | Start/end dates |

### Status Badges

| Badge | Color | Meaning |
|-------|-------|---------|
| `completed` | Green | Successful call |
| `answered` | Yellow | Short connection |
| `no_answer` | Gray | Not answered |
| `busy` | Orange | Line busy |
| `voicemail` | Purple | Left voicemail |
| `failed` | Red | Technical failure |
| `pending` | Blue | Awaiting call |
| `in_progress` | Blue pulse | Currently calling |

## Viewing Conversations

For completed calls, view the full conversation:

### Conversation Data

Click on a call log entry to see:

| Section | Content |
|---------|---------|
| **Transcript** | Full conversation text |
| **Call Summary** | AI-generated summary |
| **Variables Used** | Contact data sent to agent |
| **Call Duration** | Total and breakdown |
| **Timestamps** | Start, end, key moments |

### Transcript Format

```
Agent: Hello Rahul, this is Priya calling from ShopEasy.
       I'm calling about your order ORD-1234.

User:  Yes, I placed an order yesterday.

Agent: Perfect! I wanted to confirm your delivery address is
       123 Main Street, Mumbai 400001. Is that correct?

User:  Yes, that's correct.

Agent: Great! Your order will be delivered tomorrow between
       2 PM and 5 PM. Is there anything else I can help with?

User:  No, thank you.

Agent: Thank you for choosing ShopEasy. Have a great day!
```

## Error Messages

Failed calls include error information:

### Common Errors

| Error | Description | Action |
|-------|-------------|--------|
| `call_failed` | Telephony error | Check provider |
| `timeout` | Call exceeded max duration | Auto-retried |
| `no_capacity` | All lines busy | Wait or add numbers |
| `invalid_number` | Bad phone format | Check contact |
| `dnd_registered` | DND list blocked | Remove contact |
| `insufficient_credits` | Out of credits | Add credits |

### Error Display

In call logs:

```
+919876543210  ✗ failed  "Provider error: Network timeout"
+919876543211  ✗ failed  "DND registered number"
+919876543212  ✗ failed  "Invalid phone number format"
```

## Export Data

Download campaign data for external analysis.

### Export Options

| Format | Description | Use Case |
|--------|-------------|----------|
| **CSV** | Comma-separated values | Excel, Google Sheets |
| **JSON** | Structured data | Programmatic access |

### Export Fields

```csv
phone_number,contact_name,status,duration,outcome,timestamp,transcript,error
+919876543210,Rahul Kumar,completed,120,appointment_booked,2024-01-15T10:30:00,"...",""
+919876543211,Priya Singh,no_answer,0,retry_scheduled,2024-01-15T10:31:00,"",""
+919876543212,Amit Patel,failed,0,error,2024-01-15T10:32:00,"","Network timeout"
```

### How to Export

1. Open campaign analytics
2. Click **Export** button
3. Select format (CSV/JSON)
4. Choose fields to include
5. Download file

## Performance Analysis

### Good Campaign Indicators

| Metric | Target | Notes |
|--------|--------|-------|
| Connection Rate | >50% | Higher in business hours |
| Avg Duration | >60s | Depends on call type |
| Completion Rate | >80% | After all retries |
| Success Rate | >70% | Depends on objective |

### Warning Signs

| Indicator | Threshold | Action |
|-----------|-----------|--------|
| High voicemail rate | >30% | Try different times |
| Short call duration | <30s | Improve greeting |
| Many invalid numbers | >5% | Verify contact data |
| High failure rate | >10% | Check provider |

## Optimization Tips

### Low Connection Rate

1. **Verify phone numbers**: Check format and validity
2. **Try different times**: Test morning vs afternoon
3. **Check DND status**: Remove registered numbers
4. **Use local numbers**: Regional caller ID

### Short Duration

1. **Improve greeting**: More engaging opening
2. **Review agent prompt**: Check for issues
3. **Add value quickly**: State purpose immediately
4. **Personalize**: Use customer name and context

### High Voicemail Rate

1. **Enable voicemail detection**: Skip leaving messages
2. **Call later in day**: People more available
3. **Try multiple times**: Different days/times
4. **Consider mobile vs landline**: Different patterns

### High Failure Rate

1. **Check telephony provider**: Service status
2. **Reduce concurrency**: Lower parallel calls
3. **Review error messages**: Identify patterns
4. **Contact support**: If provider issues

## Comparing Two Campaigns

There is no built-in A/B split, but you can compare approaches with two campaigns:

### Setup

1. Create two campaigns with same contacts (split 50/50)
2. Change one variable:
   - Different greeting message
   - Different system prompt
   - Different calling time
3. Run both campaigns
4. Compare metrics

### What to Test

| Variable | Hypothesis |
|----------|------------|
| Greeting | Formal vs casual |
| Call time | Morning vs afternoon |
| Agent voice | Male vs female |
| Script length | Short vs detailed |

### Comparing Results

| Metric | Campaign A | Campaign B | Winner |
|--------|------------|------------|--------|
| Connection Rate | 52% | 48% | A |
| Avg Duration | 45s | 62s | B |
| Success Rate | 35% | 42% | B |

## Next Steps

- [Creating a Campaign](https://edesy.in/docs/voice-agent/campaigns) - Set up new campaigns
- [Scheduling & Retry Logic](https://edesy.in/docs/voice-agent/campaigns/scheduling) - Configure timing
- [CSV Upload & Variables](https://edesy.in/docs/voice-agent/campaigns/csv-upload) - Personalization

---

**Ready to analyze your campaigns?** [Open the Campaigns page](https://voice-agent.edesy.in/campaigns) to view analytics.
