WingifyGuides

How to Track Clicks on Element in Wingify?

This article covers the following: * Overview * Add Goals From the Visual Editor UI * Add Goals Using the Goals Page During the Test Creation

#Overview

The Track Clicks on Element(s) goal is typically used to collect visitor data and clicks on buttons and elements present on your website. To know more about this goal, refer to the Track Clicks on Element(s). In Wingify, you can define your testing goals in two ways:

  1. Adding goals from the Visual Editor UI.
  2. Add goals using the Goals page during the test creation.

Note: If your workspace is enabled with Data Platform, you will be able to use Metrics in the place of Goals for tracking standard and custom events on your website. However, the procedure mentioned for adding goals from the Visual Editor UI is applicable to Metrics, too. To know about adding a metric from the METRICS page during test creation, refer to Working with Metrics in Wingify.

#Add Goals From the Visual Editor UI

On the visual editor, select the element you want to track and choose the option Track Clicks.

If you are selecting a button, the editor opens a widget with a pref-filled goal name. You can modify the goal name per your requirements and click DONE. Post this, a new goal to track clicks on an element appears on the goals page.

Note: The element you want to track will display for both control and variations and also have the same CSS selector path. However, if you have added the Track click on elements(s) via the Goals page and the element is only available on one version (either control or variations), Wingify will only track data for the relevant variation.

Ensure to add every element for tracking if the CSS selector path is different. Select In an existing goal to track the variations in a single goal.

To learn more, refer to How to Add Goals Using Visual Editor.

#Add Goals Using the Goals Page During the Test Creation

You can define the element you want to track on the Goals setup page.

Procedure

  1. Log in to your Wingify account.

  2. Go to Web Experimentation > A/B, or you can select any other testing type per your requirements. A/B Testing dashboard appears.

  3. In the dashboard, click CREATE.

  4. In the Enter URL of the page you want to test field, enter the URL of the webpage you want to test.

    Note: To include or exclude URLs from the campaign, click the ADVANCED tab present next to the URL field. Using this tab, you can also define advanced pattern-matching options to either include a broad URL with wildcard entries or a specific URL. To learn about using different URL patterns, refer to Using URL Patterns in Wingify.

    From the What hypothesis are you testing? dropdown, select a hypothesis you want to work with. This is an optional step.

    Note: If you do not have a hypothesis yet or wish to create a new one, you can do so by clicking on the Create a New Hypothesis option present at the bottom of the hypothesis dropdown. To learn more about the hypothesis, refer to Hypothesis in Wingify.

  5. In the Variations step, click Next.

  6. In the Goals step, click the edit icon present next to the New Goal and enter the name for your goal.

  7. From the Goals Type dropdown, select the option tracks clicks on element(s).

  8. Next, add a valid CSS selector path in the field that displays. To learn how to find the CSS path, click here.

    Note: You cannot add XPath in place of a CSS selector.

  9. Make sure that the CSS selector path of the element to track is specified correctly. You can either specify the CSS selector path using the ID of the element, preceded by a hash(#)) or the associated class (preceded by a dot(.)).

    Note:

    • To track multiple elements under the same goal, enter their respective CSS selector paths separated by a comma in between.
    • Wingify will not track any conversions if the element has a dynamic CSS selector path. Ensure that you use static CSS classes to specify the path in goal settings.For example, in the screenshot below, #Wingify-test-container-1 is the CSS path for the control version, and #Wingify-test-container-2 is the CSS path for the Variation.
  10. For a Split URL test, make sure that control and variation have the same CSS selector path for any click on the element goals. However, if the CSS selector path is different for control and variations, add the selector paths for every element separated by a comma.

  11. For example, in the screenshot below, #Wingify-test-container-1 is the CSS path for the control version, and #Wingify-test-container-2 is the CSS path for the Variation version. To know more, refer to How to Create a Goal in Wingify Web Experimentation?

#How to Find the CSS Path of an Element?

Google Chrome

  1. Right-click on the element you want to track and select Inspect Element. The developer tool displays the element properties.
  2. Right-click on the element property and select Copy and then click Copy Selector.
  3. Paste the CSS path in the Goals field.

Mozilla Firefox

  1. Right-click on the element you want to track and select Inspect Element.
  2. On the Developer tool, right-click on the element property and click Copy and CSS Selector.
  3. Paste the CSS path in the Goals field.

If the element ID is dynamic, then you have to manually find the shortest CSS path. It is calculated from the nearest element ID by default. To know more about CSS selectors, click here.

#Need more help?

For further assistance or more information, contact Wingify Support.