---
schema_version: "1"
id: 16814901c181fd673678f7926e501279a0c693e088c151356de8bce77a3955ef
title: Add Event Listeners for Tableau Next Components
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/sdk/guides/sdk-embedded-components-events.md
canonical_url: https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-embedded-components-events.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4752e83838ad9465d2853f7b9d18d4d8506c522450d2fa8d6b81fa3e40c80cbd
products:
  - Tableau Next Embedding SDK
  - analytics
---
# Add Event Listeners for Tableau Next Components

The SDK supports various events that your component can listen for and apply event handling logic to.

Supported events include:
- `COMPONENT_LOADED`: Generated when the component loads completely.
- `UPDATED_FILTERS`: Generated when the component filters update.
- `UPDATED_SELECTIONS`: Generated when the component selections update.
- `UPDATED_TIME_RANGE`: Generated when the time range for `AnalyticsMetric` updates.
- `RECEIVED_DATASOURCES`: Generated when the data sources for `AnalyticsDashboard` loads.
- `RECEIVED_FIELDS`: Generated when fields associated with a component loads.
- `RECEIVED_FILTERS`: Generated when a list of applied filters for a component loads.
- `RECEIVED_FILTER_FIELD_VALUES`: Generated when filter field values associated with a component field loads.
- `RECEIVED_INTERACTION_DETAILS`: Generated when the interaction details associated with a component loads.
- `RECEIVED_LAYOUT`: Generated when an applied layout for `AnalyticsMetric` loads.
- `RECEIVED_METADATA`: Generated when the metadata for a component loads.
- `RECEIVED_PAGES`: Generated when a list of page labels for `AnalyticsDashboard` loads.
- `RECEIVED_SELECTIONS`: Generated when a list of applied selections for `AnalyticsVisualization` loads.

- `DEFAULT`: Generated when any unnamed event occurs.
- `ERROR`: Generated when an error occurs. Use this to listen for errors.


## Example for Event Handling for Component Loaded
```javascript
analyticsComponent.addEventListener(EventName.COMPONENT_LOADED, (event) => {
  // Implement event handling logic
});
```

## Example for Error Handling
Use the `analyticsEventTarget` to listen for `EventName.ERROR`, with a callback to handle errors that are thrown if the SDK initialization fails due to wrong `orgUrl` or `authCredentials`.

```javascript
analyticsEventTarget.addEventListener(EventName.ERROR, (errorEvent) => {
		console.log("Received a global error event", errorEvent)
});
```
