Types of submit events payload
Digital offers various types of custom events payload. It is possible to define various combinations of these payload types for your property.
-
Only report event submission and UUID
-
Broadcast selection questions only
-
Broadcast selection and verbatim only
Feedback ContextData
The following table lists keys and values that are broadcast with every custom event.
contextData variable name | Description |
---|---|
Form_ID | Digital survey identifier. |
Form_Type | Type of the survey triggering. |
Feedback_UUID | Unique identifier of the specific feedback that was sent to Digital. The feedback UUID is generated only when the survey is actually opened. Events such as button_clicked or invite_accepted have no UUID. |
Form_Language | Language of the form that has been displayed to the user. |
Content | List of NPS fields and their values. |
Respondee selection questions
In this configuration, the data reported by the custom event is:
-
Feedback UUID
-
Form Type
-
Form ID
-
Form Language
-
An array that contains the responses to each survey component. Each response contains the following fields and additional fields depending on the type of survey component:
-
ID
-
Internal Name
-
Survey component type (see values below)
-
Survey component label as displayed to the respondee
-
Response as defined below
-
The following table lists the mapping between the survey components and event payload.
Survey component | How it appears in the event payload |
---|---|
1-5 Rating | grading |
1-7 Rating | grading1to7 |
1-10 Rating | grading1to10 |
0-10 Rating | Grading0to10 |
Nps | nps |
Checkbox | Checkbox |
Radiobutton | Radiobutton |
Dropdown | Dropdown |
For each survey component, the event contains the response.
-
For “Rating” or “NPS” components, the field “value” contains the respondee's selection.
-
For “Checkbox”, “Radiobutton” or “Dropdown” components, the following is reported:
-
Value — Internal ID of the selected value
-
Answer labelNote: For questions of type "Checkbox", the response is in an array format, as there could be more than one response
-
The following is an example of a sample payload:
Verbatim questions
In this configuration, the data reported by the custom event is:
-
Feedback UUID
-
Form Type
-
Form ID
-
Form Language
-
An array that contains the responses to each survey component. Each response contains the following fields:
-
ID
-
Internal Name
-
Survey component type (see values in the table below)
-
Survey component label as displayed to the respondee
-
Response as defined below
-
The following table lists the mapping between the survey components and event payload.
Survey component | How it appears in the event payload |
---|---|
Date | date, format Note: Format contains the date format selected in the form builder. |
Date input | textinput |
Text area | textarea |
The following is an example of a sample payload.
Setting up listeners
Customers and technical partners can code in event listeners in customer properties.
In the following code example, the feedback payload is printed to the console when the survey is submitted.
In the following code example, all Digital events are printed to the console.
No survey questions reported (Legacy)
In this configuration, the data reported by the custom event is:
-
Feedback UUID
-
Form Type
-
Form ID
The following is an example of a sample payload:
Ratings questions only (Legacy)
In this configuration, the data reported by the custom event is the form configuration data reported in No survey questions reported as well as a list of rating and NPS questions that contain the following for each question:
-
Internal ID — Internal identification of the question.
-
Question type — Always grading for this configuration.
-
Unique name — Value of the internal field name as defined in the form builder.
-
Value — Selection made by the user.
-
Questions components are one of the following:
-
1-5 — grading
-
1-7 — grading1to7
-
1-10 — grading1to10
-
0-10 — grading0to10
-
nps
-
The following is an example of a sample payload: