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

# Analyze

> Understand how your users are interacting with Argyle Link through analytics.

Through the `onUIEvent` callback function, it is possible to track what the users are doing within Argyle Link.

This provides a better understanding of users' behavior and allows you to troubleshoot and optimize conversion rates.

## Persistent properties

The `onUIEvent` is invoked when specific events are activated. These events are passed with a data object with persistent properties as follows:

* `linkItem` (string) — Link Item ID.
* `accountId` (string) — Account ID.
* `userId` (string) — User ID.
* `deepLink` (boolean) — Activates deep-linking. Can be `true` or `false`.

#### onUIEvent callback example:

```json theme={}
{
    "name": "login - form submitted",
    "properties": {
        // Persistent:
        "linkItem": "kroger",
        "accountId": "e98d80cfecd94bbf96b11d58382b96ef",
        "userId": "e98d80cfecd94bbf96b11d58382b96ef",
        "deepLink": false,
    }
}
```

## Event-specific properties

In addition to the persistent properties, events can have specific properties. Find below all the Link screens on which events can be triggered and their respective event-specific properties (if applicable):

#### onUIEvent callback example (with event-specific properties):

```json theme={}
{
    "name": "error - opened",
    "properties": {
        // Persistent:
        "linkItem": "croger",
        "accountId": "e98d80cfecd94bbf96b11d58382b96ef",
        "userId": "e98d80cfecd94bbf96b11d58382b96ef",
        "deepLink": false,
        // Event specific:
        "errorType": "invalid_link_items"
    }
}
```

### Intro screen

