
When editing an element on the AutoScan, you will see a list with options under the tracked element name. This list includes all the Selector IDs found for the given element, and it enables you to change the selector, if you prefer to match other elements as well:
Why should I change the Element Selector?
Element selectors have a property scope, as opposed to a page scope. Changing the conversion event for an element on Page A will apply to all pages where the same selector is found.
If you wish to be more specific where are want to change the conversion events you can change the element selector to something that will match your element better.
What is the difference between each Element Selector?
There are several types of element selectors. Here are a list of possible selectors with some examples:
1. Link Selector
Link selectors are full links or partial links that are found on your website. This selector will find an element that has this link (or part of this link) within it.
Examples:
trafficker.io/recommends/cj-affiliate-link/
https://trafficker.io/recommends/cj-affiliate-link/?utm_source=trafficker
2. Element ID Selector
Element ID selector finds every HTML element that matches the element type and ID attribute of the selector.
For example, the selector button#add-to-cart
will match the following element:
<button id="add-to-cart">Add to Cart</button>
Note: By default, AnyTrack will fire an OutboundClick event for all elements with the button#add-to-cart
selector. If you want to fire an AddToCart event, you will have to update the event name accordingly. Consequently, all elements found with such selector, and across your website will fire the AddToCart event.
3. Element Label Selector
Element label selector matches all the HTML elements that have the given element type and label of the selector.
For example, the selector a:"Buy Now"
will match all following elements:
<a href="#">Buy Now</a>
<a title="Buy Now">iPhone 12 Pro</a>
<a data-label="Buy Now">link content</a>
Note: It's possible to have a link selector followed by an element label selector. In this case, the element selector will match all the element label selectors only on the given page url.
Comments
0 comments
Please sign in to leave a comment.