Skip to main content
In a Code Node, you can modify certain parts of the analytics data to get more control of what exactly is written to analytics. You can access the analytics data in a Code Node by using the key analyticsdata. For example:
analyticsdata.intent = "test";

Analytics Data

With Cognigy.AI 4.91, the Understood Messages concept was deprecated, with removal from the Insights reports scheduled for version 2025.19. Use the Goals and Tasks concepts to evaluate whether your AI Agent understood a particular phrase.Respectively, the OData endpoint understood field was deprecated in the same version, with full removal scheduled for version 2025.24. Use the Goals collection in the Cognigy.AI OData endpoint.Refer to the list of all upcoming removals on the Deprecations and Removals page.
FieldDescriptionType
intentThe intent that will be written to analytics. You can for instance modify this field to store the intent that was found in an executed Flow in analytics.String
intentFlowThe ID of the Flow where the intent was found (main Flow or attached Flow).String
intentScoreThe score of the Intent that was found.Number
inputTextThe input text.String
inputDataThe input data object.{"key":"value"}
stateThe State the Flow is currently in.String
slotsThe slots that were found in the user’s input.Object
completedGoalsA list of goals the user has completed.List of Strings
understoodAn input is considered understood if any of the following conditions are met:
  • An Intent or Slot is identified.
  • The input is marked as understood through the Nodes: Code, Overwrite Analytics, Search Extract Output, or AI Agent.
  • The sentence type is pAnswer, nAnswer, or Greeting (if Confirmation Word logic is activated).

An input is considered not understood if any of the following conditions are met:
  • There is an active handover without triggering an Agent Copilot Whisper Flow.
  • The message is explicitly marked as Don't count or Null.
Boolean
custom1A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom2A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom3A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom4A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom5A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom6A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom7A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom8A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom9A custom field that can be set to any string value during Flow execution. Defaults to null.String
custom10A custom field that can be set to any string value during Flow execution. Defaults to null.String

Custom Fields

Custom fields let you add extra data to your Analytics reports. This feature helps you analyze your data more deeply and get insights beyond the standard metrics. By customizing your data, you can make better decisions that fit your specific business needs and goals.

Limitations

  • The maximum length of a custom field is 1024 characters.
For more complex data, you can use a string field object.In this example, custom1 stores a simple string value, while custom2 uses a JSON representation of the customData object to store more complex information.
const customData = {
  key: "value"
};

analyticsdata.custom1 = "userFocusGroup: focusGroup1";
analyticsdata.custom2 = JSON.stringify(customData);

Analytics Data Lifespan

The analyticsdata object is generated for each Flow Execution. This means that any data you store in the analyticsdata object (for example, a custom field) will only be stored in analytics for this Flow Execution. On the next Flow Execution, there will be a new analyticsdata object with a new Intent.
I