Display rules: Control where the chat is displayed


Display rules are powerful tools in Kundo Chat that allows you to control exactly on which pages the button that starts the chat should be displayed on, but also on which pages the chat will continue being displayed when the user clicks on a link.

If you use the Chat Assistant, a display rule can be used to ensure that the chat will continue being shown when the visitor moves from the Chat Assistant into a forum or a knowledge bank.

Two types of display rules

There are two types of display rules, display-rules and hide-rules.

Display-rules make the chat button (the button where you start a chat) appear, and also allow ongoing chats to continue being shown on that page, e.g. if the user clicks on a link to the page.

Hide-rules hide the chat button, but still allow ongoing chat conversations to show up on the page. If you want to be able to send links to a specific page, and that the chat keeps showing up there, but not that users should be able to start new chats from that page, then a hide-rule is the right thing to use.

How does a rule match a particular page?

Each rule consists of an address and all protocols are automatically allowed for that address (http and https).

  • Address (or URL) of the page, i.e. the domain and address of the page on your domain on which the chat is to be displayed. This address contains two parts:
    • The domain is used to check that the chat script can be run on this page. If the script tries to load on a domain that is not defined in any display rule (display- or hide-rule), the script will not load. In this case, an error message is printed in the browser's Developer Tools.

      If the domain on which the script is loaded matches, then the path is checked to see which of the rules are to be matched.

      Only exact domains are matched, so if you have multiple subdomains, you need to have a display rule for each subdomain, or add a domain with "*" in it, e.g. "* .example.com".
    • The path is used to check if this particular address on the site should include the chat or not. Here you can use * ("star") to match multiple pages, or build patterns with * to cause some pages to appear, and some not.

      If multiple paths match a page, the one that is most specific will be selected. For example "/test/page/" is more specific than just "/test/".

      This applies to both display- and hide-rules. By combining the two types of rules you can for example say that "The chat should be displayed on our customer service pages, but not on the customer service page where you cancel your account". Such a rule could consist of two rules: a display-rule for "example.com/service/*" and a hide-rule for "example.com/service/cancel/*".

How do we select where the chat button should appear?

In order for the chat button to be displayed on a particular page, three criteria need to be met:

  1. The chat script needs to be embedded in the code on your website. Typically, this is done via a setting in your CMS. The script is what loads the chat from Kundo and starts either the chat button or displays an ongoing chat.

    Since the chat script is unique to your organization, it is enough to enter it once for several chat flows to be able to display the chat button.
  2. There needs to be a display-rule that matches the page on which the chat is to be displayed. See description of matching display-rules above.
  3. At least one editor needs to be online in the chat, or the "Show the chat button even when no editor is available" function is activated. The default behaviour is to hide the button when no editor is available to answer questions.

All pages that display the chat button will automatically support chats that have linked to that page.

How do I let an ongoing chat keep showing up without displaying the chat button?

In order for chats to be able to continue being displayed when you click on a link in the chat, the following two things need to be fulfilled:

  1. The chat script needs to be embedded in the code on your website (see above).
  2. The domain to which the user clicks a link needs to be in some display- or hide-rule. Note that the path does NOT need to match, but chats will automatically be allowed on all pages on the entire domain. This means that chats will automatically follow to example.com even if you have only added a display- or hide-rule for example.com/service

Here you can read more about the security behind the display rules

Guide tagged with: chat whitelist display rules