Zendesk chat and messaging triggers allow you 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:
Selecting run events for chat and messaging triggers
When you create a trigger, you must select a run event. These events determine whether that trigger will run, check its conditions, and perform its defined actions. Run events are selected when creating a trigger using the Run trigger drop-down.
Firing event | Description |
---|---|
When a visitor has loaded the chat widget | Runs the trigger when the chat widget appears on the page but
the visitor hasn't interacted with it.
Note: Selecting this
firing event overrides pre-chat forms. To continue using your
pre-chat form, use other firing events.
|
When a visitor requests a chat | Runs the trigger when the visitor requests a chat. |
When a chat message is sent | Runs the trigger when the visitor has sent text in the chat widget. |
Building chat and messaging trigger condition statements
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. Max 3600 seconds |
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. Max 3600 seconds |
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 Max value 2.1 million |
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 the 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 is chatting | 'true' if the visitor is currently in an active chat session. |
Visitor requesting chat | 'true' if the visitor is requesting a chat by hitting
Send in their chat message. 'false' if the visitor is not requesting a chat. |
Visitor served | 'true' if the 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. |
Operators for trigger condition statements
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.
|
Building chat and messaging trigger action statements
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:
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 ticket |
Remove tag | Removes a tag from the 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 the CSAT (customer satisfaction) user experience for email and messaging. |
Using placeholders in chat and messaging trigger action statements
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 inititated 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 | The URL where the visitor's current session originated |
45 comments
Jay Krishnan
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.
0
Steven Hampson
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.
0
Anais
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.
0
Arianne Batiles
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.
0
Leo Medalla
Trigger not firing when conditions are met.
Visitor is requesting for chat but has not sent a chat yet.
as per the trigger condition.
0
Lea Møller Baun
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 taken and responded by the agent.
0
Mike DR
0
Bill Reed
I am trying to test a trigger based on "When a visitor has loaded the chat widget" but nothing is happening.
Is this because of our widget settings in Support? In that it tries to deflect via a Help Center search and then displays the contact form?
0
JR Lausin
0
Fiona
What do I need to do to exclude mobile users?
Visitor platform > does not contain > ios
Visitor platform > does not contain > android
That doesn't seem to work... what should I be doing? Thanks
0
Efrat Barak Zadok
I was using on many of my chat triggers the action for adding tags.
This is no longer available via messaging triggers. What is the suggested workaround?
0
Paolo
You can create a trigger to add tags on your Messaging tickets. Please refer to the sample below.
Best,
Paolo | Technical Support Engineer | Zendesk
0
Efrat Barak Zadok
Paolo Thanks for the screenshot, but there is one thing missing. I need it to only occur when the specific messaging trigger run - how can I add that to a trigger condition?
0
Max
hello Paolo
so we want to add Proactive messages for visitors of our website :
- one trigger for homepage
- one trigger for special categories (christmas) of our website
- one trigger for checkout
We setting the 3 triggers, with the specified URLs. It appears that if a visitor arrives at the homepage, and see the first proactive message, then the 2 others won't work. Is that a normal behaviour ? Shouldn't it trigger the 3 times if visitor navigates through homepage, then christmas category, and then checkout ?
thank you
0
Jacob Jabra Christensen
I was testing the use of placeholders used in messages from Messaging triggers and found that standard placeholders don't work here.
When I try the messaging-specific placeholders, however, I also find they don't work for me (see below).
What is the trick here?
I was looking to reveal the ticket ID for the requester, and found there is no such placeholder. Is this coming?
Thank you!
1