> For the complete documentation index, see [llms.txt](https://docs.meta-inf.hu/myra-master-your-ratings/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meta-inf.hu/myra-master-your-ratings/cookbook/embed-fields.md).

# Embed fields

Attach hidden context from your website to Myra survey submissions with data-myra-fields.

Use **Embed fields** to pass context from your own website into a survey submission — for example a tenant id or an internal user id. Respondents never see or edit these values. Admins see them in the submission detail modal and CSV export, like any other text answer.

Embed fields only apply to **website collection embeds** (popup button or inline form). They are ignored on the JSM portal, issue panel, public standalone page, and score widgets.

## Set up an embed field

{% stepper %}
{% step %}

### Add the field in Survey Builder

Open the survey's **Survey builder** tab, add a question, and choose **Embed field**.

* **Question text** is the label used in reports (required).
* **Embed key** is the JSON key you will put on the website (for example `tenantId`). It can only be set when you create the field.
* Embed fields cannot be required, hidden, or shown as score widgets.

Click **Save changes**.
{% endstep %}

{% step %}

### Put the key on your embed markup

On the same element as `data-myra-survey` (popup) or `data-myra-survey-inline` (inline form), add `data-myra-fields` with a JSON object. Each key must match an embed key from Survey Builder.

```html
<button
  data-myra-survey="<encrypted-payload>"
  data-myra-fields='{"tenantId":"acme","internalUserId":"u_123"}'
  type="button"
>
  Rate us
</button>
```

The same attribute works on an inline container:

```html
<div
  data-myra-survey-inline="<encrypted-payload>"
  data-myra-fields='{"tenantId":"acme"}'
></div>
```

{% endstep %}

{% step %}

### Review the values in reports

After a visitor submits, open the survey report. Embed-field answers appear as extra text columns you can show in the table, in the submission detail, and in CSV export.
{% endstep %}
{% endstepper %}

## What Myra accepts

Invalid or extra values are dropped. The survey still submits.

| Rule      | Limit                                                                                                |
| --------- | ---------------------------------------------------------------------------------------------------- |
| Values    | Strings only. Numbers, objects, and arrays are ignored.                                              |
| Keys      | Letters, numbers, underscores, or hyphens; max 64 characters. Must match an Embed field's embed key. |
| HTML      | Tags are stripped before the value is stored.                                                        |
| Per value | Max 512 UTF-8 bytes (truncated).                                                                     |
| Key count | Max 20 keys. Extra keys are dropped.                                                                 |
| Whole bag | Max 4 KB of JSON. An oversized attribute is ignored.                                                 |

{% hint style="info" %}
Website score widgets (`data-myra-widget`) do not collect answers, so `data-myra-fields` on a widget has no effect.
{% endhint %}

See also [Collect Feedback on Your Website with Myra](https://docs.meta-inf.hu/myra-master-your-ratings/cookbook/collect-feedback-on-your-website-with-myra.md) and [Survey Builder](https://docs.meta-inf.hu/myra-master-your-ratings/use-myra/survey-builder.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.meta-inf.hu/myra-master-your-ratings/cookbook/embed-fields.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
