Track Goal Event
track_goalRecord one completion of a custom goal. The goal is created on first use, so no setup call is needed; names are lowercase letters, digits, underscores, and hyphens, max 64 chars. Pass visitorUid (the anonymous visitor ID Flowsery assigned on the user's own website) so the completion attaches to that visitor's sessions and source; omit it for an anonymous completion. Each call appends a completion, so repeating it counts the goal twice. Undo with delete_goals. Requires websiteId or domain with a workspace token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Goal name: lowercase letters, numbers, underscores, hyphens only (max 64 chars). E.g. "newsletter_signup", "add-to-cart" | |
| domain | No | Website domain from list_websites (e.g. "example.com"). Alternative to websiteId with a workspace token. | |
| metadata | No | Up to 10 string key-value pairs stored with the completion. More than 10 fails with a 400. | |
| websiteId | No | Website ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key. | |
| visitorUid | No | Anonymous visitor ID Flowsery assigned on the user's own website (the _fs_vid value). Omit to record an anonymous completion. | |
| workspaceId | No | Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace do not exist in another |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | Object with status and data: a confirmation message. The completion itself is written asynchronously and appears in get_goals shortly after. |