Simulate Click/Event Action

The Simulate Click/Event action simulates a customer clicking one or more element selectors. The action also appends included CSS styles in the <head> of the page.

This action is useful when you toggle interactive content open or closed.

You can enter an infinite loop by simulating clicking an element that is present on multiple pages.

For example, if you target a click event to an element that's present on all pages—for example, a link in the main navigation—then the Simulate Click/Event action runs each time the page loads and Monetate tracks.

You can avoid an infinite loop by using one of these tactics:

  • Select an option from Display Frequency when configuring the action.
  • Add action conditions based on page type or the URL contains option.
  • Use very specific selector syntax, and ensure to use :not(, :has( or :contains(.

Required Components

Relative Element Selector

Enter the element selector into Relative Element Selector. It determines what element(s) are "clicked" by the JavaScript click event. For additional information on element selectors, see Element Selectors.

Event Type

Select the type of event simulated by the action:

  • Click
  • Change
  • Mouse Up
  • Mouse Down
  • Key Up
  • Key Down

Display Frequency

This setting controls how frequently the action fires per customer:

  • Every page
  • Once per session
  • Once, ever
  • Once every 'X' days

If you select Once every 'X' days, then you must specify the number of days in the Days until expiration field in the Optional Inputs section.

Prevent Default Browser Behavior

When set to YES, this setting prevents the browser from following links and other default behavior when the event fires.

Optional Components

CSS Style

Monetate appends anything you add in the CSS editor to a stylesheet in the <head> portion of your site within a <style> block. These styles are available on this page for use with any page element.

Select All Elements

The Select multiple elements, if matched? toggle allows you to apply the action to the first occurrence of the relative element selector or all occurrences of it, if multiple exist.

Select NO to apply the action to the first occurrence. Select YES to apply the action to all occurrences.

Re-Check for Elements

Use the Re-check for Elements toggle to enable or disable polling. If you enable polling, Monetate continues to check for the selected element even if it does not initially appear on the page. This option is good if you have certain elements that don't fire right when the page loads.

If you disable polling, Monetate only checks for the element once when the page loads.

Days Until Expiration

Only use this input if you selected Once every 'X' days from Display Frequency. This option sets the number of days until the lightbox expires and accepts any numeric value.