Skip to content

feat: Added longterm retention check in template#4061

Merged
jobenjada merged 2 commits intoformbricks:mainfrom
thefool76:main
Oct 28, 2024
Merged

feat: Added longterm retention check in template#4061
jobenjada merged 2 commits intoformbricks:mainfrom
thefool76:main

Conversation

@thefool76
Copy link
Contributor

@thefool76 thefool76 commented Oct 27, 2024

What does this PR do?

I have added the longTerm Retention Check In template
Retention Insights: Pinpoints key retention factors and loyalty drivers, helping you understand what keeps users engaged long-term

for Saas product, any industry etc

Fixes # (issue)

Video Demo
Click here to watch

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 🙏

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Summary by CodeRabbit

  • New Features
    • Introduced a new survey template, longTermRetentionCheckIn, to assess long-term user satisfaction and loyalty.
    • The survey includes various question types to gather comprehensive feedback on user experience and product improvements.

@vercel
Copy link

vercel bot commented Oct 27, 2024

@thefool76 is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2024

Walkthrough

A new function named longTermRetentionCheckIn has been added to the packages/lib/templates.ts file. This function creates a survey template designed to assess long-term user satisfaction and loyalty. It includes a variety of question types aimed at gathering detailed feedback from users regarding their experiences and expectations with the product.

Changes

File Change Summary
packages/lib/templates.ts Added longTermRetentionCheckIn() function to define a comprehensive survey template for user feedback on long-term satisfaction and loyalty.

Possibly related PRs

  • feat: [🕹️] Add Template to Library (150 points) #3947: This PR adds a new survey template for "Employee Satisfaction" in the same packages/lib/templates.ts file, which is relevant as it involves the addition of a new template similar to the longTermRetentionCheckIn function added in the main PR.
  • feat: add Employee Well-Being template #3981: This PR introduces an "Employee Well-Being" survey template in the same packages/lib/templates.ts file, which also relates to the addition of new survey functionalities similar to those in the main PR.

Suggested labels

hacktoberfest, 🕹️ oss.gg, 🕹️ 150 points

Poem

In the garden of feedback, we hop and we play,
With questions that guide us, come what may.
Long-term retention, we seek to embrace,
To cherish our users, their smiles we’ll trace.
So let’s gather their thoughts, both big and small,
For a happier product, we’ll listen to all! 🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fd3cbbf and cd65038.

📒 Files selected for processing (1)
  • packages/lib/templates.ts (2 hunks)
🔇 Additional comments (3)
packages/lib/templates.ts (3)

5326-5334: LGTM! Function signature and metadata are well-defined.

The template metadata accurately describes its purpose and target audience, aligning well with the PR objective of enhancing retention insights.


5335-5445: LGTM! Well-structured survey with comprehensive question flow.

The survey effectively covers key aspects of long-term retention:

  • Overall satisfaction
  • Value proposition
  • Feature preferences
  • Pain points
  • NPS
  • Future improvements
  • Product updates satisfaction

The mix of quantitative and qualitative questions will provide rich insights into user retention factors.


5491-5491: LGTM! Template correctly registered.

The template is properly added to the templates array, maintaining consistency with the existing pattern.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 47826a4 and fd3cbbf.

📒 Files selected for processing (1)
  • packages/lib/templates.ts (2 hunks)
🔇 Additional comments (2)
packages/lib/templates.ts (2)

5326-5458: Well-structured implementation with comprehensive retention assessment.

The implementation provides a thorough assessment of user satisfaction and retention factors through a well-balanced mix of question types and topics.


5502-5502: LGTM: Clean integration into templates array.

The new template is correctly integrated into the exports, maintaining consistency with the existing pattern.

Comment on lines +5339 to +5346
type: TSurveyQuestionTypeEnum.Rating,
range: 5,
scale: "star",
headline: { default: "How satisfied are you with our product overall?" },
required: true,
lowerLabel: { default: "Not satisfied" },
upperLabel: { default: "Very satisfied" },
isColorCodingEnabled: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider standardizing rating scales for consistency.

The template uses different rating scales (star, number, smiley) which might lead to inconsistent data analysis. Consider standardizing to use the same scale type for similar questions, particularly for satisfaction-related metrics.

Example standardization:

-          scale: "star",
+          scale: "number",

Also applies to: 5372-5379, 5404-5412, 5438-5445

