1. Help Center
  2. Troubleshooting

Test Click Goals to make sure they target the right elements

THIS ARTICLE WILL HELP YOU:

Custom jQuery Selectors

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>

Steps using JS Console

If you need to make sure what elements will be tracked, you can do so, following the steps (we will 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: