Skip to main content

$analytics.setSessionData

The method adds columns with arbitrary data in the session result report.

Syntax

The method accepts the following required arguments:

ArgumentTypeDescription
headerStringColumn name in the report
valueStringColumn value in the report
$analytics.setSessionData("Header", "Value")

The column you set will be displayed in the session result report in Analytics > Dialogs > Sessions > Session log.

Usage details

  1. You can add up to 100 columns within one session.

  2. In the telephone channel, you can also use the $dialer.reportData method to expand the call campaign result report.

How to use

In the example below, the bot asks the client how they knew about the service.

state: Survey
a: Could you please tell us how you heard about us?

state: Ad
intent: /ad
script:
$analytics.setSessionData("How did you hear about us", "From internet ad")

state: Friends
intent: /friends
script:
$analytics.setSessionData("How did you hear about us", "From friends")

When the client gets into one of the states Ad or Friends, the column How did you hear about us will appear in the session report. The corresponding value will be written in the column field, for example, From internet ad.