Tracking Events
Learn how to send events from your app to Cueflow for behavior-based targeting and analytics.
Tracking via Embed Script
Use Cueflow.track() to record events:
// Simple event
Cueflow.track('project_created');
// Event with properties
Cueflow.track('file_exported', {
format: 'csv',
rowCount: 1500
});When to Track
Call Cueflow.track() when important actions occur:
// After user creates a project
async function createProject(data) {
const project = await api.createProject(data);
// Track the event
Cueflow.track('project_created', {
projectId: project.id,
projectType: project.type
});
return project;
}
// After user invites a team member
function inviteTeamMember(email) {
api.sendInvite(email).then(() => {
Cueflow.track('team_member_invited');
});
}
// After completing onboarding
function completeOnboarding() {
Cueflow.track('onboarding_completed');
}Event Properties
Add context with properties (optional):
Properties must be JSON-serializable values:
Strings
Numbers
Booleans
Arrays
Objects
Queued Events
If you track events before Cueflow.init() completes, they're automatically queued and sent once initialization finishes.
Tracking via Server API
For server-side events, use the API:
Use Cases for Server Events
Webhook-triggered events (payment completed, email opened)
Backend processes (job completed, report generated)
Events from systems without JavaScript
Managing Events in Dashboard
Creating Events
Pre-define events for visibility:
Go to Events in the sidebar
Click New Event
Enter:
Name - Display name (e.g., "Project Created")
Key - API key (e.g.,
project_created)Description - Optional context
Click Create
Events are also auto-created when first tracked.
Viewing Events
The Events page shows:
All defined events
Event occurrence counts
Last triggered timestamp
Event Details
Click an event to see:
Recent occurrences
Which contacts triggered it
Event properties
Viewing Contact Events
See all events for a specific user:
Go to Contacts
Click a contact
View the Events tab
Shows:
All events triggered
Timestamps
Event properties
Automatic Checklist Completion
Events can auto-complete checklist items:
Create a checklist with items
For each item, set completion to "Automatic"
Add a rule: Event →
event_key→ Has Done
When the user triggers the event, the checklist item completes automatically.
Example:
Checklist item: "Create your first project"
Completion type: Automatic
Rule: Event →
project_created→ Has Done
When user creates a project and Cueflow.track('project_created') fires, the item auto-completes.
Framework Examples
React
Vue
Event Wrapper Utility
Create a utility for consistent tracking:
Best Practices
Track Meaningful Actions
Focus on events that matter:
Good:
project_createdteam_member_invitedexport_completed
Avoid:
button_clickedpage_viewed(too generic)mouse_moved
Be Consistent
Use the same event key everywhere
Document your event schema
Review with your team
Include Useful Properties
Add context that helps with analysis:
Don't Over-Track
Track actions, not every interaction
Consider what you'll actually use
Review and clean up unused events
Handle Errors
Track events after successful actions:
Troubleshooting
Events not appearing
Check that Cueflow is initialized
Verify the event key matches exactly
Check browser console for errors
Ensure the user has a valid contact ID
Events not triggering messages
Verify targeting rules match
Check that the message is Published
Confirm the event key in rules matches tracked key
Check user hasn't already dismissed the message
Last updated