A note on element attributes
Admins and Architects are the only team seats that have permissions to add new element attributes. If you are a Standard user, you'll need assistance from one of these team seats in your Settings > Account Management > Users view.
Jump to section:
- When to Use Element Attributes for Indexing
- How Element Attributes work in FullStory
- Index List
- Do Not Index List
- Configure pattern rule lists for attributes
- Searching using data-attributes
If you want to have Element Attributes available in your mobile application, you can use the API call listed here for the elements you want attributes on.
When to Use Element Attributes for Indexing
You might want to use FullStory's Element Attributes feature if:
- Your site is built on React, and you have no stable class names to use in search
- Your site uses FullStory Private by Default obscuring the text on all buttons
- You've implemented FullStory's Babel React Plugin to automatically decorate selectors on your website with useful attributes
- Your engineering team already uses data-* and aria-* attributes for a testing framework
One of the most powerful experiences in FullStory is searching for click events on selectors, such as everyone who clicked on CSS selector
btn-primary cta-add-to-cart". If your site is built on React and the class names instead look like
RSzhz6gmPB1iAe-9l8gXJ" and are constantly changing, you lose this search functionality.
However, if your CSS selectors also are styled with some useful data-attributes, like
aria-label="search", or whatever your engineering team decides to add - you can get access to FullStory's powerful search functionality again!
How Element Attributes work in FullStory
The Element Attribute feature allows you to take advantage of more stable attributes on your selectors, even while the class names constantly change. You can select key Element Attributes to index so that you can search for future sessions where users interacted with those elements with the element attribute in question.
We added a general list (shown in grey text) of attributes already indexed in search, such as
aria-labelledby, and you can add your own attributes that are important to your site by clicking Create attribute.
Note: Element Attributes are not retroactive. When you search for sessions using Element Attributes, you'll see results starting from the time of instrumentation.
We recommend that you define attributes that do not contain solely unique values (like a UUID). In the future Element Attributes will be used for more advanced Page Analytics and attributes with unique values can lead to confusingly low numbers for aggregate click counts.
You should add attributes that are actually useful and meaningful - e.g.
data-src may decorate every product on your product detail page, but if the output is a random string that isn't useful, then
data-src isn't a good attribute to add for indexing.
The attributes that we index by default are listed here.
We don't index certain very common attributes (shown in the table below) since attributes are meant to identify important and unique elements around the site.
So you've added key Element Attributes to FullStory for Indexing - great! But maybe your autocomplete results are full of results you don't care about, and your Page Insights results could be more accurate.
We give you the power to help fine-tune FullStory's autocomplete results and page aggregation heuristics by indexing or not indexing pattern rules for specific Element Attributes.
When you edit or create a new Element Attribute list item, Add Rules to input the specific patterns you'd like to include or exclude. You can use wildcard * to specify a greater range of patterns.
NOTE: By default, we will not index attributes that include numbers or text not made up exclusively of common English words or abbreviations. Those patterns would have to be additionally allowlisted for that attribute. You can edit our default
id Element Attribute with a wildcard to index
ids such as
Once you've added a few data-attributes, and new sessions have rolled in containing the elements you'd like to search for, you can start building some segments. When searching in FullStory you'll want to toggle the "Any activity" drop down and select "Clicked." You will then have the option to search the clicked event by "CSS selector" where you can search for engagement on a specific element without using class selectors.
Note: Data attributes are only searchable if they contain a given value. For example,
[data-attribute] alone would not be searchable. Rather, you would need to enter
[data-attribute="yourvaluehere"] when searching to yield results. If you'd like to explore more operators for data attribute searches, check out this guide for more tips.
Refine your search to find engagement on a specific element containing specific text.
And use data categories to search for engagement categories across multiple elements.