$analytics.setSessionData
The method adds columns with arbitrary data in the session result report.
Syntax
The method accepts the following required arguments:
Argument | Type | Description |
---|---|---|
header | String | Column name in the report |
value | String | Column 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
-
You can add up to 100 columns within one session.
-
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.