Test Click Goals to make sure they target the right elements

Setting up click goals might get tricky when you want to track multiple elements at once. That is done through custom jQuery selectors that are used in the goal setup/edit process.

Note, when setting up click goals with custom selectors, try to match A tags instead of elements that are inside of those A tags. For example, in a structure like below a good selector would be a.link_class instead of a.link_class > img

<a href="" class="link_class"><img src="" /></a>

If you need to make sure what elements will be tracked, you can do so following the same (we'll use Chrome browser here but any other browser that has a JS console could be used):

  1. open the page where the elements are supposed to be found;
  2. copy the selector you are using in your goal's settings, as shown in the above image;
  3. do Inspect Element on that page and go to the Console;
  4. type the following in the console: convert.$("selector here") (you'd replace selector here with the actual selector);

Hit the Enter key and you should see listed all the elements that will be tracked through that selector: 

Have more questions? Submit a request

Comments