Capture a CSS Selector or XPath

Use CSS Selector or XPath to locate an element or resource that you want to collect performance data on in a web page.

Before you begin

mPulse does not perform currency conversion. If you allow purchases in multiple currencies, and those numerical values are not kept in separate variables or accessible by separate CSS Selectors or XPath, mPulse may report incorrect values. For these situations, create a JavaScript variable on the page with the order value that represents the appropriate currency (for example, converted to USD, EUR, JPY or whatever makes sense for your business.) instead of using a CSS Selector or XPath.

The value applied is the value of the element within the DOM node after stripping out everything except number characters.

How to

  1. Open the page in a browser (for example, Chrome), right-click the element that you want to capture, and select Inspect to open the developers tools.
  2. From the Elements tab, right-click the element and select either Copy > Copy selector or Copy XPath.
  3. To view the value of the element, click Console. After the prompt, type $, select the element in the pop up, and press Enter.
  4. Expand the element, until you see the innerHTML value.