How to show or hide your form on specific pages?
updated 5 months ago
Gist makes it easy to show or hide your forms on specific pages using our Display Rules.
To better understand how URL targeting works, it is good to understand the components that make up a URL. Gist offers two types of URL targeting conditions:
Current URL - Target visitors who are on the selected URL. There are a few ways to target by URL, some of which are “is exactly/is not exactly," and "matches a pattern."
Current URL Path - Target visitors who are on a specific path. The /path is the part of the URL that appears after the root domain (app.getgist.com/settings)
When you see URL path mentioned in this article, the URL path is a specific portion of a web page’s URL, but not the full URL. The URL path is the text after the domain.
Configure Display Rules
To show or hide your form on specific pages using the URL path, follow these steps:
1. In the form builder, navigate to the Display Rules tab from the top menu.
2. Click on the Add condition set button and select the Current URL path rule to configure how your form should be shown or hidden.
3. The following options are available for current URL path:
- is any page - Targets all pages on your website.
- is the homepage - Targets your homepage.
- is not the homepage - Excludes your homepage.
- is exactly - Targets a specific URL, including the protocol, which can include a query string and fragment.
- is not exactly - Excludes a specific URL, including the protocol, which can include a query string and fragment.
- contains - Target all pages which contain the entered text. This rule is case sensitive.
- does not contain - Excludes all pages which contain the entered text. This rule is case sensitive.
- starts with - Target all pages that have a URL, including the protocol, which starts with the entered text.
- does not start with - Excludes all pages that have a URL, including the protocol, which starts with the entered text.
- ends with - Target all pages that have a URL which ends in the entered text.
- does not end with - Excludes all pages that have a URL which ends in the entered text.
- matches the pattern - Targets all pages which match a unique text string for describing a search pattern.
Some example configurations are provided below to help get you started:
Display on Specific Pages
The following rules are positive (or inclusionary) and can be used to target specific pages you want your form to show on:
- is the homepage
- Is exactly
- starts with
- ends with
- matches the pattern
In the following example, the form is configured to load only when the page URL exactly matches http://website.com/how-it-works/
If you want to show the form on several specific pages using the inclusionary rules listed above you need to use the OR condition.
If you add multiple inclusionary conditions with the AND option, you have essentially set the form to only show if:
the Current URL path is exactly Page-1
AND the Current URL path is exactly Page-2
And all of those at the same time. But it is impossible for a URL to be both: yourwebsite.com/Page-1 AND yourwebsite.com/Page-2 at the same time. Instead, you want to show the form “IF the Current URL Path is exactly this: Page-1 ” OR “IF the Current URL Path is exactly this: Page-2”.
Hide on Specific Pages
The following rules are negative (or exclusionary) and can be used to target specific pages you do not want your form to show on:
- is not the homepage
- does not exactly match
- does not contain
- does not start with
- does not end with
In the following example, the form is configured to show on all pages except:
- The page ‘How it Works’: https://website.com/how-it-works
- Pages where the URL path contains the keyword ‘instructions’ like: https://website.com/easy-instructions
- The homepage: https://website.com
Note that unlike with the inclusionary rules listed above in the Display on Specific Pages section, the exclusionary rules are separated by an AND condition, as you want to check that the current URL does not contain or exactly match all of the conditions at the same time.
Display When the URL Matches a Specific Pattern
You can use the asterisk (*) at any point in your URL path to match certain patterns. For example, matches a pattern t*st would match:
/foo/* does not match /foo but /foo* does match.
You can even include multiple asterisk characters for more flexibility in your patterns.
For example, matches a pattern /category/*/post/* would match: yourwebsite.com/category/marketing/post/ab-testing
If you have any further questions, please start a Live Chat. Just "Click" on the Chat Icon in the lower right corner to talk with our support team.