Encountered Error Message

Trigger a proactive campaign when an error message is encountered.

Available on:  Pro


Proactively initiate a conversation whenever someone tries filling out a form and encounters an error based on their input.

Let’s say a customer tried to enter a promo code during checkout. If they type a promo code that’s not accepted by the system, they’ll get an error message. You can use this error message element to trigger Ada to proactively launch and offer support.

Proactively offering support in this way improves the experience, reduces customer effort, and decreases the amount of tickets reaching your agents’ inboxes.

See it in action

Let's imagine that you are in the process of checkout and want to enter a promo code. The input field will only accept the correct promo code – ABC123.

Type something other than ABC123 in the field below and press return/enter to see how an incorrect submission triggers a proactive campaign.

How to set it up

Step 1

Follow Ada’s technical Embed documentation to learn how to add Ada to your website.

Attached is the code snippet you need to paste into the <head> tag.

⚠️ Be sure to replace <YOUR-BOT-HANDLE> with your own bot handle. Your bot handle is your bot’s unique domain name: https://yourbothandle.ada.support/.

📣Click here to learn how to load a bot on a non-US cluster.


Step 2

Follow the instructions on the Advanced Proactive Campaigns page to create a web campaign.

Step 3

In this example, a proactive campaign will be shown to a customer who has entered an incorrect promo code.

<!-- an input element on our website for the promo code -->
<input id="promo-input" type="text" placeholder="Promo Code">

Step 4

To show the proactive campaign, Use triggerCampaign to launch a campaign created via the Ada dashboard in step 2. In this example, the Incorrect_Promo_Code campaign will be triggered when the customer enters an incorrect code.

ℹ️Use Events to measure how often Ada helps your customers succeed by tracking actions on your website, both inside and outside of their conversations with your bot. Follow this guide to learn about creating and tracking events.

// this function is called when the customer submits a promo code on the page
function handlePromoCodeSubmission(promoCode) {
  const enteredCode = promoCode;
  const correctCode = "YOUDESERVEIT"
  if (enteredCode !== correctCode) {
    // the campaign should be triggered when your page detects the wrong code has been entered 
  } else {
    // the correct code was entered - perform the action for a successful entry

// an event listener is added to the promo code input to handle the customer's submissions

const promoCodeInputEl = document.getElementById("promo-input");

promoCodeInputEl.addEventListener("keydown", (e) => {
  // check if the customer entered the correct code when Enter is pressed
  if (e.key === "Enter") {
    const submission = e.target.value;

See what Ada can do for you

Get your hands on our award winning platform and start offering VIP experiences for everyone, at scale.

Get a Demo