Zendesk Chat triggers allow you to to add information about your customers, improve workflow routing, and handle spam requests.
For more information about triggers, see Zendesk Chat triggers resources.
This article contains the following tables:
Trigger firing events
When you create a trigger, you must select a firing event. These events determine whether that trigger will run, check its conditions, and perform its defined actions. Firing events are selected when creating a trigger, using the Run trigger drop-down
- Select When a visitor has loaded the chat widget if you want the trigger to run when the chat widget appears on the page, but the visitor has not interacted with it.
- Select When a visitor requests a chat if you want the trigger to run when the visitor has requested a chat.
- Select When a chat message is sent if you want the trigger to run when the visitor has entered and sent text in the chat widget.
Trigger operators
Use the following operators to build trigger condition statements.
Operator | Description |
---|---|
Equals | Exact match
|
Less than | Less than the number entered, but not including
|
Greater than | More than the number entered
|
Less than or equal to | An exact match or less than the number entered
<= 3 returns true on a 3, 2, 1, or 0 |
Greater than or equal to | An exact match or more than the number entered
|
Is not equal | Anything but the value entered
|
Contains | String includes the following text
|
Does not contain | String does not include the following text
"help" matches true with "not just anybody" |
Reg Ex | Matches for regular expression values using the Python RegEx framework. This field looks for a full match, not a partial. For assistance, you can use Pythex as a quick-reference and validation tool.
|
Trigger conditions
Condition statements consist of conditions, field operators, and condition values (these vary depending on the condition selected). Condition statements are essentially ‘if’ statements that return 'true' values that meet the specified criteria. When 'Check All of the Following Conditions' is selected, the first condition statement that evaluates to false terminates the trigger. When 'Check Any of the Following Conditions' is selected', only one condition needs to be true for the actions to fire.
Condition | Description |
---|---|
Time/Date | |
Hour of day | Hour of the Day (Universal Time Clock):
0 = Midnight 23 = 11 p.m. Note that the Hour of day condition uses the hour only, and does not include minutes. |
Day of week | Day of the Week:
0 = Monday 6 = Sunday |
Still on site | A condition check of whether the user is still on the domain after X seconds since the scenario chosen has elapsed. |
Still on page | A condition check of whether the user is still on the same page after X seconds since the scenario chosen has elapsed. |
Location of visitor | |
Visitor IP | IP address of visitor |
Visitor host name | Host name (domain) associated with the visitor's IP address |
Visitor city |
City name associated with the visitor's IP address |
Visitor region |
Region the visitor is from according to GeoIP. For the US and Canada, we use the ISO-3166-2 regions. These are the different states (e.g. Vermont). For everywhere else, we use the FIPS 10-4 standard. The GeoIP website has a CSV file which lists all the different regions: http://www.maxmind.com/download/geoip/misc/region_codes.csv |
Visitor country code | Two-letter country code of the visitor's IP address. Codes are case-sensitive and should be upper-case. |
Visitor country name | Country name associated with the visitor's IP address |
Previous visit information | |
Visitor previous visits | Number of previous independent visits: 0 = First time visit |
Visitor previous chats | Number of previous independent chats initiated with an agent: 0 = First time chatter |
Page information | |
Visitor page URL | Current URL of visitor (Widget must be installed on this page) |
Visitor page title | Current title of page visitor is on (Widget must be installed on this page) |
Visitor page count | Number of pages visitor has viewed. First page = 1 |
Previous page | URL of the previous page user was on |
Visitor information | |
Visitor name | Name of visitor |
Visitor email | Email of visitor |
Visitor referrer | Referrer URL of visitor, if applicable, determined from content headers |
Visitor search engine | Referring search engine, if applicable. Note that these values are case-sensitive and should be lowercase:
yahoo bing yandex |
Visitor search terms | Referring search terms, if applicable |
Visitor tag | Tag (Applied via Set Tag action) |
Visitor triggered | Triggered visitor (activated by Set Triggered action). Select either of the following from the drop-down menu:
True False |
Visitor department | Visitor's department, set by the action Set visitor department or Javascript API. |
Software/Computer of visitor | |
Visitor user agent | Visitor's user agent string |
Visitor browser | Browser used by visitor |
Visitor platform | Platform used by visitor |
Online statuses | |
Account status | Status of your Zendesk Chat account which works as a hierarchy system.
Online Away Offline
|
Department status |
Status of the selected Zendesk department. Online Away Offline |
Visitor status | Status of Visitor:
Online Idle (no mouse or keyboard movement in the chat window for 10 minutes) |
Chat-related information | |
Visitor requesting chat | 'true' if visitor is requesting a chat by hitting Send in their Chat message.
'false' if the if the visitor is not requesting a chat (for instance, if the visitor clicks on the chat bubble and does not take any action, this trigger will fire). |
Visitor served | 'true' if visitor is currently being served by an agent (for instance, an agent has opted to serve the customer and has sent their first message in the chat).
'false' if an agent has not sent a response to the visitor. |
Sender | Name of sender of the chat message |
Sender type | Type of sender. Note that these values are case-sensitive and should be lowercase:
visitor agent |
Message | The message being sent |
Department | Department (name) that visitor chooses from the pre-chat form |
Visitor queue | |
Queue size (account) | Total number of incoming chat requests for the account. Note that the condition targets the total account queue, and does not measure the department queue. |
Trigger actions
Action statements define what occurs if all the condition statements are true and the trigger fires. You can think of action statements as ‘then’ statements: if all of your conditions are true, then perform these actions to update the user and optionally send notifications.
Action | Description |
---|---|
Send Message to visitor | Sends the given message to the visitor
Note: If the account is offline, this action will not work.
|
Set triggered | Set Triggered can be one of two values and applies a flag which can be used in conjunction with the 'Visitor Triggered?' condition. Select one of the following from the drop-down menu:
True False
Note: If the account is offline, this action will not work.
|
Wait | Delay (in seconds) before the next action fires
Note: If you have multiple triggers that must be executed in a certain order, you need to add at least one second of wait time between each trigger. This is required due to the fact that triggers do not run in a particular order and are evaluated and executed simultaneously.
|
Add tag | Adds a tag to the related ticket |
Remove tag | Removes a tag from the related ticket |
Set name of visitor | Sets the visitor's name |
Set visitor department | Adds a department to the visitor profile. When this action is selected, a drop-down menu appears, allowing you to select an available department. Only works when Run trigger is set to When a visitor has loaded the chat widget. |
Replace note | Replaces the note of the visitor's profile |
Append note | Adds to the note of the visitor's profile |
Block visitor | Bans the visitor from accessing your chat service. See Banning visitors from accessing Chat for more information on blocking visitors. |
Request email (continuous conversations) | Messaging-related action. Sends automated message to visitor requesting an email for continuous conversation re-engagement. See Enabling continuous conversations to re-engage messaging customers for more information. |
Request messaging rating | Messaging-related action. Sends automated satisfaction survey at the end of a conversation. See About CSAT ratings in messaging. |
Trigger placeholders
Placeholders are references to visitor details you can use in trigger action statements. When the trigger is fired, the placeholder pulls in the current visitor and session information.
Placeholder | Type | Description |
---|---|---|
@hour_of_day | Integer | Current hour of the day (UTC timezone). 0 - 23 |
@day_of_week | Integer | Current day of the week (0 = Monday, 6 = Sunday) |
@visitor_ip | String | City the visitor is from (based on IP address) |
@visitor_hostname | String | Host name of the visitor's IP address |
@visitor_city | String | Visitor's city |
@visitor_region | String | Region the visitor is from (based on IP address) |
@visitor_country_code | String | Two-letter country code of where the visitor is from (based on IP address). Codes are case-sensitive and should be upper-case. |
@visitor_country_name | String | Country the visitor is from (based on IP address) |
@visitor_page_url | String | URL of the page the visitor is currently on |
@visitor_page_title | String | Title of the page the visitor is currently on |
@visitor_referrer | String | Visitor's referral URL |
@visitor_search_engine | String | Search engine the visitor used to find your website (can be blank) |
@visitor_search_terms | String | Search terms the visitor used to find your website (can be blank) |
@visitor_user_agent | String | Visitor's browser User-Agent string |
@visitor_browser | String | Visitor's browser |
@visitor_platform | String | Adds to the note of the visitor's profile |
@account_status | String | Status of your account (online, away, or offline) |
@visitor_previous_visits | String | Number of previous independent visits |
@visitor_previous_chats | String | Number of previous independent chats intitiated with agent |
@visitor_name | String | Name of visitor |
@visitor_status | String | Visitor status (online, idle, or offline) |
@visitor_time_on_page | String | Visitor's time spent on current page |
@visitor_time_on_site | String | Visitor's time spent on site during current log in |
@visitor_page_count | String | Number of pages viewed by visitor |
@visitor_requesting_chat | String | True if visitor requested chat |
@visitor_served | String | True if visitor is currently being served by an agent |
@visitor_tags | String | Tags applied to visitor |
@visitor_triggered | String | Triggered visitor (true or false) |
@referrer | String |
35 Comments
Hi
How does "Hour of day" trigger condition work with respect to the Timezone we have setup in our Chat Settings? We have the Timezone as UTC-6; however if we try to use the Hour of day condition, it says Hour of Day is UTC timezone.
Please advice how the two settings work. Thanks in advance.
Is there a way to route chats based on the visitor email domain? We have email address as 'required' on the pre-chat form, but the 'set visitor department' action says it is only available when the widget is loaded - but the visitor will not have had a chance to enter their email address by this point.
Our customers have specific requirements so agents are trained to handle certain customers. Therefore we need to route to groups based on the visitor organization. Thanks.
Jay Krishnan The trigger is in UTC and completely ignores the timezone you have set up. You have to convert yourself your timezone into UTC time when you set up the condition of the trigger.
Hi Steven Hampson,
You can use the Identify function –
zE('webWidget', 'identify', data<object>);
to capture the user's info including the organization data. Then, you can use departments.select, –chat: { departments: { select: 'hr'
to set the visitor department based on the user info pulled up.This should allow you to route chats from organization to the right department and agents. For reference, you can check out this page to see all the commands that you can use to customize the behavior of your web widget: Settings reference.
Trigger not firing when conditions are met.
Visitor is requesting for chat but has not sent a chat yet.
as per the trigger condition.
Please sign in to leave a comment.