---
title: "Tracking user interactions"
slug: "tracking-user-interactions"
abstract: "Methods available in Sitecore Search JS Data package to register user interactions."
---
# Tracking user interactions

Sitecore Search JS Data package offers various methods to register user interactions with your component.

## Registering user interactions

The following code block shows how you can register view and page view events. The methods contain all the necessary information to use HTTP to connect with Search. You must call these events after authentication.

```csharp
import {
  trackPageViewEvent,
    trackPageViewEvent
} from "@sitecore-search/data";

const widgetPayLoad = { keyphrase: "search word", index: 0 }
const trackViewEventPayload = { rfkid: "rfk_id", entities: "content", payload: widgetPayLoad  }
trackViewEvent ( trackViewEventPayload  )

const entityPayload = { id: "i2382", entityType: "content" }
const pageViewPayload = { items: [ entityPayload ] }
const trackPageViewEventPayload = { name: "detail", pageViewPayload: widgetPayLoad  }
trackPageViewEvent ( trackPageViewEventPayload )
```

## Available methods

The following table lists the various methods to register user interaction. In addition to the events for specific widget types, the list includes global and funnel events.

| Event interface | Event type |
| --- | --- |
| [trackRecommendationClickEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/recommendation-widget-events.html "Recommendation widget events") | Recommendation event |
| [trackRecommendationClickEntityEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/recommendation-widget-events.html "Recommendation widget events") | Recommendation event |
| [trackPreviewSearchClickEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/preview-search-widget-events.html "Preview search widget events") | Preview Search event |
| [trackSearchResultsClickEntityEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/search-results-widget-events.html "Search results widget events") | Search Results event |
| [trackSearchResultsFacetClickEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/search-results-widget-events.html "Search results widget events") | Search Results event |
| [trackViewEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/global-events.html "Global events") | Global event |
| [trackAddEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-rest-apis/using-the-events-api-to-track-events/funnel-events.html "Funnel events") | Funnel event |
| [trackRemoveEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-rest-apis/using-the-events-api-to-track-events/funnel-events.html "Funnel events") | Funnel event |
| [trackPageViewEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/global-events.html "Global events") | Global event |
| [trackEntityPageViewEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/global-events.html "Global events") | Global event |
| [\>trackUserLoginEvent](https://doc.sitecore.com/search/en/developers/search-developer-guide/integrating-using-search-js-data-package/tracking-user-interactions/global-events.html "Global events") | Global event |