Overview
Often, web pages contain elements that serve the same purpose but are located in different parts of the page. This diversity in element placement can result in different selector paths for identical elements.
Consider a website with a "Sign Up" button in both the header and footer sections, and they do not have unique attributes across their instances throughout the website to select them specifically. The "Sign Up" button in the header might have a selector path like #header > div > ul > li > button, while the one in the footer could have a selector path like #footer > div > ul > li > button. Despite their identical function, these buttons have distinct selector paths due to their placement on the page.
Another common scenario is the presence of multiple elements with the same text but different functionalities.
For instance, a blog page may feature several "Read More" links within different blog posts. Each "Read More" link leads to the full article of its respective post, representing distinct elements despite sharing the same text ("Read More").
In times like these, tracking the clicks on these elements can’t be brought under the same umbrella of a selector path. Nevertheless, you have a solution - VWO allows you to specify text strings that you want to be tracked for clicks. These text strings, wherever they’re on the page, will be tracked evenly.
APPLICABILITY: This feature is exclusive to Data360 accounts.
Benefits of Text-based Click Tracking
Tracking visitors based on text clicks can reveal a deeper insight into what the visitor is seeking. This also opens the door to various practical applications on your web pages:
- Tracking Elements With Dynamic Selector Paths: At times, some elements are designed to have dynamic selector paths, i.e., the selector path changes with any modification. Tracking such elements can be easily done with text-based tracking as long as the text on the element remains the same.
Suppose that you're tracking a "Subscribe Now" button in a VWO campaign. After some development work on the page containing this button, its selector path gets altered. This change could potentially disrupt the tracking process. However, by utilizing text-based tracking, you can overcome this issue effortlessly. - Tracking Identical Elements With Dynamic Text: Enables tracking clicks on elements with shared selector paths but different text, catering to scenarios where clients need precise text-based tracking.
For example, an e-commerce platform with multiple product categories displayed on its homepage, each with a "View Products" button. The text on these buttons dynamically changes based on the selected category, such as "View Shirts", "View Pants", "View Accessories", and so on.
- Freedom From X-paths/HTML Attributes: Now, you can get a little more casual while specifying the elements to be tracked on your website. Simply specifying their texts can enable tracking of the clicks on all of its instances.
- Open for All: You don’t have to squeeze your brain or go around to find a developer to help you discover the selector paths of similar elements that you want to track by text.
Creating a Metric for Text-based Tracking
You can use the Click metric and define the text string as the event property under that to track the clicks on the text string wherever it is prevalent on your web page.
Say you’re running a fashion website for clothing. You’re running a marketing campaign on your landing page, where you want to track clicks on a slew of clothing category buttons on your website, such as “View Dresses”, “View Athleisure”, “View Shirts”, “View Pants”, and so on. These buttons share the same selector path, and you want to track the clicks exclusively on “View Shirts”.
To achieve this, you can simply define the Click event property as Text, select a comparison operator for the text value, and enter the text that you want to track, as performed below:
- On the main menu, go to Data360 > Metrics and click Create to create a metric.
- Name the metric, select the Click event under Visitors event you want to track and select Text as its property.
- You can select a comparison operator from the exhaustive dropdown list.
- Enter the text to be tracked in the input field.
- Under the Metric will calculate section, select the appropriate option for the conversion counting.
- For reference purposes, add a crisp description that helps.
- Click Save.
You can add this metric to any Testing or Personalize campaigns and view their corresponding reports for this metric when they’re running.