Skip to main content

Set Attribute

Set virtual attributes for a mobile view

To simplify management of privacy for mobile applications and to enable individuals who have worked with Fullstory for the web to have a more familiar experience, Fullstory for Mobile Apps instrumentation creates virtual HTML-like elements for native Android or iOS views for the purposes of privacy management, funnel definition, and searches. read more here

The FS.setAttribute() API method is available to create virtual attributes of any kind on native views, read more here.

Call FS.setAttribute to set a custom attribute as key-value pairs for a mobile view.

Additional Information

public static void FS.setAttribute(View view, String attributeName, String attributeValue);

Example Invocation

View view = findViewById(R.id.btn_add_to_cart);
FS.setAttribute(view, "theme-color", "dark");