Create a smart link preference
Create smart links to specify where a URL should open. For example, the URL could open in a new browser window, in a new browser tab, in the chat window, or in a pop-up window.
Before you begin
Role required: virtual_agent_admin or admin
About this task
If you (as an admin) have enabled URL navigation on the page, you can specify patterns for where and how the links open in the chat windows. End users see the URL links based on the patterns you've specified.
For example, you can set these URL "smart links" to open in a new browser window, in a new browser tab, in the chat window, or in a pop-up window. If you specify a pop-up window, you can set the size of the window your end users see.
Smart links can be used in chats with live agents.
Error messages display for channels that don't support smart links.
Procedure
Navigate to All > Conversational Interfaces > Settings.
Under the System actions section, select View All next to URL navigation.
Select the Target Location tab.
Select New.
On the form, fill in the fields.
| Field | Description |
|---|---|
| Description | The purpose of the smart link. |
| Where to open | Where to open the link. Choose one of the following options:- New Browser Tab: Opens the link in a new browser tab. - Load in Place:: Opens the link in the current location. - Parent: Opens the link at the highest or parent level. - Popup: Opens the link in a pop-up window and lets you specify the pop-up window size. - Raise Event: In the chat widget only, prevents the default select behavior, avoiding a page navigation (the chat is kept open). |
| Order | Number that indicates the order in which smart link preferences run. If there are multiple preferences, the system runs the first smart link preference found, from lowest to highest order. |
| URL Pattern | URL pattern that uses regular expression quantifiers.If the regular expression is invalid, an error message is shown. Image omitted: invalid-reg-expression.png Invalid regular expression message. |
| Condition mode | Expression logic to specify a condition for applying the smart link preference.Select either: - Simple, or - Advanced |
| Set conditions Note: Applies only if you select the Simple condition mode. | If you select the Simple condition mode, use the condition builder to add or edit the condition.The condition builder specifies that the smart link is only applicable to links in the Service Portal when they're accessed on the chat widget. Image omitted: smart-link-condition-builder.png Simple condition builder with the conditions Portal is Service Portal and device type is chat widget.</p>
|
| ScriptNote: Applies only if you select the Advanced condition mode. | If you select the Advanced condition mode, use the script editor to create or edit a JavaScript condition statement. When the end user selects the link, the component triggers a Window: message event. As a developer, if you see the Window: message event, you can decide how to handle the navigation. For example: window.addEventListener('message', e => {
if (e.data.type === 'SMART_LINK_CLICKED') {
console.log(e.data);
/**
{
type: 'SMART_LINK_CLICKED',
src: 'https://domain.com/link/src'
}
*/
}
}); |
- Select Save.
What to do next
If you would like to enable smart link preference for Microsoft Teams, you must first Configure link authentication and opening experience in Microsoft Teams and then Configure smart links in Microsoft Teams
Parent Topic:URL navigation in Conversational Interfaces