[BUG] on-the-fly triggers do not work with displayPercentage
Closed this issue · 1 comments
jonas-hoebenreich commented
Issue Summary
When you use an on-the-fly URL trigger the survey does not take the displayPercentage into account.
The issue is that renderWidget is called for inline triggers: https://github.com/formbricks/formbricks/blob/main/packages/js/src/lib/noCodeActions.ts#L63
suggestion: I know this might be a bit late, but I think a different architecture for inlineTriggers would be better:
- Add an attribute
inline
toActionClass
. If inline is true, do not show it in the Actions & Attributes panel in the backend and exclude from action search. - Add an option to the survey editor to add a trigger, these actions will be inline (but only visible for this survey).
- The sync API should return inline actions just like normal actions.
This has the following advantages: a) every feature for reusable action will also work for inline actions and vice versa and b) it reduces complexity and reduces file size of the frontend pixel.
Steps to Reproduce
- Add survey, set displayPercentage to 1%, set URL on-the-fly trigger.
- Open targeted page.
- Survey pops up.
Expected behavior
expected:
Survey pops up in 1% of page loads.
actual:
Survey pops up in 100% of page loads.
Other information
No response
Screenshots
No response
Environment
- Formbricks Cloud (app.formbricks.com)
- Self-hosted Formbricks
Desktop (please complete the following information)
- js 1.6.4
jobenjada commented
hey @jonas-hoebenreich - thanks for flagging this, we'll look into it a ship a fix asap