Targetting users using a page HTML attribute
New
Hi,
I’d like to know if it’s possible to create a segment of users based on a page HTML attribute. Here’s my use case below.
Some of the pages of my product are marked this way in the DOM:
<html my_attribute="valueX">
Others are marked this way:
<html my_attribute="valueY">
I’d like to target only the users who’ve seen the pages marked with the value "valueX". How can I proceed?
Thanks
0
Comments
4 comments
Hey @Chaton94! Thanks so much for your question and welcome to the Community! 😊
If you’re looking to create a segment based on which users saw a page HTML attribute, you may want to first create a watched element on this attribute.
Once you’ve created this, you can search using data-attributes. When new sessions have rolled in containing the elements you'd like to search for, you can start building some segments.
Please let me know if you have any more questions or need help setting this up! 😊
Hi Lindsay,
Thanks for your reply, but it seems that creating a watched element isn’t a feature included in our subscription plan.
The objective of my request is to be able to track users who use our platform in English <html lang="en"> and in French <html lang="fr"> and create a segment for each of them. We can’t use the URL as this parameter isn’t currently included in it.
Is there any other way to do this?
Thanks
Hey @Chaton94! Thanks so much for providing that information!
My apologies, I misread and thought this was an available feature for you.
Another option would be to pass a

lang
property in an FS.identify call, so we know that this user has their language set to en or fr.For example, you could call something like this:
FS('setIdentity', {
uid: '462718483',
properties: {
displayName: 'Daniel Falko',
email: 'daniel.falko@example.com',
lang: 'fr'
}
});
Please let me know if you have any other questions!
Hey @Chaton94! I wanted to followup with another suggestion for you!
You could also use JavaScript to dynamically detect the user's browser language setting. This can be achieved using the
navigator.language
property. Once you've detected the language, you can send this information as a custom attribute or event to FullStory (FS). This approach will allow you to create segments for users who prefer English (en) and French (fr) respectively. Here's a simple code snippet to get you started:This code first checks the browser language and then, if it's English or French, sends this information to FullStory. Once you pass in this variable, you can easily use the property
user_language_preference
in FullStory to segment your users by language. This will give you a clear view of user preferences on your platform and help in tailoring your content and services accordingly.Please don’t hesitate to reach out should you have any other questions!
Please sign in to leave a comment.