Skip to main content

Event Usage

The Web Feedback APIs let you track user actions (events) and use them in intercept targeting logic or as embedded data. Events are useful for:

  • Targeting – Showing intercepts based on actions (e.g., "user clicked Feedback tab 3 times").
  • Embedded data – Passing event counts or names into survey responses.

Tracking Events Before the API Loads​

If you need to track events before QSI.API is available, use the _qsie queue:

window._qsie = window._qsie || [];
window._qsie.push('eventName');

Events pushed to _qsie are processed once the API loads. This ensures events are not lost during the initial page load.


Getting Event Counts​

Use QSI.API.Events.count() to get how many times an event has occurred:

var count = QSI.API.Events.count('eventName');

This is useful for conditional logic or passing counts as embedded data.


Using Events in Targeting​

In Qualtrics, you can configure targeting rules that reference these events. For example:

  • "If event feedbackTabClicked occurred at least 2 times"
  • "If JavaScript Expression QSI.API.Events.count('purchaseAttempt') is greater than 0"

Example: Feedback Tab Click​

// Track when user clicks the Feedback tab
document.getElementById('feedback-tab').addEventListener('click', function() {
window._qsie = window._qsie || [];
window._qsie.push('feedbackTabClicked');
});

// Later: check count for conditional logic and run intercept if targeting passes
if ((QSI?.API?.Events?.count('feedbackTabClicked') ?? 0) >= 2) {
QSI.API.load().then(QSI.API.run);
}

See Also​