Skip to contentSkip to navigationSkip to topbar
On this page

Label Data for Flex Insights


(warning)

Public beta

Flex Insights (also known as Historical Reporting) is currently available as a public beta release and the information contained in the Flex Insights documentation is subject to change. This means that some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by a Twilio SLA.

Any reference to "Historical Reporting", "Flex Insights API", "Flex Insights Historical Reporting", or "Flex Insights Historical Reporting API" in the Flex Insights documentation refers to Flex Insights.

Labels are a collection of pre-existing keys for your data that allow you to use Historical Reporting resources more efficiently. You can use up to 10 custom labels for conversations, 3 custom labels for customers and 3 custom labels for agents. In task attributes, these are named conversation_label_x, customer_label_x and agent_label_x, where X is a number for the attribute.

LabelMaximum NumberExample
Conversation10conversation_label_1
Customer3customer_label_1
Agent3agent_label_1

Context: How Historical Reporting Works

context-how-historical-reporting-works page anchor

Historical Reporting has a limit of containing 2 billion unique attribute values. This includes any value used in any dataset. If the same value is using multiple times in different records or in different datasets it counts as one towards this limit. When you provide custom data to Historical Reporting you are also consuming unique values from this limit. Values stored as labels do not count towards the 2 billion unique values limit.

For attributes that contain limited set of values such as Direction, Channel, or Team, the limit is not an issue. However, attributes that contain values that are unique for many conversation or customers consume this limit much faster. Reaching this limit may lead to Flex Insights being unable to load additional data into the affected Workspace. In order to prevent this, Flex Insights may delete older data before it reaches its default retention.

Since labels don't count toward the unique attribute value limit, they're useful for capturing IDs and similar values (like CallSID, ChannelSID, or an external ID of a customer.)


Label Only for Unique Values

label-only-for-unique-values page anchor

When using the label only, as shown in the code sample below, Flex Insights will use segment ID as the attribute value. We recommend using this for high cardinality attributes, such as IDs.

1
{
2
"conversation_label_1": "ID-123456789"
3
}

The example above is equivalent to providing this in task attributes:

1
{
2
"conversation_attribute_1": "<segment ID>",
3
"conversation_label_1": "ID-123456789"
4
}

All reports segmented by conversation_attribute_1 will show individual segments.

Attribute Only for Categorical Values

attribute-only-for-categorical-values page anchor

When using the attribute only, Flex Insights will use the same value for the attribute label. We recommend using this to bucket conversations and customers into categories. The number of categories can be in thousands or millions. As long as they are not almost unique per conversations they will have limited impact on the 2 billion unique values limit.

1
{
2
"conversation_attribute_1": "Green Category"
3
}

The example above is equivalent to providing this in task attributes:

1
{
2
"conversation_attribute_1": "Green Category",
3
"conversation_label_1": "Green Category"
4
}

Attribute and Label for User Friendly Reporting

attribute-and-label-for-user-friendly-reporting page anchor

You can provide both attribute and label and Flex Insights will push these as you provide them into Flex Insights. Providing the attribute and the label are useful if the attribute value is a fairly technical text (such as category ID in your system) and you want to have more user-friendly labels in reports, instead of showing the ID. Another possible use is to have label in an alternate language.

1
{
2
"conversation_attribute_1": "Very technical representation of a category",
3
"conversation_label_1": "Human readable category name"
4
}

  • If the same label is used for multiple attribute values the label will be shown multiple times in filters.
  • Labels cannot be used for segmenting reports. The report would be still segmented by the underlying attribute value. This means that if you use the same label value for multiple attribute value you will see multiple metrics with the same label in reports.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.