# Attaching custom metadata to responses

## Overview

Custom metadata is any additional information you wish to include in your response. This metadata will be available in the Response list in the analytics section in Feedbackly. You can also filter and group responses by metadata.

Metadata will be included to the subsequent survey responses made by the visitor on the site. Metadata will always be included in responses until it is cleared or the user resets their browser cookies.

Note: Metadata can be added at any point of time **before** a survey is launched.&#x20;

### Using the Javascript API to include metadata to the response

When the Feedbackly widget is installed on the site, run

```
FBLY.action("addMeta", KEY, VALUE);
```

Example:

&#x20;`FBLY.action("addMeta", "customerId", "12345");`

This command adds a customer id to the subsequent responses of the user.

### Removing a single metadata value from the visitor

This action will a single metadata key and value from the visitor. It does not affect previous responses given by the user, however.

```
FBLY.action("removeMeta", KEY)
```

Example:&#x20;

`FBLY.action("removeMeta", "customerId")`

This action removes the customerId set in the previous example.

### Clearing all metadata from a visitor

This action will clear all the metadata from the visitor. It does not affect previous responses given by the user, however. This action needs to be run before a survey is launched.

Using Javascript, run

```
FBLY.action("clearMeta")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.feedbackly.com/website-widgets/adding-custom-metadata-to-responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
