Show Developer Menu

Advanced Usage

Manually Displaying a Cue

You can manually display a cue to the user via a simple Reamaze.js API call. This is useful if the rules that are provided are not suitable or if you want to control when and how the Cue is shown to the user.

<script type="text/javascript">
  Reamaze.cue({
    id: "cart-checkout-sale",
    name: "Cart Checkout Sale",
    message: "Hey there, we noticed you have some items in your cart.\n\nOur Spring Sale ends soon, so hurry and check out now and get 40% off your order 😃",
    user: {
      type: "team"
    },
    buttons: [
      {
        text: "Checkout",
        url: "https://www.daffywidgets.com/checkout",
      },
    ],
    onClickScript: "alert('Cue clicked')",
    sound: false,
    transient: false,
    botsEnabled: false,
  });
</script>

Aside from the normal parameters for a Cue, there are some additional ones like onClickScript that you can use to further customize your Cue.

Parameter Description
onClickScript By default, clicking on a Cue opens up the Shoutbox where the user can send you a message or contact you regarding the Cue. You can override the default click behavior of by providing a script to the onClick parameter.
sound Defaults to true. You can turn off the sound that is played when the Cue is shown by setting this to false.
transient Defaults to false. Cues are shown to the user on every page load once it is triggered, until the user acts on the Cue (clicks in to it or closes it). You can change that behavior so that Cues only show up once regardless of user interaction by setting the transient value to true.
botsEnabled Defaults to false. By default, Re:amaze chatbots do not respond to conversations initiated via Cues. You can allow Re:amaze chatbots to respond to conversations initiated by cues by settings the botsEnabled value to true.

Deleting Cues

You can delete Cues created manually by calling the following script. Deleting Cues will remove them from the customer's conversation list unless the customer has responded to the Cue, as well as remove the notification.

<script type="text/javascript">
  Reamaze.removeCue($cueId); // delete a single Cue by its id
  Reamaze.removeAllCues(); // delete all Cues
</script>

Toggling Browser Tab Notifications

By default, new unread messages to the customer will trigger a flash in their browser tab if they have not yet read the messsage.

To disable, add the following snippet:

<script type="text/javascript">
  var _support = _support || { 'ui': {}, 'user': {} };
  _support['ui']['enableBrowserTabAlerting'] = false;
</script>

Next Step

Now that we've covered all of the available UI elements, we'll discuss how you can tie in your site's authentication and login system to make Reamaze even smarter.

Next: Auth & SSO →