IBM Cloud Docs
Guiding customers with journeys

Guiding customers with journeys

Beta

A journey is an interactive response that you can use to guide your customers through a complex task, or to give them a tour of new features, taking advantage of capabilities your website already supports. A journey is a multipart response that can combine text, video, and images presented in sequence.

This beta feature is available for evaluation and testing purposes only. Journeys require web chat version 6.9.0 or later.

When the customer starts a journey, the chat window temporarily closes. The web chat integration then presents the journey elements one step at a time in a small window superimposed over your website, enabling your customers to navigate and use the website as they step through the journey. At any time during the journey, the customer can freely return to the assistant chat window and then resume the journey.

Image showing examples of journey

You might use a journey in situations like the following examples:

  • Onboarding new customers to your product or website and showing them where everything is

  • Providing customers with step-by-step guidance for a complex task, like filing a claim or creating an account

  • Promoting sales opportunities in your product to target users during specific marketing opportunities, such as offering a new rewards program to customers who are concerned about expenses

For more information about deciding when and how to use journeys, see our best practices guide.

Creating a journey

A journey is defined using the user_defined response type, which is available only in the JSON editor. (For more information, see Defining responses using the JSON editor.) To create a journey, follow these steps:

  1. In the action editor, create or edit the step from which you want to start the journey.

  2. Click the Switch to JSON editor icon Switch to JSON editor icon to open the JSON editor.

  3. In the generic array, create a user_defined response. (For more information, see Defining responses using the JSON editor.)

    A journey is defined using the following structure:

    "user_defined": {
      "user_defined_type": "IBM_BETA_JOURNEYS_TOUR",
      "skip_card": true|false,
      "card_title": "{title}",
      "card_description": "{description}",
      "steps": [
        ...
      ]
    }
    

    where:

    user_defined_type

    The specific type of user-defined response you are defining. To define a journey, always set this property to IBM_BETA_JOURNEYS_TOUR.

    skip_card

    An optional property that specifies whether the web chat should start the journey immediately without waiting for the customer to click the introductory card in the web chat window. (The default value is false.)

    You can use this option to start a journey directly from your website, even if the web chat is not open. For more information, see Starting a journey without opening the web chat.

    card_title

    The title to display on the introductory card that appears in the web chat when a journey is available (for example, Website tour or Disputing a charge).

    card_description

    The description to display on the introductory card. Describe the journey so your customers can decide whether they want to open it.

    steps

    An array of responses defining the steps in the journey.

Defining steps

Each step in a journey is defined as a JSON object describing a response to be shown to the customer, using a format that is similar to how you define assistant responses directly in the generic array. Steps in a journey are shown to the customer one at a time, in the order in which you list them in the steps array.

As with assistant responses, the response_type property identifies the type of response:

text

A step that shows only text.

{
  "response_type": "text",
  "text": "This is the text of the response."
}

Markdown formatting and links are supported in text steps. For more information, see Markdown formatting.

Note that the structure of a text step in a journey is different from the text response type for assistant responses. Instead of an array of text values, only a single text component is supported.

image

A step that shows an image, along with an optional description.

{
  "response_type": "image",
  "source": "https://example.com/image.png",
  "description": "This is the description of the image."
}

The source property must be the https: URL of a publicly accessible image. The specified image must be in .jpg, .gif, or .png format.

video

A step that shows a video, along with an optional description.

{
  "response_type": "video",
  "source": "https://example.com/videos/example-video.mp4",
  "description": "This is the description of the video."
}

The URL specified by the source property can be either of the following:

  • The URL of a video file in a standard format such as MPEG or AVI. In the web chat, the linked video will render as an embedded video player.

    HLS (.m3u8) and DASH (MPD) streaming videos are not supported.

  • The URL of a video hosted on a supported video hosting service. In the web chat, the linked video will render using the embeddable player for the hosting service.

    Specify the URL you would use to view the video in your browser (for example, https://www.youtube.com/watch?v=52bpMKVigGU). You do not need to convert the URL to an embeddable form; the web chat will do this automatically.

    You can embed videos hosted on the following services:

Example

The following example defines a journey that shows users how to dispute a charge, using a combination of text, image, and video responses.

{
  "generic": [
    {
      "response_type": "user_defined",
      "user_defined": {
        "card_title": "Let’s dispute a charge!",
        "card_description": "Follow along with this guided journey to learn how to find and dispute charges.",
        "user_defined_type": "IBM_BETA_JOURNEYS_TOUR",
        "steps": [
          {
            "response_type": "text",
            "text": "Charges are listed on the Transactions page. **Click your profile photo** in the top right corner of your screen, and then **click Transactions** from the menu."
          },
          {
            "response_type": "text",
            "text": "Here you can view your charges.\n **Scroll through the Transactions page and review your charges.** Each charge contains a merchant name, transaction date, and amount charged."
          },
          {
            "response_type": "image",
            "source": "https://example.com/image.png",
            "alt_text": "Image showing location of Dispute option",
            "description": "The option to Dispute is marked in red on the right hand side of each row in the Transactions table. Just click here to file a dispute."
          },
          {
            "response_type": "video",
            "source": "https://vimeo.com/769580398",
            "description": "Watch this short video to learn what to expect now that you’ve filed a dispute."
          }
        ]
      }
    }
  ]
}

Starting a journey without opening the web chat

Although journeys are part of the web chat integration, you can make it possible for your customers to start a journey directly from your website without opening the web chat window at all. For example, you might want to include a Show me button on your website that customers can click to launch an interactive tour of the page.

To start a journey without opening the web chat:

  1. In the action that sends the journey response, edit the JSON that defines the journey. Include "skip_card": true to bypass the introductory card.

  2. On your website, use the send() instance method to send a message to the assistant that triggers the action that starts the journey (such as Give me a tour). Send the message in response to whatever event you want to use to trigger the journey (such as a button click or page load).

Your customers can now start the interactive journey directly from your website without having to open the web chat first. (If the web chat window is opened later, the introductory card for the journey appears in the chat history.)

Limitations

This beta feature currently has the following limitations:

  • The preview pane does not support journeys. If you want to preview a journey, use the shareable preview link. For more information about the preview link, see Copying a link to share.

  • Journeys use the view:change event or changeView method, and do not work with the window:open or window:close events or the openWindow, closeWindow and toggleOpen instance methods.

  • When the customer starts a journey, the web chat window closes. If you are using the view:change event to trigger the display of a post-chat form, your code should check the value of the new event.reason or event.newViewState.tour parameter to decide if showing the form is appropriate.