Skip to main content

What are Custom Metrics?

Custom metrics allow you to define AI-powered analysis rules that extract specific insights from your calls automatically. Combined with post-call webhooks, you can send this data directly to your systems for further processing.

Key Features

AI-Powered Extraction

AI analyzes call transcripts to extract custom metrics

Multiple Data Types

Text, Numbers, Yes/No, and List data types

Post-Call Webhooks

Send metrics to your external systems automatically

Default Metrics

Standard metrics included by default

How It Works

1

Configure Metrics

Define custom metrics with AI analysis prompts in agent settings
2

Call Completes

Dialgen records and transcribes the call
3

AI Analysis

AI extracts metrics based on your custom prompts
4

Webhook Sent

Complete call data and all metrics sent to your webhook URL
5

Process Data

Your system receives and processes the metrics

Setting Up Custom Metrics

Custom metrics are configured exclusively through the Dialgen Dashboard. There is no API endpoint for creating or managing custom metrics. All configuration must be done via the web interface.

Dashboard Configuration

  1. Navigate to your agent settings
  2. Go to the Metrics tab
  3. Scroll to Custom Metrics section
  4. Click Add Custom Metric
  5. Configure:
    • Metric Name: What to call this metric
    • Data Type: Text, Number, Yes/No, or List
    • AI Analysis Prompt: Instructions for AI extraction
    • Required: Whether this metric must always have a value
    • Description: Optional notes about this metric
  6. Click Create Metric or Update Metric to save
Once configured, your custom metrics will be automatically applied to all calls for that agent.

Configuration Example


Data Types

Choose the appropriate data type for your metric:

Text (String)

Store textual responses or extracted information. Example:
API Response:

Number

Store numerical values like scores, ratings, or counts. Example:
API Response:

Yes/No (Boolean)

Store true/false values for yes/no questions. Example:
API Response:

List (Array)

Store multiple values as a list. Example:
API Response:

Default Metrics

Dialgen includes standard metrics for every call. These are always included unless explicitly disabled:

Disable Default Metrics

You can disable default metrics if you only want custom ones:
  1. In the Metrics tab
  2. Find Default Dialgen Metrics section
  3. Toggle Enable switch to OFF
Disabling default metrics means standard analysis data won’t be generated. Only do this if you have custom metrics that cover the metrics you need.

Post-Call Webhooks

What are Post-Call Webhooks?

Post-call webhooks are HTTP POST requests sent to your server immediately after a call completes. They contain:
  • Complete call data
  • All default metrics
  • All custom metrics with their schema
  • Recording URL and transcript
The schema of your defined custom metrics is automatically included in every webhook payload so your system knows how to process each metric.

Configuration

  1. Go to Metrics tab in agent settings
  2. Find Post-Call Webhook section
  3. Enter your webhook URL: https://api.yourdomain.com/webhook
  4. Save
Once saved, all future calls will send metrics with the complete schema to this endpoint.

Webhook Payload with Schema

The metricSchema field contains the complete definition of all custom metrics, including their type, description, and whether they’re required. This allows your system to properly validate and process the custom metric values.

Processing Webhooks

Node.js Example

Python Example


Best Practices

Writing Effective Prompts

❌ Vague:
✅ Specific:

Choose Right Data Types

Required Fields

Mark metrics as “Required” only when:
  • The metric must always have a value
  • Missing values would cause problems in your system
  • You want to validate quality

Testing Metrics

  1. Create test agents with your metrics
  2. Run test calls with various scenarios
  3. Review webhook payloads to verify accuracy
  4. Adjust prompts based on results
  5. Deploy when confident

Security

  • ✓ Validate webhook signatures if possible
  • ✓ Use HTTPS URLs only
  • ✓ Implement rate limiting
  • ✓ Log all webhook activity
  • ✓ Handle errors gracefully

Common Use Cases

Lead Scoring

Sentiment Tracking

Issue Documentation

Follow-up Actions


Troubleshooting

Webhook Not Received

Check:
  • URL is correct and publicly accessible
  • Server is responding with 2xx status code
  • Firewall isn’t blocking incoming requests
  • Check Dialgen logs for errors

Metrics Empty or Incorrect

Solutions:
  • Review and clarify your AI prompt
  • Provide examples in the prompt
  • Use simpler, more direct language
  • Test with different call scenarios

High CPU Usage

Optimization:
  • Reduce number of custom metrics
  • Simplify AI prompts
  • Disable default metrics if not needed
  • Increase webhook processing interval

Retrieving Metrics via API

In addition to webhooks, you can retrieve custom metrics by calling the get-call-metric endpoint. The endpoint will return the complete schema definition for all custom metrics configured for that agent.

Get Call Metrics Endpoint

Response with Custom Metric Schema

Both the get-call-metric endpoint and the onCallComplete webhook return the complete metric schema, allowing your application to properly understand and validate each custom metric’s structure.

Next Steps

Agent Configuration

Learn how to configure agents

API Reference

Complete API documentation

Call Recordings

Access call data and recordings