![Argyle Link's introduction screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-intro-screen-upd)

| Event name     | Event description                     | Event-specific properties |
| -------------- | ------------------------------------- | ------------------------- |
| intro - opened | The user opened the **Intro screen**. | N/A                       |

### Search screen

![Argyle Link's search screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-search-screen)

| Event name                  | Event description                                                           | Event-specific properties |
| --------------------------- | --------------------------------------------------------------------------- | ------------------------- |
| intro - opened              | The user opened the **Intro screen**.                                       | N/A                       |
| search - term updated       | The user typed in the search term for a link item in the **Search screen**. | `term`, `tab`             |
| search - link item selected | The user selected a Link item in the **Search screen**.                     | `term`, `tab`             |

* `term` (string) — The text entered in the search field.
* `tab` (string) — The tab that the user has opened when entering text in the search field. This is ignored for an empty term, so if a user deletes the search term, the event callback will not be started. Possible values: `All`, `Employer`, `Gig`, `Payroll`.

### Login screen

![Argyle Link's login screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1661342467/docs-v2/20220824_Link_analytics_login_1)

| Event name                     | Event description                               | Event-specific properties   |
| ------------------------------ | ----------------------------------------------- | --------------------------- |
| login - opened                 | The user opened the **Login screen**.           | `errorCode`, `errorMessage` |
| login - form submitted         | The user submitted the **Login form**.          | N/A                         |
| login - reset password clicked | The user clicked the "**Reset password**" link. | N/A                         |

* `errorCode` (string) — The error code received while opening the **Login screen**. Possible values: see [`accounts.connection.error_code`](/legacy/api-reference/accounts#object-error_code).
* `errorMessage` (string) — The error message received while opening the **Login screen**.

### MFA screen

![Argyle Link's MFA screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-mfa-screen)

| Event name   | Event description                                                     | Event-specific properties |
| ------------ | --------------------------------------------------------------------- | ------------------------- |
| mfa - opened | The user was presented with Multi-Factor Authentication (MFA) screen. | `type`, `mfaType`         |

* `type` (string) — Denotes whether the user was in the **Login screen** or **Direct deposit opened screen** when an **MFA screen** was shown to the user. Possible values: `Login`, `PDF Review`.
* `mfaType` (string) — Denotes the type of multi-factor authentication (MFA) method that was required of the user. Possible values: `sms_code`, `email_code`, `secret_question`, `email_link_confirmation`, `otp_code`, `email_message_conformation`.

### Success screen

![Argyle Link's Success screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-success-screen)

| Event name       | Event description                                                                    | Event-specific properties |
| ---------------- | ------------------------------------------------------------------------------------ | ------------------------- |
| success - opened | The user opened the **Success screen** after the account was successfully connected. | N/A                       |

### Account Status screen

![Argyle Link's Status screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-account-status-screen)

| Event name                    | Event description                               | Event-specific properties |
| ----------------------------- | ----------------------------------------------- | ------------------------- |
| account status - opened       | The user opened the **Account Status screen**.  | N/A                       |
| account status - disconnected | The user disconnected their employment account. | N/A                       |

### Direct deposit opened screen

![Argyle Link's Direct Deposit Opened screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1669129245/docs-2022/Guides/Argyle%20Link/Link%20Analytics/DDS_was_opened)

| Event name            | Event description                                       | Event-specific properties |
| --------------------- | ------------------------------------------------------- | ------------------------- |
| dds settings - opened | The user opened the **Direct deposit settings screen**. | `allocationType`          |

* `allocationType` (string) — Denotes which pay allocation type was shown when the user opened the **Direct deposit settings screen**. Possible values: `percent`, `amount`, `none`.

### Allocation type selection screen

![Argyle Link's Allocation type selection screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1669085489/docs-2022/Guides/Argyle%20Link/Link%20Analytics/DDS_allocation_type_selection)

| Event name                         | Event description                                         | Event-specific properties |
| ---------------------------------- | --------------------------------------------------------- | ------------------------- |
| allocation type selection - opened | The user opened the **Allocation type selection screen**. | N/A                       |

### Direct deposit success screen

![Argyle Link's Direct deposit success screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1669085662/docs-2022/Guides/Argyle%20Link/Link%20Analytics/DDS_success_screen)

| Event name           | Event description                                                                                          | Event-specific properties |
| -------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------- |
| dds success - opened | The user opened the **Direct deposit success screen** after their direct deposit was successfully updated. | N/A                       |

### Account Error Screen

![Argyle Link's Account Error screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-account-error-screen)

| Event name             | Event description                                       | Event-specific properties                                                                      |
| ---------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| account error - opened | The user received an error while connecting an account. | `connectionStatus`, `connectionErrorCode`, `payDistributionStatus`, `payDistributionErrorCode` |

* `connectionStatus` (string) — Represents the status of the link between Argyle and the work platform. Possible values: see [`accounts.connection.status`](/legacy/api-reference/accounts#object-status).
* `connectionErrorCode` (string) — Provides information on why the connection failed when `connection.status` is `error`. Possible values: see [`accounts.connection.error_code`](/legacy/api-reference/accounts#object-error_code).
* `payDistributionStatus` (string) — Denotes the point in the process of the direct deposit update. Possible values: see [`accounts.pay_distribution.status`](/legacy/api-reference/accounts#object-status).
* `payDistributionCode` (string) — Provides information on why the direct deposit update was unsuccessful when `pay_distribution.status` is `error`. Possible values: see [`accounts.pay_distribution.error_code`](/legacy/api-reference/accounts#object-error_code).

### Error screen

![Argyle Link's Error screen.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1/docs-v2/analytics-connection-error-screen)

| Event name     | Event description                              | Event-specific properties |
| -------------- | ---------------------------------------------- | ------------------------- |
| error - opened | The user received an error while opening Link. | `errorType`               |

* `errorType` (string) — The type of error received while opening Link. Possible values: `generic`, `invalid_link_items`, `invalid_pd_config`, `invalid_link_key`, `invalid_user_token`.

### Multiple screens

The event below happens on several screens:

| Event name  | Event description | Event-specific properties |
| ----------- | ----------------- | ------------------------- |
| link closed | User closed Link. | N/A                       |
