useWidgetSubmitAction
The useWidgetSubmitAction
hook is designed to enable the tracking of Widget Submitted analytics events and manage the widget interaction submit action. It internally calls createWidgetInteractionAction
to ensure analytics tracking is executed upon successful resolution.
Example usage
It returns an object with the onInteractionSubmit function that you can use to handle the submission of widget interactions.
const { onInteractionSubmit } = useWidgetSubmitAction({ widgetId: "<Widget ID>" });
Hook Argument
widgetId
widgetId
Type | Default |
---|---|
String (Required) | No Default |
Hook Return Value
onInteractionSubmit
onInteractionSubmit
Type |
---|
Function of type: ({ interactionItem:WidgetCreateInteractionActionArg }) => Promise<void | IWidgetInteraction> |
interactionItem: The item representing the interaction with the widget.
Updated about 1 year ago