Track events in your web app
Send user actions to Appcues so you can trigger and target experiences based on behavior and measure engagement.
Table of Contents
Prerequisites
- The Appcues SDK is installed
-
Users are identified via
Appcues.identify() - You know which events to track (see your installation plan)
Your installation is incomplete without event tracking. Events let you target experiences based on what users do (or don't do) in your product, and measure whether your experiences drive the right behaviors.
Two ways to track events
Appcues.track() — code-based tracking. Add tracking calls directly in your application code. Best for events that require verification or validation, since it only fires on event completion.
Click to Track — no-code tracking. Create events visually in the Appcues Builder by clicking on UI elements. Best for non-technical team members who need to track interactions without developer involvement. See the Click to Track guide for setup instructions.
You can use both methods together. Use descriptive event names in either case — clear names make events easier to find and work with in Studio.
Track events with Appcues.track()
What to pass in
Event name (required) — A unique, descriptive string that identifies the action. Don't reuse names for different events.
Event attributes (optional) — Additional context about the event. Event attributes are not visible in Studio or reporting — they can only be used with event triggering.
If you have Appcues installed on both web and a mobile app, use different event names for each platform. Events with the same name are pooled together regardless of source.
Example: track without attributes
Appcues.track("Clicked Upgrade Button");Example: track with attributes
Appcues.track("Submitted Help Ticket", {
url: "/support",
category: "installation"
});Where to add track() calls
Place Appcues.track() anywhere in your code where the event occurs. Common patterns:
Inside an event handler — Track when the event functionality executes:
submitButton.addEventListener("click", function() {
// your existing logic
submitForm();
// track the event
Appcues.track("Form Submitted");
});Alongside existing analytics calls — If you already track events with Mixpanel, Google Analytics, Heap, Amplitude, or another tool, add an Appcues.track() call in the same location:
// existing analytics
mixpanel.track("Completed Onboarding");
// add Appcues tracking
Appcues.track("Completed Onboarding");Things to watch out for
Call identify() first. Appcues.track() requires the user to be identified. If identify() hasn't been called on the page, events will buffer but may not associate correctly.
Each event needs its own track() call. Appcues only receives the events you explicitly send. There is no automatic event capture.
Event tracking does not backfill. Events are only recorded from the moment tracking is added. If you need to import historical event data, use the Appcues API.
Confirm it worked
For Appcues.track() events
- Trigger the event in your application.
- Open your Events page in Studio. The event should appear labeled as Application Event imported with SDK.
- You can also check the Events Explorer with Event Source set to "Application Events."
Buttons that are tracked as events also appear as Application Events in Studio.
For Click to Track events
- In the Appcues Builder, use the Test button when creating the event to verify it detects the right element.
- Save the event, then trigger it outside the Builder by interacting with the element in your application.
- Check your Events page. Click to Track events are labeled as Track Event (Builder) created in Builder. If the event hasn't been triggered outside the Builder yet, Last Seen will show "Not Seen Yet."
- Click to Track events also appear in Events Explorer when Event Source is set to "Track Events (Builder)."
If events aren't appearing
Event doesn't show on the Events page: Confirm identify() is called before track() on the page. Check your browser console for errors. Try triggering the event again and refresh the Events page — there can be a short delay.
Event shows but with the wrong name: Check for typos or inconsistent casing in your track() calls. "Form Submitted" and "form submitted" are treated as separate events.
Click to Track event shows "Not Seen Yet": The event was created in the Builder but hasn't been triggered in your live application yet. Interact with the element outside of the Builder to register the first occurrence. There can be a short delay.
Installation complete
If you've completed all three steps — installing the SDK, identifying users and groups, and tracking events — your Appcues installation is done. You can now publish experiences to your users.
Review your installation periodically to make sure your properties and events still support your use cases as your product evolves. See Manage your account and measure results for audit tips.
Still stuck?
Collect the following and email support@appcues.com:
- Your Appcues Account ID
- The event name and the
track()code from your application - A screenshot of your Events page in Studio
- The URL where the event should fire
- Any errors visible in the browser console