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 |
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 (Widget must be installed on the previous page. Need not be visible, but present.) |
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 |
Visitor served | 'true' if visitor is currently being served by an agent |
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 | Appends a tag to the visitor profile |
Remove tag | Removes a tag from the visitor profile |
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. |
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. |
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 |
@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
Still not clear what is the action "Set triggered". What does it mean, practically speaking? Can you provide details and use cases, please?
I want to set platform specific trigger, which fires only on android...
I have set Visitor Platform = Android
it's working fine, but when i access same in website using chrome browser on mobile in that case also it is being fired.. How to set a trigger condition that it is fired only on android app and not on any android browsers.
https://support.zendesk.com/hc/en-us/articles/115000084427 - "What are the conditions for "Visitor Status > Idle"?"
Trigger placeholders list above needs to be updated by below. There are 29, above it shows only 15.
@hour_of_day
@day_of_week
@visitor_ip
@visitor_hostname
@visitor_city
@visitor_region
@visitor_country_code
@visitor_country_name
@visitor_page_url
@visitor_page_title
@visitor_referrer
@visitor_search_engine
@visitor_search_terms
@visitor_user_agent
@visitor_browser
@visitor_platform
@account_status
@visitor_previous_visits
@visitor_previous_chats
@visitor_name
@visitor_status
@visitor_time_on_page
@visitor_time_on_site
@visitor_page_count
@visitor_requesting_chat
@visitor_served
@visitor_tags
@visitor_triggered
@referrer
Is it possible to insert a placeholder for the agent's name?
Hi Joann,
The Trigger placeholders are designed to only detect the visitor's information at this time. I'm afraid there's no way to configure a Trigger to populate the agent's name.
If this is something you're interested in, I encourage you to create a post in our Chat Product Feedback forum for our Product Managers to review.
Cheers!
Is there an action to close the chat if solicitor is idle or absent for x period of time?
Hey Eduardo,
There's currently no Trigger condition that will close a chat automatically for an end-user based on the amount of time that has passed. This needs to be manually closed by the agent/end-user.
I did some digging on our end and it looks like one of our Chat Product Managers addressed this question on the following feedback post: Automatically close chat based on time of no response
Feel free to update the feedback post and provide your use-case for our Product Managers to review.
Thanks!
Hi
We tag our end-users in Zendesk Support, and use tags in ticket triggers. For example if a user is a vip the ticket is assigned to the relevant department.
How can we achieve the same on chat channel? We dont require login on our help desk and javascript visitor add-tag is not implemented on our site. End-user fill in the form with their email address when requesting chat or contacting us.
Hi M.Denis,
What you could do is use skills-based routing to automatically route VIP chats to a specific department on your account. More information can be found here: Routing chats based on agent skills
So you would create a skill called VIP and then add the VIP tag on the visitor using the Javascript API based on when they are logged into your website.
I hope this points you in the right direction!
Hi Brett
Thank you for your reply.
We have looked into javascript API and skill routing. Skill based routing is fine, it will fullfill our routing requirement. However for routing to work, the end-user needs to be identified first.
For Javascript API to work the external site needs to identify the user and add the tag to user's chat session each time.
In our case we do not authenticate end-users to Zendesk on the site. VIP end-users are tagged in Zendesk Support. Users fill in the chatform and put in their email adress when requesting a chat. Now in chat triggers we need to indefy the user by using end-user tag data stored in Zendesk Support and route the chat to the correct team.
From your answer I understand that this is not possible with Zendesk Chat. Chat triggers can only use the session data that the external site populate. Is this correct?
Is there a way to possibly do one of the following with triggers or JavaScript:
1. After the visitor sends an initial message, test that 5 minutes has past (I know this part is possible) and then offer them the other web widget options to remind them of the alternatives?
2. If all agents are serving their max visitors (we set it to 2 max), to update the widget settings to hide the Chat option?
Our goal is to prevent long wait times to either let visitors know wait times are long and "here are other options" or to hide Chat from the web widget launcher if all agents are serving customers to prevent long wait times.
Hey David,
I reached out to one of our Chat Experts and they came back with the following:
Natively there's no way to accomplish this within the Chat widget. You could maybe use javascript to pop up a window and show custom buttons to the end-user.
The max chats isn’t surfaced in the API and in the streaming API you can only get how many chats are assigned and how many agents are online. You could maybe use those numbers to get the average and then hide the widget using the javascript API.
Hope this points you in the right direction!
Brett - right on!
Thanks for the quick response. In the short-term we are going to give them the text instructions through a chat trigger. Then, we might get creative with JS and the realtime API (https://developer.zendesk.com/rest_api/docs/chat/apis) to test and update widget settings. Could be interesting.
Thanks again!
Happy to help David :)
Just to bump this Brett....
"I did some digging on our end and it looks like one of our Chat Product Managers addressed this question on the following feedback post: Automatically close chat based on time of no response"
If I follow that link I get the message I am not authorised to view the page? It sounds like the article could answer questions I have so if we could make it available that would be great.
Hey Phil,
I've copied our response from one of our Product Managers regarding control over chat sessions on the agents end:
"We are looking at offering a new experience where the session lifecycle is handled by agent instead of the end user. The current behaviour mostly impact customers with web applications and their end users have longer sessions, it hasn't been an issue for customers on websites where session lengths are shorter.
When we are ready to open up the new experience of handling the chat session, there will be an announcement in the help center and you can express your interest in the EAP."
No additional information to provide at this time but this is something our Chat product managers are still looking into.
Let me know if you have any other questions!
Thanks Brett, good to know it's been improved!
Hello, we are a Zopim chat only customer. We'd like to create a trigger that looks for several words in a visitor's chat message. I can't figure out how to put multiple variables in the 'icontains' message condition.
A use case for an example; we want the rule to look for the word(s), "password", "login", "user", or "account" in visitors chat message. The rule should return a value of 'true' when ANY of the named words in the condition are found in the message body.
Is this possible within the simple construct of Zopim Trigger builder? If so, can we get an example of how it would look in the Developer View?
Hi Alyssa,
This sounds like something to use the "check any of the following conditions" setting for (which is part of the Zopim trigger options). You can have the keywords you want the message to match to listed as separate conditions, and with meet any conditions it only needs one match on the list. I'm including both visual and developer examples here.
{
"event": "chat_message",
"condition": [
"or",
[
"icontains",
"@message",
"password"
],
[
"icontains",
"@message",
"account"
],
[
"icontains",
"@message",
"login"
]
],
"actions": [
[
"sendMessageToVisitor",
"Support ",
"message "
]
]
}
Hi Gail, Thank you.
I've got the 'or' condition on its own down. What I was hoping to do was have an 'all' and an 'any' condition in a single trigger condition statement. So for example, I wanted to have two or three 'all' qualifiers (as 'knockout' criteria) in a trigger's condition statement and then transition to two or three 'any' qualifiers where if any were met the trigger's result is still true.
I tried a JSON statement that should have worked on its own but I suspect the constraints of the form won't allow it.
{
"event": "chat_message",
"condition": [
"and",
[
"stillOnSite",
10
],
[
"eq",
"@visitor_served",
false
],
[
"eq",
"@visitor_triggered",
false
],
[
"or",
[
"eq",
"@message",
"password"
],
[
"eq",
"@message",
"login"
]
],
Hi Alyssa,
You might need developer help on this one (which is out of scope for my team) but it should be possible by using multiple And conditions before the list of conditions and then Or. We have a trigger reference for developers with a little more information.
Thank you, Gail.
I will check out the developer's reference. What I wound up doing was to split the trigger I wanted into two triggers. The first trigger houses the 'any' conditions and sets a specific tag if met. The second trigger has the 'all' conditions. One of which is to look for the specific tag set in the previous trigger. The second trigger sends the desired 'auto message' when all of the conditions are met and removes the tag set in the first trigger. It seems to work as desired! Thanks again for the support!
I second what Vivek said: https://support.zendesk.com/hc/en-us/articles/360022365873/comments/360001861094
We are deploying Chat via Mobile SDK and I cannot find an easy way to add tags for all tickets that come through via the Mobile chat. We absolutely need to measure how many chats come in via mobile versus the webapp. Any ideas?
Hey Judd,
Have you tried creating a Chat trigger that will look at the Visitor Platform? For example, you could use Visitor Platform > equals > iOS or something similar.
You can then have the trigger assign a specific tag based on the platform the visitor is on.
Let me know if this doesn't get you the results you're looking for.
Cheers!
Is there an action to close the chat if the solicitor is idle or absent for x period of time?
Hi Svetlana Tatienko,
There are no trigger actions that can accomplish this. At Zendesk we use shortcuts to send to the customer if they are inactive for certain periods of time, but there is no way within the product to configure something like this at this time.
I know that likely wasn't the answer you were hoping for, but please let us know if we can assist further.
Thank you for a response, Ben! Is there any chance you implement this feature in the future?
Hey Svetlana,
Nothing on the roadmap currently but I'll be sure to pass this along as product feedback.
Thanks for taking the time to share this with us!
Hi All
Does
In other words, does the condition see 'help-I-need-something' as a whole word or not, and therefore will match true with 'help' or 'need' etc
I would like 'help-I-need-something' to match false with 'help' or 'need' etc
Cheers
Chad
Please sign in to leave a comment.