Jump to

Methods

ftools('open', surveyId, options?)

Manually opens a popup survey. Requires Manual Tracking to be enabled for the survey in the dashboard.

ftools('open', 'SURVEY_ID');
ftools('open', 'SURVEY_ID', { force: true, metadata: { userId: '123' } });
Comparison table
ParameterTypeDescription
surveyIdstringSurvey ID.
options.forcebooleanShow even if the user already answered or closed the survey.
options.metadataobjectCustom data attached to the response. See Custom variables.

Not supported for embed surveys — embed surveys render immediately on init().

ftools('close', surveyId, options?)

Programmatically closes an open popup survey.

ftools('close', 'SURVEY_ID');
ftools('close', 'SURVEY_ID', { silent: true });
Comparison table
ParameterTypeDescription
surveyIdstringSurvey ID.
options.silentbooleanIf true, no survey_closed event is sent to the API.

Not supported for embed surveys.

ftools('destroy', surveyId)

Destroys a survey completely — unmounts from the DOM, cancels triggers, and frees the ID. Works for both popup and embed surveys. After this, init() with the same ID starts fresh.

ftools('destroy', 'SURVEY_ID');

Use this in component cleanup functions (e.g. useEffect cleanup, onUnmounted) to properly clean up embed surveys.

ftools('destroyAll')

Destroys the entire SDK instance — unmounts all surveys, cancels all triggers, removes the feedback button, and restores the patched History API. window.ftools should not be used after calling this.

ftools('destroyAll');

Use this for complete teardown when you need to fully remove the SDK from the page.