---
title: "Walkthrough: Tracking user interactions"
slug: "walkthrough--tracking-user-interactions"
abstract: "How to use Sitecore Discover JS SDK to track user interactions in your React application."
---
# Walkthrough: Tracking user interactions

This procedure is the part four of the [Developing the UI walkthrough series](https://doc.sitecore.com/discover/en/developers/discover-js-sdk-for-react/developing-the-ui-walkthrough-series.html "Developing the UI walkthrough series").

At runtime without requiring any additional code, Sitecore Discover JS SDK [registers user interactions](https://doc.sitecore.com/discover/en/developers/discover-js-sdk-for-react/developing-the-ui-walkthrough-series/events.md "Events"). The JS SDK is either directly or indirectly involved with these interactions. However, there are some events that the JS SDK has no awareness when they take place.

> [!note]
> To track events that do not involve the JS SDK, you need to track them verbosely.

When a visitor logs in or adds an item to the shopping cart, there is no way for the JS SDK to know these events without being specifically informed. All [funnel and some global events](https://doc.sitecore.com/discover/en/developers/discover-js-sdk-for-react/developing-the-ui-walkthrough-series/events.md "Events") have to be verbosely tracked as shown in the following procedure to log in a user.

To track an event verbosely:

- To track a user login, paste following code in login page.

    ```js
    import { trackUserLoginEvent } from '@sitecore-discover/ui';

    trackUserLoginEvent({
        id: '8743b52063cd84097a65d1633f5c74f5',
        email: 'user@example.com',
        // Optional. User's billing address
        address: {
            address_line_1: '123 Main Street',
            address_line_2: 'apartment 123',
            state: 'CA',
            zip: '90210',
            country: 'USA',
        },
        // Optional
        gender: 'female',
        groups: ['group1', 'group2'],
        addn_attributes: {
            email_subscriber: 'True',
            preferred_sizes: ['S', 'M', '32W', '30L'],
            home_store_code: '4321',
        }
    });
    ```