> This page is for version Scripted.
> For other versions, use one of these documentation indexes:
> - Generative (default): https://developers.ada.cx/generative/llms.txt
> - Scripted: https://developers.ada.cx/scripted/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.ada.cx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.ada.cx/_mcp/server.

# Start customizable interactions using advanced proactive campaigns

## Overview\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Overview]

Advanced Proactive Campaigns transform your customer support from
reactive to proactive. Solve issues before they become issues, creating
an unparalleled customer experience. For key pages on your website,
think about common questions, issues, or requests that your customers
might have. Then create a Campaign to proactively address those
questions, issues, or requests.

> **Note**
>
> This feature may not be included with your organization's subscription
> package. For more information, see Ada's
> [Pricing](https://www.ada.cx/pricing) page, or contact your Ada team.

* [Requirements](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Requirements)
* [How Advanced Proactive Campaigns work](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20Basic20Proactive20Campaigns20work)
* [Create a new Campaign](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FDB63SF6FZ2AX2Z0NH5917WY)
* [Configure a new Campaign](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Configure20a20Campaign)
  * [Campaign Triggers](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7QAC1BK31JYQJ82M4PFCN)
    * [Trigger when customers visit specific URLs](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Trigger20when20customers20visit20specific20URLs)
    * [Trigger with code](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Trigger20with20code)
      * [Trigger a Campaign on Button Hover](#trigger-a-campaign-on-button-hover)
      * [Trigger a Campaign on Text Hover](#trigger-a-campaign-on-text-hover)
      * [Trigger a Campaign on Click](#trigger-a-campaign-on-click)
      * [Trigger a Campaign on Page Scroll](#trigger-a-campaign-on-page-scroll)
      * [Trigger a Campaign on Exit Intent](#trigger-a-campaign-on-exit-intent)
      * [Trigger a Campaign When Adding Items to Cart](#trigger-a-campaign-when-adding-items-to-cart)
      * [Trigger a Campaign When Removing Items from Cart](#trigger-a-campaign-when-removing-items-from-cart)
  * [Customize Campaigns Based on Metadata](#customize-campaigns-based-on-metadata)
  * [Set how often this Campaign is triggered](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20often20this20Campaign20is20triggered)
  * [Set how long this Campaign is shown to customers](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20long20this20Campaign20is20shown20to20customers)
  * [Campaign Content](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7QSYTZN7GGKCS9SPCEXCV)
  * [Scheduling](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Scheduling)
  * [Embed code](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7R35H1QBYGXMBR9N484GB)
* [Publish Campaign](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7RBEBMDRV2JQ8ZTJ98WXC)
* [Prioritize Campaigns](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7RBEBMDRV2JQ8ZTJ98)
  * [How prioritization works](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMAXEJZWARZH3G73SCD8GYKN)
* [Campaign Reporting](#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01G1RZ6EN4JHJCFNZ8Q9WEC9KD)
* [Track Campaign Results Using Events](#track-campaign-results-using-events)

### Requirements\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Requirements]

Your Ada integration must meet certain requirements before you can use
Advanced Campaigns:

* [Embed2](https://developers.ada.cx/reference/add-chat-to-website) –
  Your integration must use Ada’s **Embed2** script. If you’re still
  using Embed1, Proactive Campaigns won’t work.

* Proactive Campaigns supports bots deployed on the web and mobile web.
  Campaigns currently don’t support mobile applications.

* Custom CSS styling of the Ada widget could affect the appearance of
  your Campaigns.

## How Advanced Proactive Campaigns work\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20Basic20Proactive20Campaigns20work]

The logic behind when to trigger an Advanced Proactive Campaign is based
on either a URL or code linked to custom events, along with simple
timing parameters.

## Create a new Campaign\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FDB63SF6FZ2AX2Z0NH5917WY]

How to set up a new Advanced Proactive Campaign:

1. On the Ada dashboard, go to **Build> Campaigns**.

2. Click **New Campaign**. The Create a new Campaign dialog appears.

3. Select **Web** from the Choose a channel dropdown.

4. Add a **Name** and **Description** to the corresponding dialog
   fields.

5. Click **Next**. The dialog disappears to reveal your new Campaign’s
   configuration settings.

## Configure a new Campaign\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Configure20a20Campaign]

There are a few configuration options available for your Advanced
Proactive Campaign. Let’s look at how to set them up.

### Campaign Triggers\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7QAC1BK31JYQJ82M4PFCN]

Campaign Triggers define the parameters in which the Advanced Proactive
Campaign will be surfaced.

![](/_fern-files/_img/8e4197a104b1210bf9f5daf4875033ff77bfd411f88f11dcbc015a3d8bde5c35.webp)

#### Trigger when customers visit specific URLs\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Trigger20when20customers20visit20specific20URLs]

The Campaign will be triggered on any of the URLs you provide. To add
URLs to your Campaign Triggers:

1. Click **+ Add URL**.

2. Select the appropriate URL matching option from the drop-down menu.
   To learn more about URL matching, please see the table here:

   <table>
     <thead>
       <tr>
         <th>
           Option
         </th>

         <th>
           Definition
         </th>

         <th>
           Example
         </th>
       </tr>
     </thead>

     <tbody>
       <tr>
         <td>
           **Exactly Matches**
         </td>

         <td>
           This option will look for the exact match of your URL. Query
           parameters will not be part of the matching logic.
         </td>

         <td>
           Specifying `https://www.example.com/checkout` in
           the configuration will match to `https://www.example.com/checkout?q=hello` and `https://www.example.com/checkout`
         </td>
       </tr>

       <tr>
         <td>
           **Contains**
         </td>

         <td>
           This option will match URLs that contain your specified string
           anywhere in the URL. Query parameters containing your values.
         </td>

         <td>
           Specifying `example` in the configuration will
           match to `https://www.example.com/checkout` and `https://www.hello.com?q=example`
         </td>
       </tr>

       <tr>
         <td>
           **Ends With**
         </td>

         <td>
           This option will match URLs ending with your specified string.
           Query parameters will be ignored for this option.
         </td>

         <td>
           Specifying `/checkout` in the configuration will
           match to `https://www.example.com/checkout` and `https://www.hello.com/checkout?q=example`
         </td>
       </tr>

       <tr>
         <td>
           **Regular Expression**
         </td>

         <td>
           This option gives you full control in specifying the matching
           URLs using the [regular expression pattern matching language](https://regex101.com/) over the full URL, including query
           parameters.
         </td>

         <td>
           Specifying `product[0-8]+[^9]*$` will match any page that includes the string ‘product’ and any number of any length afterwards, as long as the number 9 never appears.

           Specifying `^https:\/\/acme\.com(?!.*\/(promo|pricing)$).*$` will match on all `https://acme.com` pages except for those ending with /promo or /pricing.
         </td>
       </tr>
     </tbody>
   </table>

3. Input the full URL or URL component.

4. Repeat for additional URLs where you want the Campaign to be
   triggered.

#### Trigger with code\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Trigger20with20code]

Use advanced JavaScript triggers to create dynamic and engaging proactive campaigns on your website. These triggers allow you to customize when and how campaigns are shown, based on user actions like hovering, clicking, scrolling, or interacting with elements on the page. Below are detailed examples for common use cases.

##### Trigger a Campaign on Button Hover

Engage users by initiating a campaign when they hover over a specific button. For instance, hovering over a “Book a demo” button can prompt a chat encouraging registration.

This method is ideal for drawing attention to specific actions like booking a demo or scheduling a call.

```
<script>
  // Ensure the campaign is shown only once per page refresh
  let campaignHasBeenShown = false;

  document.getElementById("hoverable-button")
    .addEventListener("mouseenter", function(event) {
      if (campaignHasBeenShown) return;
      campaignHasBeenShown = true;
      window.adaEmbed.triggerCampaign("Invite_To_Demo", {
        ignoreStatus: false,
        ignoreFrequency: false
      });
    }, true);
</script>

<button type="button" id="hoverable-button">Book a demo</button>
```

##### Trigger a Campaign on Text Hover

Initiate a campaign when a user hovers over specific text, such as a link to learn more about features. This is a subtle way to engage users while they explore your content.

```
<script>
  document.getElementById("hoverable-text")
    .addEventListener("mouseenter", function(event) {
      window.adaEmbed.triggerCampaign("Feature_Sets", {
        ignoreStatus: false,
        ignoreFrequency: false
      });
    }, true);
</script>

<p>
  <a style="text-decoration: underline;" id="hoverable-text">Find out more about our features.</a>
</p>
```

##### Trigger a Campaign on Click

Launch a campaign when a user clicks on an element, such as a “Renew my subscription” button. This method is effective for offering support or promotional campaigns tied to specific user actions.

```
<script>
  const launchCampaign = () => {
    window.adaEmbed.triggerCampaign("Renew_Subscriptions", {
      ignoreStatus: false,
      ignoreFrequency: false
    });
  };
</script>

<button onclick="launchCampaign()">Renew my subscription</button>
```

##### Trigger a Campaign on Page Scroll

Start a campaign when a user scrolls through a certain percentage of the page. This is useful for re-engaging users as they browse your content.

```
<script>
  let campaignHasBeenShown = false;

  document.addEventListener("scroll", function(event) {
    if (campaignHasBeenShown) return;

    if (document.documentElement.clientHeight + document.documentElement.scrollTop > document.documentElement.scrollHeight / 2) {
      window.adaEmbed.triggerCampaign("Scroll_Based_Campaign", {
        ignoreStatus: false,
        ignoreFrequency: false
      });
      campaignHasBeenShown = true;
    }
  }, true);
</script>
```

##### Trigger a Campaign on Exit Intent

Detect when a user intends to leave the site and trigger a campaign to retain them. This can be used to offer discounts, collect feedback, or provide helpful resources.

```
<script>
  let proactive = false;

  const mouseTrap = (e) => {
    if (e.clientY <= 0) {
      proactive = true;
      window.adaEmbed.triggerCampaign("Exit_Intent");
      document.body.removeEventListener('mouseleave', mouseTrap);
    }
  };

  const mouseHunt = () => {
    if (!proactive) {
      document.body.addEventListener('mouseleave', mouseTrap);
    }
  };

  mouseHunt();
</script>
```

##### Trigger a Campaign When Adding Items to Cart

Recommend additional products or promotions when a user adds an item to their cart. This use case is common for ecommerce platforms.

```
<script>
  document.querySelector(".btn.product-form__cart-submit").addEventListener("click", () => {
    window.adaEmbed.triggerCampaign("Casual_Combo");
  });
</script>
```

##### Trigger a Campaign When Removing Items from Cart

Engage users with alternative suggestions when they remove items from their cart. This is a great way to mitigate cart abandonment.

```
<script>
  document.querySelector(".p.cart__remove").addEventListener("click", () => {
    window.adaEmbed.triggerCampaign("Better_Match");
  });
</script>
```

##### Customize Campaigns Based on Metadata

Use the setMetaFields action to tailor campaigns based on user-specific data, such as cart value, to offer personalized promotions like free shipping.

In this example, the cart value determines whether a free shipping upsell campaign is triggered.

```
<script>
  const handle = "my-bot";
  const campaignName = "Free_Shipping_Campaign";

  window.adaEmbed.start({ handle });

  const addToCart = async ({ price }) => {
    await window.adaEmbed.setMetaFields({ cartValue: price });
    window.adaEmbed.triggerCampaign(campaignName, {
      ignoreStatus: false,
      ignoreFrequency: false
    });
  };
</script>

<button onclick="addToCart({ 'price': 6.50 })">Add to Cart</button>
```

#### Set how often this Campaign is triggered\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20often20this20Campaign20is20triggered]

Click to set the Campaign's trigger frequency:

* Only once per user

  > **Note**
  >
  > This setting may behave differently depending on your bot's Chatter
  > Persistence settings. It works best if your Chatter Persistence is set
  > to "Never Forget" - in that case, a chatter only sees the Campaign
  > once, and never again. However, if your bot is set to forget chatters
  > after closing or reloading the page, or after a set period of time,
  > chatters may see the Campaign more than once.

* Only once per session

* No restrictions

  > **Note**
  >
  > This option only applies to URL-triggered Campaigns. Code-triggered
  > Campaigns may behave differently, depending on the nature of the code
  > that triggers it.

#### Set how long this Campaign is shown to customers\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_How20long20this20Campaign20is20shown20to20customers]

Click to set how long the Campaign is shown to customers:

* Show indefinitely

* Dismiss after a set time (customizable in seconds or minutes)

### Campaign Content\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7QSYTZN7GGKCS9SPCEXCV]

Campaign Content is the messaging for your Campaign. There are two parts
to Campaign messaging. First, the Answer your web visitors see pop out
from the chat button on your webpage. Interested visitors can click the
message or the chat button to engage your bot. And second, the optional
follow-up Answer, tailored specifically for this campaign. If a
follow-up Answer has been enabled for the Campaign, it will be the
Answer provided in the chat window when a web visitor initiates the
chat.

To define the Campaign's Content:

1. **Choose an Answer** from the drop-down menu or click **Create a new
   Answer** if an appropriate answer does not already exist.

2. Click to enable **Use a follow-up Answer** (optional).

3. **Choose an Answer** from the drop-down menu (optional).

If a Campaign Answer has both a follow-up Answer and Quick Replies, the
expected behaviour is:

* Chatter clicks on a Quick Reply button --> the Answer triggered by
  that Quick Reply button displays in the chat window.

* Chatter clicks on another element of the Campaign (ex. a text bubble)
  \--> the follow-up Answer displays in the chat window.

> **Note**
>
> The Campaign will only display Text, Link, Picture, and Video blocks,
> even if the Answer contains other blocks.

### Scheduling\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_Scheduling]

Control of when the Advanced Proactive Campaign is active is in your
hands. It can be scheduled to run continuously or start and end dates
can be set.

If you select **Run continuously** the published campaign will run until
you choose to unpublish it.

If you select **Set start and end dates** the published campaign will
run according to the following settings:

* Time Zone - Select End user's time zone or Choose a fixed time zone

* Start Date

* Start Time

* End Date (optional)

* End Time (optional)

![](/_fern-files/_img/e4a743f5b754265d2bb1fd1f5af7efb7fbff3ffaec0e9c6f3701c6eb3dbebe2a.webp)

### Embed code\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7R35H1QBYGXMBR9N484GB]

You must include the Ada Embed Code on every webpage where you want to
trigger this Campaign. Learn more about [Ada Embed2](https://developers.ada.cx/reference/add-chat-to-website).

## Publish Campaign\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7RBEBMDRV2JQ8ZTJ98WXC]

If you want to continue making changes before publishing the Campaign,
click **Save For Later**. If you are ready to launch the Campaign, click
**Publish**.

> **Note**
>
> Bots are limited to 100,000 Advanced Proactive Campaign sends per day.
> Once this limit is reached the bot will no longer send Advanced
> Proactive Campaign messages.

## Prioritize Campaigns\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMA7RBEBMDRV2JQ8ZTJ98]

A webpage can only surface one Campaign at a time. It is possible,
though, for a webpage to have two or more Campaigns assigned to it. In
this case, rank your Campaigns based on priority. That way your website
visitor only encounters the Campaign you want them to see.

To reprioritize your Campaigns:

1. Go to **Build > Campaigns**.

2. Click **Prioritize**.

3. In the Set Priority dialog, drag and drop your Campaigns to reorder
   their priority.

4. Click **Save**.

### How prioritization works\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01FMAXEJZWARZH3G73SCD8GYKN]

Let’s say you have two Campaigns:

* Campaign 1—Free Shipping. This is assigned to the base URL
  `www.test.com`.

* Campaign 2—10% Discount. This is assigned to the specific URL
  `www.test.com/promo`.

As you can see, both Campaigns are valid for the specific URL
`www.test.com/promo`. But you want to make sure that, on that page, your
site visitors only ever see the 10% Discount Campaign. You do this by
moving the 10% Discount Campaign to position 1 in the priority list.
Now, any visitors to this specific URL are shown only the 10% Discount
offer.

![](/_fern-files/_img/f5ae246704dc7743206c3628fa3eee502ba7d4d8bdf3d0c467cf957a9b847f2e.webp)

## Campaign Reporting\[#UUID-f3c47f61-811a-f23f-4488-de24e7564931_id_4410394747283_id_h_01G1RZ6EN4JHJCFNZ8Q9WEC9KD]

You've published your Advanced Proactive Campaign, but is it addressing
your customer's questions, issues, and requests? Use Campaign reporting
to find out.

View your Advanced Proactive Web Campaign reporting by:

1. On the Ada dashboard, go to **Measure** > **Reports**.

2. Select the **Campaign Performance(Web)** report.

3. Click on a Campaign name to view the metrics for that specific
   Campaign. The available metrics include:

   **Shown** - Total number of presented Campaigns.

   **Opened** - Total number of times the bot is opened from the
   Campaign.

   **Engaged** - Total number of engaged conversations.

## Track Campaign Results Using Events

You can track the success of your campaigns by logging user actions using events. For example, if a campaign encourages users to add items to their cart, you can track when this action occurs to measure the campaign’s effectiveness.

Use the following code snippet to track an “Add to Cart” event when a user clicks the “Add to Cart” button:

```
<script>
  document.querySelector(".btn.product-form__cart-submit").addEventListener("click", () => {
    const cartValue = 29.99; // Replace with the actual cart value
    window.adaEmbed.trackEvent("Add_to_Cart", cartValue);
  });
</script>
```

This logs an event called "Add_to_Cart" with a monetary value (cartValue) representing the item added to the cart.

To learn how to set up events, see the [Track Events guide](https://docs.ada.cx/track-events).

Another use case for tracking events might be when users sign up for a demo or subscribe to a newsletter after interacting with a campaign. By logging these actions as events, you can determine the campaign’s impact on your goals.

---

Have any questions? Contact your Ada team, or email us at [](<mailto:help@ada.support%20%E2%80%9CHelp Docs inquiry%E2%80%9D>).