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

# Metrics

export const TxnTag = ({status}) => {
  const getStyles = status => {
    const baseStyle = {
      display: 'inline-block',
      padding: '4px 8px',
      borderRadius: '4px',
      fontSize: '13px',
      fontWeight: '400'
    };
    switch (status) {
      case "PENDING":
        return {
          ...baseStyle,
          backgroundColor: '#ececec',
          color: '#9f9f9f'
        };
      case "AUTHORIZED":
        return {
          ...baseStyle,
          backgroundColor: '#ecfdf5',
          color: '#047857'
        };
      case "SETTLED":
      case "PARTIALLY_SETTLED":
        return {
          ...baseStyle,
          backgroundColor: '#ecfdf5',
          color: '#047857'
        };
      case "DECLINED":
      case "FAILED":
        return {
          ...baseStyle,
          backgroundColor: '#fef2f2',
          color: '#dc2626'
        };
      case "CANCELLED":
        return {
          ...baseStyle,
          backgroundColor: '#fefce8',
          color: '#d78203'
        };
      case "SETTLING":
        return {
          ...baseStyle,
          backgroundColor: '#e0f2fe',
          color: '#0c4a6e'
        };
      default:
        return {
          ...baseStyle,
          backgroundColor: '#f3f4f6',
          color: '#374151'
        };
    }
  };
  return <span style={getStyles(status)}>{status}</span>;
};

## What is a Metric?

A metric is a key performance indicator that provides essential data for evaluating and optimizing payment processes. Primer includes 20 metrics within our Dashboards and Monitors, and we're adding new data all the time.

## Metrics

| Metric Name                                    | Definition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization rate                             | <p>Main indicator of the performance of your payment flow. </p> <p>Calculated as the count of payments that reached the status <TxnTag status="SETTLED" /> <TxnTag status="PARTIALLY_SETTLED" /> <TxnTag status="SETTLING" /> or <TxnTag status="AUTHORIZED" /> divided by the total number of payments that reached a processor.</p><p>This metric ignores payments where <ul><li>the status is <TxnTag status="PENDING" /> <TxnTag status="FAILED" /> or <TxnTag status="CANCELLED" /></li><li>the status is set to <TxnTag status="DECLINED" /> before being sent to a processor (i.e. the declined payments that have [`processor.name`](/api-reference/v2.4/api-reference/payments-api/get-a-payment#response-processor) set to `null`) </li></ul></p> |
| Sales count                                    | The total number of settled sales                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Sales value (can be converted to any currency) | The total value of settled sales in the currency set in the Dashboard                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Refunds count                                  | The total number of refunds                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Refunds value                                  | The total value of refunds in the currency set in the Dashboard                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Refunds (% of sales value)                     | The refund value as a % of sales value. Calculated on date of sale created                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Average order value                            | The average value of settled sales                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Average refund value                           | The average value of settled refunds                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Payments count                                 | The total number of payments created                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Payments count (authorized)                    | The total number of authorized payments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Payments count (declined)                      | The total number of declined payments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Payments count (failed)                        | The total number of failed payments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Decline rate                                   | Rate of declined vs successful payments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| 3DS authentication count                       | The total number of payments that had a 3DS request                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 3DS authentication count (failed)              | The total number of payments that had a failed 3DS request                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 3DS authentication rate                        | The number of successful 3DS attempts divided by the total number of 3DS attempts. Excludes processor 3DS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Recovered sales value                          | The total combined value of sales recovered by fallbacks & adaptive 3DS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Recovered sales value (adaptive 3DS)           | The total value of sales recovered by adaptive 3DS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Recovered sales value (fallbacks)              | The total value of sales recovered by fallbacks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Fallbacks count                                | The total number of payments where a fallback was attempted                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
