Skip to main content
Tracked Events

Learn how to setup events to trigger timely surveys, capture actionable feedback, and connect key user actions to meaningful insights in Sondar.

Li Xia avatar
Written by Li Xia
Updated over a month ago

1. Overview

Show the right survey to your users at the right moment ensures that the insights you collect are relevant, timely, and reflective of the user’s immediate experience. Whether it’s understanding why a user made a purchase, how they feel after using a specific feature, or why they chose to cancel their subscription, well-timed surveys can provide critical data for improving your product or service.

This is where triggering surveys using events comes in. By tying surveys to specific user actions or milestones, you can capture feedback directly tied to key interactions. For instance, you can automatically prompt a survey after a successful checkout, when a user cancels their account, or even when they abandon a cart.

In this article, we’ll walk you through how to use events to trigger surveys effectively, ensuring you get the feedback you crave.


2. Prerequisites

Before you start triggering surveys using events, ensure the following prerequisites are met:

  1. Access and permission to modify your codebase

  2. Sondar JavaScript SDK has been correctly. Refer to the installation guide for step-by-step instructions.

With these prerequisites in place, you’re ready to start setting up event-based triggers to collect actionable feedback.



3. Understanding Events

An event is an action taken or a milestone reached by a user within your application or website. For example, completing a purchase, signing up, or finishing onboarding. These key milestones are ideal moments to gather feedback, as they provide meaningful insights into the user experience and highlight opportunities to improve your product. By connecting surveys to these events, you can capture valuable input when it matters most, ensuring your decisions are guided by timely and relevant data.

Examples of Events

Onboarding completed: Triggered when a user finishes your product’s onboarding process. This is an excellent opportunity to gather feedback about the onboarding experience.

Email campaign launched: Triggered when a user launches a new email campaign or marketing initiative. Use this event to understand their experience and satisfaction with the process.

Order Completed: Triggered when a user completes a purchase. Collecting post-purchase feedback can provide insights into the buying process and overall satisfaction.



4. Creating & Triggering Events

Once you’ve installed the SDK, it’s time to configure your events in Sondar. This section will guide you through creating and linking events to surveys, enabling you to gather feedback at pivotal moments in your user’s journey.

Step 1: Creating an Event in Sondar

1. Log in to Your Sondar Dashboard

2. Navigate to the Events Section

  • From the main menu, go to Events. This is where you can manage and create new events.

3. Add a New Event

  • Click on Create New Event.

  • Provide a descriptive name for your event (e.g., purchase_completed or signup_submitted).

  • Optionally, add a brief description to clarify the purpose of the event.

4. Save Your Event

  • Once saved, the event will be available to link with surveys in the next step.

Step 2: Trigger an Event

1. Sending the Event

  • Call the following method in your application to trigger an event.

SondarSDK.triggerEvent('event_name');

Example:

SondarSDK.triggerEvent('purchase_completed');

2. Verify the Event Was Sent

  • Go back to the Events section in the dashboard.

  • Check if the event count has increased.

5. Attaching User Attributes to Events

Sondar also supports attaching User Attributes with events. See this article for more info.

SondarSDK.triggerEvent('event_name', {attribute_a, attribute_b,})

Example:

SondarSDK.triggerEvent('subscription_started', {
segment: 'Manufacturing',
plan: 'Growth',
});



6. Next Step


7. Best Practices for Using Event Triggers

  • Keep event names consistent and meaningful (e.g., purchase_completed instead of pc1).

  • Limit survey triggers to critical touchpoints to avoid overwhelming users.

  • Test thoroughly to ensure triggers align with user behavior.


8. Get Help

If you have any questions or just need a hand with setting up Events, get in touch as we are standing to help. [email protected]

Did this answer your question?