Set up show conditions
1
Open the Survey Trigger card
In the survey editor, go to Settings and open the Survey Trigger card. Show conditions are for website and app surveys; link surveys don’t have them.
2
Add a condition
Under …and only show it, click Add condition. Pick what to check, how to compare, and the value. Add more conditions with the row menu, and choose whether all or any of them must hold.
3
Group conditions when you need both
To mix “all” and “any” in one rule, use Create group in a row’s menu. A group can’t hold another group.
4
Test your URL
Paste a URL into Test your URL to see which of your URL conditions it matches, before you publish.
What you can check
Text comparisons ignore upper and lower case.Pasting a list of pages
Paste one entry per line. Blank lines are ignored, and a list can hold up to 200 entries. A line is always one entry:/plans, /pricing is never split into two. The two kinds of list match differently:
- Path is any of and path is none of (Current URL only) compare each line with the page’s path, exactly.
/plansmatcheshttps://www.medicare.gov/plansand/plans?ref=email, but not/plans/compare. Case, a trailing slash, the query string and the#hashdon’t count, and a full URL pasted from the address bar is reduced to its path. A new Current URL condition starts with path is any of. - Contains any of and contains none of pass when the URL contains a line anywhere, so one line covers a whole section:
/plansalso matches/plans/compare. Keep fragments specific, because/blog/planningalso matches/blog/planning-for-retirement.
What counts as a visit
A visit is one browser tab. A new tab starts a new visit; reloading, going back, or leaving the site and coming back in the same tab continues it. Time on site counts only time on your own pages, so time spent on another site in between is left out. A change of only the URL’s#hash is not a new page.
Pages are told apart by their path, the same way path is any of compares them: /plans, /plans/ and /Plans are one page. A visit remembers up to 200 different pages; past that, Unique pages viewed stops counting and Visited URL doesn’t see the newer ones.
If the visitor’s browser blocks storage, the visit can’t be recorded and every visit condition fails, so the survey doesn’t show. Page and device conditions still work.
When conditions are checked
Conditions are checked when a trigger fires, and again right before the survey appears: after its delay if it has one, so time on site has grown and a visitor who moved to an excluded page in the meantime doesn’t see it. Conditions never show a survey by themselves: a visitor who meets them but triggers nothing sees nothing. They apply on top of everything else that decides whether a survey shows: the action’s own page filters, Recontact Options, the Cooldown Period and segment targeting. The display percentage comes after them, so it samples only visitors who meet the conditions. See Survey Display Logic for the full order.Find out why a survey didn’t show
Add?formbricksDebug=true to the URL of a page with the Formbricks snippet. A small debug panel opens in the corner of the page and lists, for every survey on a trigger that fired:
- whether it was dropped before the trigger fired, and why (shown once already, already answered, display limit, Cooldown Period, segment);
- each show condition with what it read on this page, marked ✓ or ✗, grouped as in the editor: every “all of” or “any of” group shows its own ✓ or ✗, so a ✗ inside an “any of” group that passed did not stop the survey;
- whether the display percentage or another open survey stopped it.
?formbricksDebug=false.
Read the same information in code
In debug mode, the SDK sends the same information as aformbricks_debug event. Subscribe to it to log it or to check it in a test:
dataLayer, because it contains the visitor’s URLs and referrers. Its shape can change between versions, so use it for debugging, not to build features on.
What lands on each response
Every response to a website survey records the visit at the moment the survey showed, as five reserved fields: Pages Viewed, Unique Pages Viewed, Time on Site, Entry Referrer and Visited URLs. They appear on the response card, as table columns, in the response filter and in the CSV export, and you can use them in survey logic and recall. Visited URLs is the journey in order: the first page and the last 49 steps.The Device shown on a response comes from the server, which can’t tell an iPad from a Mac: iPads are recorded as desktop there. The Device show condition runs in the browser and detects them as tablets.
Still have questions? Join us in GitHub Discussions and we’ll be glad to help.