---
title: "JavaScript SDK: Custom data"
description: "Attach custom data to customer feedback with the Gleap JavaScript SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/409-javascript-sdk-custom-data
collection: "JavaScript"
updated: 2026-11-01
language: en
---

# JavaScript SDK: Custom data

Attach custom data to customer feedback with the Gleap JavaScript SDK. Follow the integration code examples.

> **Warning:** If you are trying to set data for ticket attributes, please check our 💼 Ticket attributes.

## Add custom data

In many situations you may want to attach custom data to tickets in order to better understand the context. You can add custom data incrementally or all at once. Any simple JSON object can be attached.

```javascript
Gleap.attachCustomData({
  test1: "Battle",
  data2: "Unicorn",
});
```

## Append custom data

If you want to attach custom data incrementally you can do so with the `setCustomData` method.

```javascript
Gleap.setCustomData("email", "avery@example.com");
```

## Remove custom data

Remove custom data key value pairs by calling the following method.

```javascript
Gleap.removeCustomData("email");
```

## Clear all custom data

It's possible to clear all attached custom data by calling the following method.

```javascript
Gleap.clearCustomData();
```

## Related

- [JavaScript SDK setup](https://docs.gleap.ai/en/articles/393-javascript-sdk-setup.md)
- [JavaScript SDK: Code snippet](https://docs.gleap.ai/en/articles/394-javascript-sdk-code-snippet.md)
- [JavaScript SDK: User identity](https://docs.gleap.ai/en/articles/395-javascript-sdk-user-identity.md)
- [JavaScript SDK: Callbacks](https://docs.gleap.ai/en/articles/396-javascript-sdk-callbacks.md)
- [JavaScript SDK: AI chatbar](https://docs.gleap.ai/en/articles/397-javascript-sdk-ai-chatbar.md)
