# Feedback Widget

![Frame 525](https://user-images.githubusercontent.com/23535123/181665543-95ee7c9c-c7cc-4a2c-ab5b-7f74e8c54cec.png)

## Usage

Import the widget

```html
<script
  type="module"
  src="https://cdn.logsnag.com/feedback/ls.js"
></script>
```

## Add data tags to your button

```html
<button
  data-logsnag-feedback
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
>
  Feedback
</button>
```

## Include User ID

You may include the user id by adding the `data-logsnag-user-id` tag to your button.

```html
<button
  data-logsnag-feedback
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
  data-logsnag-user-id="<USER_ID>"
>
  Feedback
</button>
```

## Add custom tags

You may add custom tags to your feedback widget by adding the following data tags to your button.

```html
<button
  data-logsnag-feedback
  <!-- custom username tag -->
  data-logsnag-tag-username="john.doe"
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
>
  Feedback
</button>
```

{% hint style="danger" %}
**Important**: Please ensure that your token is set to "Public" and that its roles are limited to the project that you're logging to.
{% endhint %}

![Screen Shot 2022-07-28 at 1 34 17 PM](https://user-images.githubusercontent.com/23535123/181601494-93396b89-67da-4538-b535-557b68af12d3.png)


---

# 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.logsnag.com/tools/feedback-widget.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.
