<tracking> Directive
The <tracking>
directive defines analytics and event tracking behavior. It provides a declarative way to specify what events should be tracked and how, separate from UI interactions.
🛠Attributes
name
string
Yes
Unique identifier for the tracking event
category
string
Yes
Event category (e.g., 'user', 'system', 'error')
action
string
Yes
Specific action being tracked
label
string
No
Additional context for the event
value
number
No
Numeric value associated with the event
ai-hint
string
No
Additional context for AI interpretation
✅ Allowed Content
<property>
elements for custom event properties<condition>
elements for conditional tracking
💡 Examples
Basic Click Tracking
Conditional Error Tracking
System Performance Tracking
🧩 AI Interpretation Guidelines
Map tracking events to appropriate analytics systems
Handle conditional tracking with proper guards
Preserve event context and properties
Implement proper timing for performance metrics
Ensure privacy compliance
Support multiple analytics providers
Property Types
property
property
Defines a custom property for the tracking event.
name
string
Yes
Property name
value
any
Yes
Property value (can be dynamic)
type
string
No
Data type (string, number, boolean, array)
condition
condition
Defines when tracking should occur.
property
string
Yes
Property to check
exists
boolean
No
Check if property exists
equals
any
No
Value to compare against
Last updated