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.
Use the following operators to build trigger condition statements.
|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.
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.
|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|
City name associated with the visitor's IP address
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|
|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 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:
|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:
|Software/Computer of visitor|
|Visitor user agent||Visitor's user agent string|
|Visitor browser||Browser used by visitor|
|Visitor platform||Platform used by visitor|
|Account status||Status of your Zendesk Chat account which works as a hierarchy system.
Status of the selected Zendesk department.
|Visitor status||Status of Visitor:
Idle (no mouse or keyboard movement in the chat window for 10 minutes)
|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:
|Message||The message being sent|
|Department||Department (name) that visitor chooses from the pre-chat form|
|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.|
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.
|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||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. 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.|
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.
|@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_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_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)|