User behavior trigger

The user behavior trigger provides expanded scope when targeting customers, allowing for actions such as mouse hover over an element (not including reloading or directing) taken directly on a page to be defined.

User behavior triggers can be added and edited in the User Behavior Triggers section of the dashboard. All edits and changes made to user behavior triggers on this page impact all active user behavior triggers assigned to surveys. To define a user behavior trigger, click Add New in the top right corner of the page.

See Targeting tab for details on user behavior triggers.

Trigger Name
Name of the trigger.
Page Element Identifier
Name or ID of the DOM object as it appears on a website.
Identifier Type
Class name or object ID.
Element Event
Select an option from the dropdown to configure how the event should be defined. Examples include Mouse Click, Mouse Over, and Key Press.

Targeting with User Behavior Triggers

To target a survey with a user behavior trigger other than the default abandonment, add a new behavior. Each behavior depends on an HTML element, which can be identified by its unique object ID, or a group of elements identified by a class ID. This user behavior trigger is then assigned to an invite triggered survey.

Before you can add a user behavior trigger, define the behavior you want to trigger on. For example, after a user hovers over a element, but does not click, trigger an invite survey. The following element events can be detected for a user behavior trigger:

  • Mouse click
  • Mouse over
  • Mouse leave
  • Key press

Identify which page element, or elements, should detect the behavior. Consult your web team to identify an HTML element which can detect the user behavior. See locating behaviors.

Observe the following rules of usage:

  • There can only be one user behavior trigger per survey.
  • The user behavior trigger only triggers once per session. Setting the More than once per session has no effect.

Locating a behavior

To detect a behavior on the page, a user behavior trigger is set to either a specific HTML element's object ID, or a CSS class ID. When the configured behavior occurs in relation to this element, the trigger is fired, and the survey invitation is displayed. The following HTML elements are supported:

  • Use an object ID to specify a unique single element that detects the user behavior. Use this type of user behavior trigger when you want the trigger to be tied to a single specific HTML element.
  • Use a CSS class ID to specify that any element which has this class applied to it detects the behavior. Use this type of user behavior trigger when you want the trigger to be tied to a group of HTML elements.

For example, suppose you want to add a user behavior to an HTML page which has multiple button elements similar to this:

<button id="mdFormHoverButton1" class="w3-button w3-round w3-center">Click to see apples</button>
<button id="mdFormHoverButton2" class="w3-button w3-round w3-center">Click to see oranges</button>

To add a user behavior trigger to only one button, use its unique element ID - such as mdFormHoverButton1 - for the Page Element Identifier, and select Object ID in the Identifier Type dropdown. To add the behavior to any buttons on the page that use the w3-button CSS class, set the Page Element Identifier option to w3-button and select Class ID in the Identifier Type dropdown.

Adding a user behavior trigger

  1. In the Digital Control Center, navigate to Automation > User Behavior Trigger.
  2. At the top right corner of the page, click the Add new button.
  3. Type a memorable name for the Trigger Name. This is how the user behavior trigger is identified in the Invite trigger settings dialog.
  4. Under Page Element Identifier, type the element ID or the object ID, depending on how you are locating the behavior on the page.
  5. Under Identifier Type, choose the type of identifier locating the behavior on the page.
  6. Choose an Element Event that defines the type of behavior related to this HTML element.
  7. At the top right corner of the page, click the Save button.