tode.trackAction()
Track a simple user action in your Figma plugin or widget.
Usage
TypeScript
tode.trackAction('export_clicked');
tode.trackAction('settings_opened');
tode.trackAction('layer_renamed');Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
actionName | string | Yes | Identifier for the action |
Returns
Promise<void>
Best Practices
Use descriptive snake_case names:
TypeScript
// Good - clear and descriptive
tode.trackAction('export_to_png');
tode.trackAction('layer_renamed');
tode.trackAction('settings_opened');
// Bad - too vague
tode.trackAction('click');
tode.trackAction('action1');Examples
Track button clicks
TypeScript
const handleExport = () => {
// Perform export logic...
tode.trackAction('export_clicked');
};Track feature usage
TypeScript
const openSettings = () => {
tode.trackAction('settings_opened');
// Show settings UI...
};Always check isReady first
TypeScript
if (tode.isReady) {
tode.trackAction('action_name');
}See Also
- tode.trackActionWithMetric() - Track actions with numeric values
- tode.isReady - Check if ready to track
- Best Practices - Naming conventions and tips