formbricks/formbricks

[FEATURE] Trigger surveys on user attributes changes

Closed this issue · 5 comments

Is your feature request related to a problem? Please describe.

No, it's not related to a problem.

Describe the solution you'd like

Currently, we can only trigger surveys by selecting "Actions", so we are forced to do it in our code by using the Code Actions.

I think it would be a great feature if we can also establish a listener when an attribute of a user changed, or changed to a specific value, etc.
Maybe can be solved by firing actions automatically when attributes changed. Like the "New Session" action, create automatically actions every time we create an attribute.

Describe alternatives you've considered

No response

Additional context

No response

@saenzramiro thanks for the feature request :-) Can you share your specific use case in detail? that would help us build the best solution that fits your problem 😊

Sure! Here is my case:

Context: I have an attribute for the users where I save the plan he have and I update it every time the user changed the plan.

Uses cases:

  • I want to display a churn survey when the user downgrade the plan.
  • Another case is that we offer a trial of our paid plan and "trial" is treated as a plan, so if the user finish the trial and after 3 days of using our free plan, I want to display a survey.

hey @saenzramiro

if I understand your request correctly, you want to use an attribute to trigger a survey. However, this would blur the line between what attributes are meant to do and what actions are meant to do.

Generally:

  • attributes are for targeting: who can see which survey
  • actions are for triggering: when do we show the survey

We already have the complication that action can be used for targeting (e.g. a user clicked on a button 3 or more times). This makes sense to be able to target based on user behaviour.

However, if we now adding to this that a survey can be triggered on attribute change, it would get really messy: The targeting and trigger UI would get messy and translating that down into the JS widget logic gets messy.

You can achieve the use case you have in mind with the current functionality:

  1. Show churn survey: If attribute plan = "paid" and user clicks on button with innerText "Unsubscribe" on page "/billing" then show "Churn Survey". You might as well send a codeAction after you get the callback from Stripe that the subscription was downgraded (or whatever you to manage subscriptions).

Make sure to set the Recontact Options correctly so that the survey always appears, even if this user saw a survey in the days before.

  1. At this point, we do not yet support attributes in date format, so you would need to keep the logic for waiting 3 days to set the attribute in your app (which shouldn't be a big problem). You then set the attribute "ThreeDaysOfFreeUsage" and use this to target this cohort. You can then use any action to trigger it e.g. New Session.

Hope this clarifies it :)

Feel free to ask any follow up questions, happy to answer them.

Thanks!
Johannes

Thank you @jobenjada for your reply.

I'm trying to get the point of the problem... Why is it not a good solution to add them as Automatic Actions (like "New Session", 50% Scroll, and Exit Intent)? So for every attribute that we create, it will be an automatic action for the change. The targeting and trigger UI shouldn't be messy, we now select "New Session" and will select the action "Attribute 'plan' changed" for example.

@saenzramiro For now we would like to leave this up to the developer. Since we have users with over 50 attributes, we would be spamming their actions with a lot of automatic actions.
Also, as Johannes explained, attributes solve a different purpose than actions.
I understand your use case and why you want to do this, but I think for now it's best if you build a custom logic for yourself where you check which attribute changes you care about and then fire a code action to trigger a survey about it.
I will close this issue for now. If it comes up again, or if our current review of survey triggering changes the situation, we will reopen it.