Metrics

This page explains different ways to understand and measure the audience of an event using different metrics.

To better breakdown and understand the audience of an event, charts based on different metrics can be added. These chart show histograms on various metrics and these metrics are configured in the metric_categories.json file.

Trigger templates are grouped into named categories based on their business logic as shown below:

{
    "categories": [
        {
            "icon": "fa-phone",
            "name": "Voice call metrics",
            "metrics": [
                {
                    ...
                },
                {
                    ...
                }
            ]
        },
        {
            "icon": "fa-money",
            "name": "Recharge metrics",
            "metrics": [
                {
                    ...
                },
                {
                    ...
                }
            ]
        }
}

Elements inside the metrics are different metric , we will try learn how to configure metrics by examples.

metrics categories are configured in etc/model/campaigns/metric_categories.json file.

Profile Attributes Sourced Metric

The Metric charts prepared from Profile Attributes Sourced metrics gets data from profiles and histograms are produced from profile values of each subscriber.

Example Configuration:

{
    "dataType": "String",
    "metricId": "gender",
    "minimumBucketSize": 50,
    "name": "Gender",
    "profileAttributeSource": {
        "name": "gender"
    }
}
  • profileAttributeSource selects a profile attribute on which histograms needs to be produced.
  • name is name of metric.
  • dataType is data type of X-Axis.
  • metricId is unique name of metric.
  • minimumBucketSize is the minimumBucketSize of histograms.
Aggregate Sourced Metrics

The Metric charts prepared from Aggregate Sourced metrics gets data from aggregate and histograms are produced from aggregate values buckets of each subscriber.

Example Configuration:

{
    "icon": "fa-money",
    "metrics": [
        {
            "aggregateSource": {
                "groupByAttributes": [
                    {
                        "name": "MSISDN"
                    }
                ],
                "name": "topupAmountBySubscriber"
            },
            "dataType": "Currency",
            "metricId": "topupAmount",
            "minimumBucketSize": 300,
            "name": "Topup Amount"
        }
    ],
    "name": "Recharge metrics"
},
  • aggregateSource as this metric get data from an aggregate.
  • aggregateSource.groupByAttributes the group by attribute to be passed.
  • aggregateSource.name is the name of aggregate.