Compare commits

..

1 Commits

Author SHA1 Message Date
Cursor Agent c225d0ddab fix: wrap custom inline scripts in try-catch to prevent ReferenceError crashes 2026-01-17 18:33:18 +00:00
18 changed files with 34 additions and 84 deletions
@@ -56,9 +56,16 @@ export const CustomScriptsInjector = ({
newScript.setAttribute(attr.name, attr.value);
});
// Copy inline script content
// Copy inline script content with error handling
if (script.textContent) {
newScript.textContent = script.textContent;
// Wrap inline scripts in try-catch to prevent user script errors from breaking the survey
newScript.textContent = `
try {
${script.textContent}
} catch (error) {
console.warn('[Formbricks] Error in custom script:', error);
}
`.trim();
}
document.head.appendChild(newScript);
@@ -9,7 +9,7 @@ icon: "map-pin"
src="https://app.formbricks.com/s/m8w91e8wi52pdao8un1f4twu"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -9,7 +9,7 @@ icon: "check"
src="https://app.formbricks.com/s/orxp15pca6x2nfr3v8pttpwm"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -9,7 +9,7 @@ icon: "address-book"
src="https://app.formbricks.com/s/z2zjoonfeythx5n6z5qijbsg"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -9,7 +9,7 @@ icon: "calendar"
src="https://app.formbricks.com/s/rk844spc8ffls25vzkxzzhse"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -15,7 +15,7 @@ icon: "upload"
src="https://app.formbricks.com/s/oo4e6vva48w0trn01ht8krwo"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -12,7 +12,7 @@ Free text questions allow respondents to enter a custom answer. Displays a title
src="https://app.formbricks.com/s/cm2b2eftv000012b0l3htbu0a"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -11,7 +11,7 @@ The values range from 0 to a user-defined maximum (e.g., 0 to X). The selection
src="https://app.formbricks.com/s/obqeey0574jig4lo2gqyv51e"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -10,7 +10,7 @@ icon: "presentation-screen"
src="https://app.formbricks.com/s/vqmpasmnt5qcpsa4enheips0"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -9,7 +9,7 @@ icon: "ranking-star"
src="https://app.formbricks.com/s/z6s84x9wbyk0yqqtfaz238px"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -11,7 +11,7 @@ Rating questions allow respondents to rate questions on a scale. Displays a titl
src="https://app.formbricks.com/s/cx7u4n6hwvc3nztuk4vdezl9"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -38,35 +38,8 @@ Select the icon to be used for the rating scale. The options include: stars, num
### Range
Select the range of the rating scale. the options include: 3, 4, 5, 6, 7 or 10. The default is 5.
Select the range of the rating scale. the options include: 3, 4, 5, 7 or 10. The default is 5.
### Labels
Add labels for the lower and upper bounds of the rating scale. The default is "Not good" and "Very good".
## CSAT Summary
After collecting responses, rating questions display a CSAT (Customer Satisfaction) score with a visual traffic light indicator to help you quickly assess satisfaction levels:
- 🟢 **Green** (> 80%): High satisfaction - your users are very satisfied
- 🟠 **Orange** (55-80%): Moderate satisfaction - there's room for improvement
- 🔴 **Red** (< 55%): Low satisfaction - immediate attention needed
<Note>The traffic light indicator appears automatically in the survey summary view, giving you instant feedback on user satisfaction without needing to dig into the data.</Note>
### How CSAT is Calculated
The CSAT percentage represents the proportion of respondents who gave a "satisfied" rating. What counts as "satisfied" depends on your selected range:
| Range | Satisfied Ratings | Examples |
|-------|------------------|----------|
| 3 | Highest rating only | ⭐⭐⭐ |
| 4 | Top 2 ratings | ⭐⭐⭐ or ⭐⭐⭐⭐ |
| 5 | Top 2 ratings | ⭐⭐⭐⭐ or ⭐⭐⭐⭐⭐ |
| 6 | Top 2 ratings | 5 or 6 |
| 7 | Top 2 ratings | 6 or 7 |
| 10 | Top 3 ratings | 8, 9, or 10 |
<Note>
**Pro Tip:** For most use cases, a 5-point scale with star or smiley icons provides the best balance between granularity and user experience. Users find it easy to understand and quick to complete.
</Note>
@@ -9,7 +9,7 @@ icon: "calendar-check"
src="https://app.formbricks.com/s/hx08x27c2aghywh57rroe6fi"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -12,7 +12,7 @@ Multi select questions allow respondents to select several answers from a list.
src="https://app.formbricks.com/s/jhyo6lwzf6eh3fyplhlp7h5f"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -17,7 +17,7 @@ Picture selection questions allow respondents to select one or more images from
src="https://app.formbricks.com/s/xtgmwxlk7jxxr4oi6ym7odki"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -12,7 +12,7 @@ Single select questions allow respondents to select one answer from a list. Disp
src="https://app.formbricks.com/s/wybd3v3cxpdfve4472fu3lhi"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -11,7 +11,7 @@ It consists of a title (can be Question or Short Note) and a description, which
src="https://app.formbricks.com/s/k3p7r7riyy504u4zziqat8zj"
style={{
position: "relative",
height: "600px",
height: "90vh",
maxHeight: "100vh",
width: "100%",
border: 0,
@@ -14,7 +14,7 @@ Recontact options are the last layer of the logic that determines if a survey is
3. **Recontact Options:** Should the survey be shown (again) to this user? That's dependent on:
- Did the user see any survey recently (meaning, has Survey Cooldown passed)?
- Did the user see any survey recently (meaning, has Global Waiting Time passed)?
- Did the user see this specific survey already?
@@ -50,13 +50,13 @@ Available Recontact Options include:
![Choose Recontanct Options for the Survey](/images/xm-and-surveys/surveys/website-app-surveys/recontact/survey-recontact.webp)
## Project-wide Survey Cooldown
## Project-wide Global Waiting Time
The Survey Cooldown is a universal blocker to make sure that no user sees too many surveys. This is particularly helpful when several teams of large organisations use Formbricks at the same time.
The Global Waiting Time is a universal blocker to make sure that no user sees too many surveys. This is particularly helpful when several teams of large organisations use Formbricks at the same time.
<Note>The default Survey Cooldown is set to 7 days.</Note>
<Note>The default Global Waiting Time is set to 7 days.</Note>
To adjust the Survey Cooldown:
To adjust the Global Waiting Time:
1. Visit Formbricks Settings
@@ -68,9 +68,9 @@ To adjust the Survey Cooldown:
![Formbricks Project-Wide Wait Time](/images/xm-and-surveys/surveys/website-app-surveys/recontact/global-wait-time.webp)
## Overriding Survey Cooldown for a Specific Survey
## Overriding Global Waiting Time for a Specific Survey
For specific surveys, you may need to override the default cooldown. Below is how you can do that:
For specific surveys, you may need to override the default waiting time. Below is how you can do that:
1. In the Survey Editor, access the Settings Tab.
@@ -80,11 +80,11 @@ For specific surveys, you may need to override the default cooldown. Below is ho
4. Set a custom recontact period:
- **Always Show Survey**: Displays the survey whenever triggered, ignoring the cooldown.
- **Always Show Survey**: Displays the survey whenever triggered, ignoring the waiting time.
- **Wait `X` days before showing this survey again**: Sets a specific interval before the survey can be shown again.
![Ignore Survey Cooldown for a Specific Survey](/images/xm-and-surveys/surveys/website-app-surveys/recontact/ignore-wait-time.webp)
![Ignore Global Waiting Time for a Specific Survey](/images/xm-and-surveys/surveys/website-app-surveys/recontact/ignore-wait-time.webp)
---
-30
View File
@@ -1,30 +0,0 @@
const express = require('express');
const app = express();
const port = 3000;
// Fake data for the activity feed
const activityFeed = [
{
id: 1000,
title: 'New Photo Uploaded',
body: 'Alice uploaded a new photo to her album.'
},
{
id: 2000,
title: 'Comment on Post',
body: "Bob commented on Charlie's post."
},
{
id: 13,
title: 'Status Update',
body: 'Charlie updated their status: "Excited about the new project!"'
}
];
app.get('/feed', (req, res) => {
res.json(activityFeed);
});
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});