Zendesk Chat triggers allow you to to add information about your customers, improve workflow routing, and handle spam requests.
For more information about triggers, seeZendesk Chat triggers resources.
This article contains the following tables:
Trigger firing events
When you create a trigger, you must select afiring 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 theRun triggerdrop-down
- SelectWhen a visitor has loaded the chat widget如果你想要三角ger to run when the chat widget appears on the page, but the visitor has not interacted with it.
- SelectWhen a visitor requests a chat如果你想要三角ger to run when the visitor has requested a chat.
- SelectWhen a chat message is sent如果你想要三角ger 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 | 字符串includes the following text
|
Does not contain | 字符串does not include the following text"help" matches true with "not just anybody" |
Reg Ex | Matches for regular expression values using thePython RegEx framework. This field looks for afullmatch, not a partial. For assistance, you can usePythexas 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, anddoes notinclude 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 toGeoIP. 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 |
客人的邮件 | 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 viaSet Tagaction) |
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 actionSet visitor departmentor 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 hittingSendin 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
操作语句定义什么发生如果所有的有限公司ndition 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 toWhen 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. SeeBanning visitors from accessing Chatfor 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. SeeEnabling continuous conversations to re-engage messaging customersfor more information. |
Request messaging rating | Messaging-related action. Sends automated satisfaction survey at the end of a conversation. SeeAbout 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 | 字符串 | City the visitor is from (based on IP address) |
@visitor_hostname | 字符串 | Host name of the visitor's IP address |
@visitor_city | 字符串 | Visitor's city |
@visitor_region | 字符串 | Region the visitor is from (based on IP address) |
@visitor_country_code | 字符串 | 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 | 字符串 | Country the visitor is from (based on IP address) |
@visitor_page_url | 字符串 | URL of the page the visitor is currently on |
@visitor_page_title | 字符串 | Title of the page the visitor is currently on |
@visitor_referrer | 字符串 | Visitor's referral URL |
@visitor_search_engine | 字符串 | Search engine the visitor used to find your website (can be blank) |
@visitor_search_terms | 字符串 | Search terms the visitor used to find your website (can be blank) |
@visitor_user_agent | 字符串 | Visitor's browser User-Agent string |
@visitor_browser | 字符串 | Visitor's browser |
@visitor_platform | 字符串 | Adds to the note of the visitor's profile |
@account_status | 字符串 | Status of your account (online,away, oroffline) |
@visitor_previous_visits | 字符串 | Number of previous independent visits |
@visitor_previous_chats | 字符串 | Number of previous independent chats intitiated with agent |
@visitor_name | 字符串 | Name of visitor |
@visitor_status | 字符串 | Visitor status (online,idle, oroffline) |
@visitor_time_on_page | 字符串 | Visitor's time spent on current page |
@visitor_time_on_site | 字符串 | Visitor's time spent on site during current log in |
@visitor_page_count | 字符串 | Number of pages viewed by visitor |
@visitor_requesting_chat | 字符串 | Trueif visitor requested chat |
@visitor_served | 字符串 | Trueif visitor is currently being served by an agent |
@visitor_tags | 字符串 | Tags applied to visitor |
@visitor_triggered | 字符串 | Triggered visitor (trueorfalse) |
@referrer | 字符串 |
37 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 KrishnanThe 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.
HiSteven Hampson,
You can use theIdentifyfunction –
zE('webWidget', 'identify', data
to capture the user's info including the organization data. Then, you can usedepartments.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.
根据触发条件。
Is there anyway to set a condition that makes it only fire if the agent has assigned themself/taken the ticket? I see the "Visitor served" condition, but as I understand it has to be both takenandresponded by the agent.
Pleasesign into leave a comment.