On Click Goal

Overview

An On Click goal tracks clicks on a specific element. It's a Global goal - the same functionality as Track Clicks (a Local goal created in the Visual Editor), but reusable across multiple experiments, and able to track the same element across multiple pages.

Creating an On Click goal

  1. From the left menu, click Advanced, then Goals.

  2. Press New Goal.

  3. Choose a name, description, and whether to allow multiple conversions per visitor session (see below).

  4. Select On Click as the goal type, then insert the element you want to track.

Finding an element's selector

If you're not comfortable with code, here's how to find any element's selector using your browser's Developer Tools:

  1. Open Developer Tools (Ctrl+Shift+I, or via the 3-dot menu → More Tools → Developer Tools).

  2. Open the Elements tab and press the Element Inspector button.

  3. Click the element on your page you want to track - it highlights in the Elements panel.

  4. Depending on which selector type you want:
    - HTML Tag Selector - the value before class (e.g. button). Tracks all elements sharing that tag.
    - HTML Element ID Selector - the value after id (e.g. 8a72a2f). Tracks only that exact element, but not every element has one.
    - HTML Class Selector - the value after class (e.g. omni-book-a-call-trigger__button). Tracks all elements sharing that class.
    - CSS Selector - right-click the highlighted element, choose Copy → Copy selector. This is the most reliable option and the one we recommend for On Click goals.

  5. Paste the selector into the goal screen and press Save.

Note

You can track multiple elements with a single goal by listing several selectors separated by a comma and space - e.g. Selector 1, Selector 2.

URL Filters (Optional)

By default, the goal registers a conversion on any page where the tracked element is present. Add URL Filters to restrict conversions to specific pages only.

Combine multiple conditions using OR or AND, the same way you would in Understand How Segmentation Works - OR requires at least one condition to be true, AND requires all of them to be true.

Note

This section is optional. Leave it empty if you want the goal to register on every page where the tracked element occurs.

Adding the goal to an experiment

Creating the goal doesn't attach it anywhere automatically. In the experiment editor, go to Traffic Allocation & Goals, press Select or create a goal, and check the box next to your On Click goal.

Single vs. Multiple Conversions

When creating the goal, you can enable allow multiple conversions per visitor session.

  • Disabled (default) - only the visitor's first click matching this goal counts as a conversion for that session.

  • Enabled - every matching click in the same session counts as a separate conversion.

Updated