Actions
Code Actions
Actions can also be set in the codebase to trigger surveys. Please add the code action first in the Formbricks web interface to be able to configure your surveys to use this action.
After that you can fire an action using formbricks.track()
Track an action
formbricks.track("Action Name");
Here is an example of how to fire an action when a user clicks a button:
Track Button Click
const handleClick = () => {
formbricks.track("Button Clicked");
};
return <button onClick={handleClick}>Click Me</button>;