---
title: "trackUserLoginEvent"
slug: "trackuserloginevent"
abstract: "Describes a function offered by Sitecore Search JS Data package that triggers an event to track user login."
---
# trackUserLoginEvent

## trackUserLoginEvent

This function triggers an event that is dispatched when the visitor logs in to your website.

| Name | Type | Description |
| --- | --- | --- |
| *user* | [UserModel](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/trackuserloginevent.html#UUID-5a787853-4f60-2887-8e8d-5cc6285d85b6_section-idm1745076056086190 "UserModel") | Required.<br><br>Describes the visitor. |

### UserModel

Payload dispatched in the event triggered by the `trackUserLoginEvent` function. The `id` and `email` in the model is assigned to the [event's context object](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-rest-apis/using-the-events-api-to-track-events/adding-context-to-an-event-object.html "Adding context to an event object") `value.context.user.cuid` and `value.context.user.email` fields.

| Name | Type | Description |
| --- | --- | --- |
| *id* | string | UUID associated with the visitor. The value can be obtained from the cookie added by the SDK. |
| *email* | string | The email address used to log in. |

> [!note]
> Provide the value for at least one of the `UserModel` properties.