Skip to content

Manual Trigger

Manual triggering allows you to bypass the SDK’s automatic targeting rules and show a specific survey when a user completes a specific action (e.g., clicking a button, completing a checkout, or encountering an error).

Automatic display timing, cooldowns, and repeat rules are covered in Behavior & Frequency. Surveys that require an identified user still need Identifying users before showSurvey can succeed.

The showSurvey command takes a single argument: the unique surveyId.

window.pulseahead("showSurvey", "SURVEY_ID");
ParameterTypeDescription
surveyIdstringRequired. The unique identifier for the survey you want to show.

When showSurvey is called, the following rules are skipped:

  • Initial wait — the minimum time since a user’s first visit is not enforced.
  • Global cooldown — the project-level cooldown between surveys is not enforced.

The following rules are still enforced:

  • Active status — the survey must be set to “Active” in the dashboard.
  • Identified users only — if the survey requires an identified user, it will not show until identify has been called.
  • Segment membership — if the survey targets a specific segment, the user must be in that segment.
  • Repeat delay / show once — if the user has already completed the survey, the repeat delay (or “show once” setting) is respected.
  • Dismiss / retry delay — if the user dismissed the survey, the retry delay is respected.
  • Audience targeting — country, platform, OS, browser, URL patterns, and minimum session count are all still checked.
  • Sampling — if the survey is configured with a sampling percentage below 100%, that is still applied.

Trigger a feedback survey immediately after a user performs a key action in your application:

// Example: Show a survey after a successful export
async function handleExport() {
await performExport();
window.pulseahead("showSurvey", "e76b29d4-...");
}

Show a support survey if a user encounters an error or stays on a complex page for too long:

// Example: Show a survey if an error occurs
try {
await criticalOperation();
} catch (error) {
window.pulseahead("showSurvey", "error-feedback-id");
}

If you have a persistent “Feedback” button in your UI, you can use showSurvey to open a specific survey when the button is clicked:

// React Example
<button onClick={() => window.pulseahead("showSurvey", "global-feedback-id")}>
Give Feedback
</button>

You can find the unique ID for any survey in the URL of the Pulseahead survey editor. If you’ve set the survey to manual trigger in the Behavior tab, the exact showSurvey code snippet with the survey ID pre-filled is shown there too.