Prerequisites
Before using the AppSloth Retention Modal component, make sure you’ve:- Set up AppSloth in your project
- Installed the required shadcn/ui components:
Adding the Retention Modal Component
The AppSloth Retention Modal component provides a customizable retention flow for your application. It includes features like multi-step feedback collection, custom offer presentation, and detailed analytics tracking. Adding the Retention Modal component to your application is straightforward:The Retention Modal is typically used in subscription management or account
settings pages where users might consider canceling their service.
How It Works
The Retention Modal provides a comprehensive retention flow:- Feedback Collection: Gathers user feedback through predefined options and free-form text
- Retention Offer: Optional step to present a special offer to retain the customer
- Analytics Tracking: Automatically tracks all retention-related events
- Customizable UI: Extensive styling and configuration options
- Flexible Callbacks: Custom handlers for feedback, offers, and cancellation
Customization Options
The Retention Modal component is highly customizable through props:Button Customization
Customize the trigger button:Feedback Page Customization
Customize the feedback collection page:Offer Page Customization
Configure the retention offer page:Custom Event Handling
Implement custom handlers for various events:Component Props
| Prop | Type | Default | Description |
|---|---|---|---|
buttonText | string | ”Cancel” | Text for the trigger button |
buttonClassName | string | "" | Additional classes for the button |
buttonVariant | "default" | "outline" | "ghost" | "link" | ”outline” | Button variant style |
customerId | string | Required | The customer ID |
feedbackTitle | string | ”We’re Sorry to See You Go” | Title for feedback page |
feedbackDescription | string | ”Please help us understand…” | Description for feedback page |
feedbackOptions | string[] | [Default options] | Array of feedback options |
feedbackTextareaPlaceholder | string | ”Any additional feedback?” | Placeholder for feedback textarea |
feedbackTextareaClassName | string | "" | Additional classes for textarea |
feedbackContinueButtonText | string | ”Continue” | Text for continue button |
feedbackCancelButtonText | string | ”Cancel” | Text for cancel button |
feedbackContinueButtonClassName | string | "" | Classes for continue button |
feedbackCancelButtonClassName | string | "" | Classes for cancel button |
feedbackContinueButtonVariant | ButtonVariant | ”default” | Continue button variant |
feedbackCancelButtonVariant | ButtonVariant | ”outline” | Cancel button variant |
offer | OfferDetails | undefined | Configuration for retention offer |
onChurn | () => void | Required | Callback when user churns |
onSubmitFeedback | (feedback: string) => void | undefined | Callback for feedback submission |
Viewing Retention Analytics
All retention-related events are tracked and can be analyzed in your AppSloth Dashboard:- Log into your AppSloth Dashboard
- Navigate to the “Retention” section
- Analyze your retention metrics:
- View churn rates
- Analyze feedback patterns
- Track offer acceptance rates
- Monitor retention effectiveness
