---
title: "Fetch and process information for user Identification"
slug: "fetch-and-process-information-for-identification-rules"
updated: 2025-06-19T05:14:46Z
published: 2025-06-19T05:14:46Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.whatfix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch and process information for user Identification

### Overview

It’s necessary to identify your users to show relevant content. When creating a custom rule to identify a user or language in your application, you need to define the following:

- Where does Whatfix get the unique identification data from?
- How can Whatfix read data?

> [!WARNING]
> Note:
> 
> For more information about privacy and compliance, see [Whatfix Privacy Policy](https://whatfix.com/privacy-policy/).

A **Sequenc****e** is a single set of instructions that Whatfix uses to capture and identify data for a custom rule. Within this sequence, the fetcher is responsible for retrieving or capturing the necessary data from the application. The processor then takes this fetched data and analyzes or interprets it to extract the relevant information for the rule.

The fetcher enables you to select from where you want to pull the value that defines the rule. For example, if each user has a unique identifier based on the cookie value, select **From Cookie** as the fetcher.

The processor enables you to parse the fetched value using **JSON** or **String Operations**.

> [!WARNING]
> Note
> 
> - Add multiple processors to parse the fetched value. Click **+ Add Processor** to add another parsing method.
> 
> ![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image(293).png)
> 
> - Click **+ Add Sequence** to add more identifiers to fetch a different value and parse it for another unique identification rule. ![ac_set user_add sequence.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_set%20user_add%20sequence.png)

### Capture information using Fetcher

Whatfix enables you to fetch data from various sources. Uniquely identify a user based on what works best for your application. Whatfix then displays analytics data based on User id, segment content for specific groups of users, identify users for Cohorts, and more.

Based on your requirements, pull identification values from different sources using the following fetcher options:

| **Fetcher option** | **Description** |
| --- | --- |
| Fetch Cookie | Retrieves data from browser cookies. For example, if your application stores user id in the user_id cookie, enter user_id as the **Key** of the cookie from where you want to pull the value. ![ac_fetch_from cookie](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_from%20cookie.png) |
| Fetch Element Attribute | Retrieves data from attributes of HTML elements. Based on your requirements, choose a **Selector Type**(CSS or jQuery), enter **Selector Value**, **Index**, and **Attribute Name**. For example, a **Save** button on the Salesforce Lightning page has the following Selector Type and Selector Values: \| Selector Type \| Selector Value \| \| --- \| --- \| \| CSS Selector \| button[title="Save"] \| \| jQuery Selector \| $('button[title="Save"]') \| Consider that you have a CSS selector called user-id that contains all user id data. From the selector, you want to find each users’ unique id that is stored as data-userid at the 4th index position in the user-id attribute. Set **Selector Type** as CSS, **Selector Value** as data-userid, **Index** as 4, and **Attribute Name** as user-id. ![ac_fetch_element attribute_css](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_element%20attribute_css.png) |
| Selector Type | Selector Value |
| CSS Selector | button[title="Save"] |
| jQuery Selector | $('button[title="Save"]') |
| Fetch from Local Storage | Retrieves data stored in the browser's local storage. In the **Key** section, enter the value you want to retrieve from local storage. For example, if your application stores user role data in the local storage as user-role, enter user-role as the **Key** from where you want to pull the value. ![ac_fetch_local storage](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_local%20storage.png) |
| Fetch from Session Storage | Retrieves data stored in the browser's session storage, which is similar to local storage, but the data is stored for the duration of the browser session. In the **Key** section, enter the value you want to retrieve from the session storage. For example, if your application stores session usage data in the local storage as section-count, enter session-count as the **Key** from where you want to pull the value. ![ac_fetch_session storage](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_session%20storage.png) |
| Fetch Element Text | Retrieves text data from attributes of HTML elements. Based on your requirements, choose a **Selector Type** (CSS or jQuery), enter **Selector Value**, and **Index**. For example, consider that you have a CSS selector called data-username that contains each users’ name that is stored at the 2nd index position. Set **Selector Type** as CSS, **Selector Value** as data-username, and **Index** as 2. ![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/fetch element text.png) |
| Fetch from URL | Retrieves information directly from the URL. For example, if your URL is https://whatfix.com/user/123, Whatfix retrieves the entire URL. ![ac_fetch_url](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_url.png) |
| Fetch from URL Hostname | Retrieves the hostname from the URL. For example, for the URL https://subdomain.whatfix.com/path, Whatfix retrieves subdomain.whatfix.com. ![ac_fetch_url hostname](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_url%20hostname.png) |
| Fetch from URL Hash | Retrieves data from the URL hash. For example, if your URL is https://whatfix.com/page#section1, Whatfix retrieves section1 from the URL hash. ![ac_fetch_url hash](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_url%20hash.png) |
| Fetch from URL Path | Retrieves information from the URL path. For example, for the URL https://whatfix.com/user/123, Whatfix retrieves /user/123 from the URL path. ![ac_fetch_url path](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_url%20path.png) |
| Fetch from URL Parameter | Retrieves data from a specific parameter in the URL. For example, if your URL is https://example.com/page?param1=value1, and Whatfix can retrieve the value associated with the key param1 (i.e., value1). ![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_url parameters.png) |
| Return Value of Function | Enables the execution of a custom function, and the return value is used as the identification value. In the **Function Name** section, enter the JavaScript function whose return value you want. For example, you can have a JavaScript function getUserLogin() that returns a true or false value based on whether the user is logged in. ![ac_fetch_return value of function](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_return%20value%20of%20function.png) |
| Window Variable | Retrieves data from a variable stored as a Window Variable. In the **Key** section, enter the name of the Window Variable. ![ac_fetch_window variable](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch_window%20variable.png) |

### Parse captured information using Processor

Whatfix enables you to process the raw data obtained from the fetcher and extract the relevant information needed for your custom rule. The processor provides options for performing actions such as parsing JSON and applying string operations.

### JSON Operations

If your fetched data is in JSON format, the processor can be configured to extract specific values from the JSON structure. Use JSON Operations when the data you need is nested within a larger JSON object.

Whatfix enables you to use the **Read Key** JSON operation, which means that the processor enables you to extract a specific value from a JSON structure based on a given key. Here's an example Sequence,

- Fetch JSON data representing a user profile:
  - **Where do you want to fetch the user from?**: Fetch from Local Storage (assuming the JSON data is stored in local storage)
  - **Key**: user_profile_data
- Extract the user's email address from the fetched JSON object:
  - **How do you want to process it?**: JSON Operations
  - **JSON** **Operations**: Read Key
  - **Select** **JSON**: Output of Fetcher
  - **Key** **Name**: user.email

![ac_fetch process_example](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_fetch%20process_example.png)

The JSON structure might look like: {"user": {"name": "John Doe", "email": "john.doe@whatfix.com"}}. The processor is set to read the key `user.email` to extract the user's email address.

The processed result would be [john.doe@whatfix.com](mailto:john.doe@whatfix.com). In the preceding example, the fetcher retrieves the JSON data from local storage under the key user_profile_data. The processor is then configured to read the key `user.email` from the JSON structure, resulting in the extraction of the user's email address.

### String Operations

If your data is in a string format, the processor enables you to perform string operations to extract the relevant information. Such actions include like splitting a string, finding a substring, and more.

Based on your requirements, you can process your data using the following String Operations:

| **String Operation** | **Description** |
| --- | --- |
| Join | Concatenates multiple strings into a single string. For example, if you want to add a specific string before the fetcher output: - Fetcher Output (String): [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) - Sequence Configuration: - **String 'a':**whatfix_user_ - **String 'b':**Output of fetcher - Result: [whatfix_user_John,Doe,john.doe@whatfix.com](mailto:whatfix_user_John,Doe,john.doe@whatfix.com) ![ac_process_string_join](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_process_string_join.png) |
| Split | Divides a string into an array of substrings based on a specified delimiter. You can also use the Index to specify which part of the split result to select. For example, you want to extract only the email address from a long string, `user_profile_data`: - Fetcher Output (String): [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) - Sequence Configuration: - **Select String**: Output of fetcher - **Delimeter**: , - **Index**: 2 (to get the email) - Result: [john.doe@whatfix.com](mailto:john.doe@whatfix.com) ![ac_process_string_split](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_process_string_split.png) |
| Substring | Extracts a portion of a string based on the specified start and end positions. For example, you want to extract only the first 4 letters of the user name from a long string, `user_profile_data`: - Fetcher Output (String): [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) - Sequence Configuration: - **Select String**: Output of fetcher - **Start Index**: 0 - **End Index**: 4 - Result: John ![ac_process_substring](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_process_substring.png) |
| To Lowercase | Converts all characters in a string to lowercase. For example, you want to convert the entire output to lowercase: - Fetcher Output (String): [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) - Sequence Configuration: - **Select String**: Output of fetcher - Result: [john,doe,john.doe@whatfix.com](mailto:john,doe,john.doe@whatfix.com) ![ac_process_string_to lowercase](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_process_string_to%20lowercase.png) |
| Trim | Removes leading and trailing whitespaces from a string. For example, you want to remove any extra space preceding `user_profile_data`: - Fetcher Output (String): [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) - Sequence Configuration: - **Select String**: Output of fetcher - Result: [John,Doe,john.doe@whatfix.com](mailto:John,Doe,john.doe@whatfix.com) ![ac_process_string_trim](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/ac_process_string_trim.png) |

#### Examples: Processing and Segmentation

Read the following section to learn how you can use the fetcher options to identify users and segment Whatfix content.

Expand the following accordions for more details.

****Fetch Cookie Value****

Use the Fetch Cookie option when you want to retrieve data from browser cookies. For example, you can identify a returning user based on a `last_visited` cookie. By fetching the value of this cookie, you can segment your Whatfix content to display a **What's New** pop-up or a personalized welcome message to returning users, helping them quickly get up to speed with any updates or changes since their last visit.

![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image-NCJOSM9J.png)

****Fetch from Local Storage Value****

Use the Fetch from Local Storage option to retrieve data stored in the browser's local storage. For instance, your application enables users to temporarily dismiss certain informational banners or announcements. When a user clicks **Dismiss**, you might store a flag in local storage called `announcement_dismissed: true`.

Add the following as a [Sequence in User Identification](/studio/docs/fetch-and-process-information-for-identification-rules#capture-information-using-fetcher):

![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image(723).png)

If the announcement is about a new feature, and the user dismisses it, you can trigger a **Beacon** that redirects users to the release notes of your application. The beacon is not very intrusive and the user can learn more about the feature at their own pace while mildly nudging them. Here’s an example Visibility rule: ![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image-T8E0NBMX.png)

****Fetch from Session Storage Value****

Use the Fetch from Session Storage option to retrieve data stored for the duration of the current browsing session. For example, you might assign a temporary **session_id** to track a user's progress through a multi-step process. By fetching Session ID, you can display Whatfix Pop-ups to offer contextual help in the process where users spend more that the optimal time to complete a step or drop-offs in the process.

Here’s an image that displays the fields that you can add to fetch the browsing time: ![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image(716).png)

****Fetch Element Text****

Use the Fetch Element Text option to retrieve the text content of a specific HTML element on the page. If a button's text changes to **Saving...** during an operation, you can fetch a particular text. Consider that you have a CSS selector called `&lt;div id="statusMessage"&gt;` that contains the value of button status in the 3rd index position.

Add the following as a Sequence for identification:

![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image(722).png) You can then use a **Launcher** to prevent further user interaction until the button text changes back to **Save**.

Here’s an example Visibility rules setting for **When does the launcher start appearing?**

![](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/image(721).png)

## Related

- [Configure User Identification Rules from a Pre-configured Application](/configure-user-identification-rules-from-a-pre-configured-application.md)
