Website Surveys

Actions & Targeting

For public-facing websites, landing pages, and pages without user authentication walls, actions serve as effective triggers for displaying surveys. This method is particularly suitable for engaging general audiences, where individual user tracking is not required or feasible.

Actions in this context are straightforward triggers based on interactions with your website, allowing you to capture feedback precisely when it's most relevant.

How Do Actions Work?

Actions are predefined events within your website that prompt Formbricks to display a survey when triggered. These are detected by the Formbricks widget, which then presents the appropriate survey based on your predefined settings.

Why Are Actions Useful?

Actions enable surveys to be displayed based on specific site interactions or behaviours, independent of user identity. This approach is perfect for:

  • Public-Facing Websites: Engage visitors on general content pages where user authentication is not present.
  • Anonymous User Interactions: Capture feedback without needing to identify or track individual users, maintaining user privacy and simplicity in data collection.

Using actions to trigger surveys enhances the relevance of survey content to the visitor's current interaction, potentially increasing engagement and the accuracy of feedback.

Setting Up No-Code Actions

Formbricks provides an intuitive No-Code interface for configuring actions, enabling surveys to be triggered by various interactions on your website. To add a No-Code Action:

  1. Visit the Formbricks Dashboard & switch to the Actions tab:

    Choose a link survey template
  2. Now click on “Add Action”

    Choose a link survey template

    Here are three types of No-Code actions you can set up:

1. Page URL Action

Triggers a survey when a specific URL page condition is met. Setup options include:

  • exactMatch: Triggers the survey when the URL exactly matches the specified string.
  • contains: Triggers the survey when the URL contains a specified substring.
  • startsWith: Triggers the survey when the URL starts with a specified string.
  • endsWith: Triggers the survey when the URL ends with a specified string.
  • notMatch: Triggers the survey when the URL does not match a specified condition.
  • notContains: Triggers the survey when the URL does not contain a specified substring.

2. innerText Action

Activated when the innerText of a clicked HTML element, such as a button or link, matches specified text. This is useful for triggering surveys related to specific content interactions.

3. CSS Selector Action

Triggers a survey when a clicked HTML element matches a specified CSS selector, such as a class, ID, or other CSS selector. This allows for precise control over survey triggers based on site structure and design.

Setting Up Code Actions

For enhanced customization, actions can also be implemented directly through code:

  1. Configure the Action: First, add the action via the Formbricks web interface to link it with the desired survey.
  2. Track an Action: Use the formbricks.track() function to activate the survey from your website's frontend.

Example of tracking an action

formbricks.track("Action Name");

Example - Tracking a Button Click:

Example: Button Click Action

const handleClick = () => {
  formbricks.track("Button Clicked");
};
return <button onClick={handleClick}>Click Me</button>;

Conclusion

Using generic actions to trigger surveys on your website provides a straightforward and effective method to engage visitors and gather feedback. This approach is especially valuable for public-facing websites and pages where user authentication barriers are absent, allowing for broad interaction and feedback collection without the complexities of user identification.

Was this page helpful?