👩‍💻

Finding Out a Button's CSS Selector

Why define goals using the selector?

Although defining goals using the button text is much easier, sometimes it is not feasible.

  1. If there isn't a text on the element you want to define as a goal
  2. If the same text is used by multiple different elements on the same page and you only want to select one.

In other cases, we advise non-technical users to define their goals using text.

How to get the CSS selector of a button

  1. Hover the cursor over the button you want to define as a goal and right-click the mouse to select Inspect
  2. image
  3. Right-click on the highlighted code. Select Copy > Copy selector
  4. image
  5. Paste it into the 'Click with Selector' input in the Goals tab of your dashboard
  6. image