Avoiding survey prompts during destructive confirmation
A survey prompt that appears while a user is confirming a destructive action — deleting a project, revoking a teammate, purging data — creates frustration and skews responses. The fix is to suppress any in-app survey when the current URL or DOM contains a destructive confirmation pattern.
Identify destructive confirmation pages
List every route where a user must type a name, check a "I understand" box, or click a red button labeled "Delete", "Revoke", "Purge", or "Remove permanently". Examples:
- /workspaces/:id/delete
- /projects/:id/confirm-delete
- /members/:id/revoke-access
Add a suppression flag to the page context
When rendering any of those pages, set a global JavaScript variable or data attribute:
<body data-destructive-confirmation="true">
Modify the survey loader to check the flag
Before any survey script decides to show, run:
if (document.body.dataset.destructiveConfirmation === 'true') {
console.log('Survey suppressed: destructive confirmation page');
return;
}
Worked verification
| Page | data-destructive-confirmation | Survey shown? |
|---|---|---|
| /settings/profile | (absent) | Yes |
| /projects/abc123/confirm-delete | true | No |
| /workspaces/ws_3x8q/delete | true | No |
| /billing/upgrade | (absent) | Yes |
Reusable suppression snippet
Add this to your base survey loader:
const SUPPRESS_SELECTORS = [
'[data-destructive-confirmation="true"]',
'.confirm-delete-modal',
'.revoke-access-dialog'
];
function isSuppressed() {
return SUPPRESS_SELECTORS.some(sel => document.querySelector(sel));
}
if (isSuppressed()) return; // abort survey initialization
Exception: a post-action survey after the deletion completes (on the success toast page) is appropriate — the destructive moment has passed.
After deploying the snippet, verify that the "Survey Impressions on Delete Pages" counter drops to zero, while overall survey impression volume stays within 2% of baseline.
Related: Onboarding Tours features.
