Show Developer Menu

Automating Reamaze Cues

Introduction

Reamaze Cues can be set to automatically display when certain Rules have been matched, for example if the user is about to leave the site, or if the user has been on this page for more than a minute, or if the user is on a specific page.

A Rule is defined as an object with the parameters type, op and value. Here is an example of a Rule and its usage in a Cue:

// this is a Cue object
{
  id: "cue-rules-test",
  message: "This Cue is displayed once the user has been on the page for longer than 1 minute and if the URL matches '/pricing'.",
  rules: [
    {
      type: "timeOnPage",
      op: "greaterThan",
      value: "1m"
    },
    {
      type: 'url',
      op: 'contains',
      value: '/pricing'
    }
  ]
}

Here is a list of Rule types as well as the supported operators:

Type Supported Operators Description
url equals
notEquals
contains
doesNotContain
Matches value against the current page URL.
referrer equals
notEquals
contains
doesNotContain
Matches value against the referring URL, determined from document.referrer.
timeOnPage greaterThan
lessThan
Time the user spent on the current page. The value by default is in seconds, but can be written in minutes or hours, for example 2m for 2 minutes, or 2h for 2 hours.
timeOnSite greaterThan
lessThan
Time the user spent on your site. The value by default is in seconds, but can be written in minutes or hours, for example 2m for 2 minutes, or 2h for 2 hours.
date greaterThan
lessThan
Matches value against the current date. value is a datetime string in ISO format, for example: 2017-05-16T22:26:03.272Z
leavingSite isTrue
isFalse
Detects if the site visitor is about to leave the page or the site. value is ignored on this Rule.
identified isTrue
isFalse
A user is identifed if the user is identified by Reamaze, either via SSO, or if the user has started a conversation before. value is ignored on this Rule.
nthVisit greaterThan
lessThan
Number of visits to your site. value is an integer value denoting the number of times the user has been to your site.
inOfficeHour isTrue
isFalse
Whether it's during or outside office hours. If office hours are not set, this will always resolve to True.
staffAvailable isTrue
isFalse
Whether there are staff available for chat. This only applies to Classic Live Chat.
deviceType equals A user is identifed if the user is identified to be using the device in value. Allowed value options are desktop and mobile
customerLocation equals
notEquals
Matches the country code value against the user's location. For the U.S. and Canada, you can also target the state/province by adding a colon and the state/province code (e.g. US:NY).

Next Step

If you'd like full control of when and how to display a Cue, check out our Advanced Usage section. You'll also be able to customize the default click behavior of a Cue as well as whether the sound plays when a Cue is displayed.

Next: Advanced Usage →