Comment on lines +5336 to +5455
questions: [
{
id: createId(),
type: TSurveyQuestionTypeEnum.Rating,
range: 5,
scale: "star",
headline: { default: "How satisfied are you with our product overall?" },
required: true,
lowerLabel: { default: "Not satisfied" },
upperLabel: { default: "Very satisfied" },
isColorCodingEnabled: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.OpenText,
headline: { default: "What do you find most valuable about our product?" },
required: false,
placeholder: { default: "Describe the feature or benefit you value most..." },
inputType: "text",
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.MultipleChoiceSingle,
shuffleOption: "none",
choices: [
{ id: createId(), label: { default: "Features" } },
{ id: createId(), label: { default: "Customer support" } },
{ id: createId(), label: { default: "User experience" } },
{ id: createId(), label: { default: "Pricing" } },
{ id: createId(), label: { default: "Reliability and uptime" } },
],
headline: { default: "Which aspect of our product do you find most essential to your experience?" },
required: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.Rating,
range: 5,
scale: "number",
headline: { default: "How well does our product meet your expectations?" },
required: true,
lowerLabel: { default: "Falls short" },
upperLabel: { default: "Exceeds expectations" },
isColorCodingEnabled: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.OpenText,
headline: { default: "What challenges or frustrations have you faced while using our product?" },
required: false,
placeholder: { default: "Describe any challenges or improvements you’d like to see..." },
inputType: "text",
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.MultipleChoiceSingle,
shuffleOption: "none",
choices: [
{ id: createId(), label: { default: "Very likely" } },
{ id: createId(), label: { default: "Somewhat likely" } },
{ id: createId(), label: { default: "Neutral" } },
{ id: createId(), label: { default: "Somewhat unlikely" } },
{ id: createId(), label: { default: "Very unlikely" } },
],
headline: { default: "How likely are you to recommend our product to others?" },
required: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.Rating,
range: 10,
scale: "number",
headline: { default: "On a scale of 1-10, how would you rate our product's impact on your goals?" },
required: true,
lowerLabel: { default: "Low impact" },
upperLabel: { default: "High impact" },
isColorCodingEnabled: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.MultipleChoiceMulti,
shuffleOption: "none",
choices: [
{ id: createId(), label: { default: "New features and improvements" } },
{ id: createId(), label: { default: "Enhanced customer support" } },
{ id: createId(), label: { default: "Better pricing options" } },
{ id: createId(), label: { default: "More integrations" } },
{ id: createId(), label: { default: "User experience refinements" } },
],
headline: { default: "What would make you more likely to remain a long-term user?" },
required: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.OpenText,
headline: { default: "If you could change one thing about our product, what would it be?" },
required: false,
placeholder: { default: "Share any changes or features you wish we’d consider..." },
inputType: "text",
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.Rating,
range: 5,
scale: "smiley",
headline: { default: "How happy are you with our product updates and frequency?" },
required: true,
lowerLabel: { default: "Not happy" },
upperLabel: { default: "Very happy" },
isColorCodingEnabled: true,
},
{
id: createId(),
type: TSurveyQuestionTypeEnum.OpenText,
headline: { default: "Any additional feedback or comments?" },
required: false,
placeholder: { default: "Share any thoughts or feedback that might help us improve..." },
inputType: "text",
},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding branching logic for deeper insights.

The survey could benefit from conditional branching logic to dive deeper into specific responses. For example, when users indicate low satisfaction, you could ask follow-up questions about specific pain points.

Example addition for the first satisfaction question:

 {
   id: createId(),
   type: TSurveyQuestionTypeEnum.Rating,
   range: 5,
   scale: "number",
   headline: { default: "How satisfied are you with our product overall?" },
   required: true,
   lowerLabel: { default: "Not satisfied" },
   upperLabel: { default: "Very satisfied" },
   isColorCodingEnabled: true,
+  logic: [
+    {
+      id: createId(),
+      conditions: {
+        id: createId(),
+        connector: "and",
+        conditions: [
+          {
+            id: createId(),
+            leftOperand: {
+              value: "currentQuestionId",
+              type: "question",
+            },
+            operator: "isLessThanOrEqual",
+            rightOperand: {
+              type: "static",
+              value: 2,
+            },
+          },
+        ],
+      },
+      actions: [
+        {
+          id: createId(),
+          objective: "jumpToQuestion",
+          target: "specificPainPointsQuestionId",
+        },
+      ],
+    },
+  ],
 },

Committable suggestion was skipped due to low confidence.

Copy link
Member

@jobenjada jobenjada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tweaked it a bit, thanks! :)

@jobenjada jobenjada added hacktoberfest complete these issues to gather points for Hacktoberfest 🕹️ oss.gg Community issue via oss.gg 🕹️ 300 points labels Oct 27, 2024
@jobenjada jobenjada enabled auto-merge October 27, 2024 19:53
@jobenjada jobenjada added this pull request to the merge queue Oct 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 27, 2024
@jobenjada jobenjada added this pull request to the merge queue Oct 28, 2024
Merged via the queue into formbricks:main with commit 33543f5 Oct 28, 2024
@oss-gg
Copy link

oss-gg bot commented Oct 28, 2024

Awarding thefool76: 300 points 🕹️ Well done! Check out your new contribution on oss.gg/thefool76

jonas-hoebenreich pushed a commit to jonas-hoebenreich/formbricks that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest complete these issues to gather points for Hacktoberfest 🕹️ oss.gg Community issue via oss.gg 🕹️ 300 points

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants