Home > Knowledge Base > Extracting XPath for Goal events

Extracting XPath for Goal events

To discover the page element XPath, you need to tell CUX which HTML element you have in mind. We’ll need the element class or ID that’s part of HTML attributes.

  1. Navigate to the page on your site.
  2. Find the element you want to track in your Goal.
  3. Right-click the element.
  4. Use the “Inspect” or “Inspect element” function. This opens the developer tools window or pane. In the developer tools window, a part of the HTML code that represents the chosen element is selected.inspect page cux.io

xp-700x402 (1).png

  1. Copy the HTML element class or ID.
  2. Paste the copied value in the XPath field of the Goal creator. After a short moment, CUX shows you suggestions for the XPath.
  3. Select the option. CUX automatically enters the XPath value into the field. That’s all you need to do!

NOTE: If you use xPath for the Click event – always select “Matches” in the Comparison tab. If you use regular expressions instead of XPath, choose “Contains (regexp)”.

How to extract XPath for Waterfall or Goal events