> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/import-and-post-processing/importing-generic-screen-based-eye-tracking-into-imotions.md).

# Importing generic screen-based eye tracking into iMotions

Import screen-based eye tracking data recorded outside iMotions Lab by formatting it as tab-separated .tlv files and importing it as external data.

You can import screen-based eye tracking data that was recorded outside iMotions Lab, for example with another eye tracker or software, and analyze it like data recorded in iMotions. This article explains how to set up the study, format the data and import it.

## Setting up the study

1. Create a study. Under **Select sensors**, select **Eye tracking** and select **Mouse Simulator** as the eye tracker, unless you also want to record respondents with an eye tracker connected to iMotions.

   ![Select sensors with Eye tracking selected and Mouse Simulator chosen in the eye tracker list](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-e80ce7137d93da2671417cb40ef8c1a81808c013%2F9a5c2de336_generic-et-select-mouse-simulator.png?alt=media)
2. Set the screen resolution of the study to the resolution of the screen on which the eye tracking data was recorded. The gaze coordinates are imported as pixels on that screen.
3. Add the stimuli that the respondents saw. The stimulus names must match the names of your data files; see [Organizing the files](#organizing-the-files).

## Formatting the data

Create one file for each respondent and stimulus. Each file is a tab-separated text file with the extension `.tlv`, with one header row followed by one row per gaze sample. These columns are used:

| Column                                                                        | Required | Description                                                                                                                           |
| ----------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `GazeTimeStamp`                                                               | Yes      | Time of the sample in milliseconds, as a whole number, from the start of the stimulus. The first sample usually has the time stamp 0. |
| `GazeLeftX`, `GazeLeftY`                                                      | Yes      | Gaze position of the left eye in pixels, in the resolution of the study.                                                              |
| `PupilDiaLeft`                                                                | Yes      | Pupil diameter of the left eye in millimeters.                                                                                        |
| `ValidityLeft`                                                                | Yes      | `0` for a valid gaze sample, `2` for a missing gaze sample.                                                                           |
| `DistanceLeft`                                                                | No       | Distance between the left eye and the screen in centimeters.                                                                          |
| `GazeRightX`, `GazeRightY`, `PupilDiaRight`, `ValidityRight`, `DistanceRight` | No       | The same values for the right eye.                                                                                                    |

If you only have data for one eye, fill in the left-eye columns and copy them to the right-eye columns.

For example, the first rows of a file look like this, with the columns separated by tabs:

| GazeTimeStamp | GazeLeftX | GazeLeftY | PupilDiaLeft | DistanceLeft | ValidityLeft | GazeRightX | GazeRightY | PupilDiaRight | DistanceRight | ValidityRight |
| ------------- | --------- | --------- | ------------ | ------------ | ------------ | ---------- | ---------- | ------------- | ------------- | ------------- |
| 0             | 1244.0    | 825.8     | 3.6          | 62.5         | 0            | 1244.0     | 825.8      | 3.6           | 62.5          | 0             |
| 17            | 1250.5    | 830.9     | 3.6          | 62.9         | 0            | 1250.5     | 830.9      | 3.6           | 62.9          | 0             |

## Organizing the files

Put the files in a folder with one subfolder per respondent. Name each subfolder after the respondent and each file after the stimulus it belongs to:

```
GenericETData
├── Resp001
│   ├── volvo_car.tlv
│   └── audi_car.tlv
└── Resp002
    ├── volvo_car.tlv
    └── audi_car.tlv
```

In this example, the study must contain the stimuli `volvo_car` and `audi_car`. Files for stimuli that are not in the study cannot be imported.

## Importing the data

1. In the **Library**, right-click the study and select **External Data** > **Import**.

   ![The study menu in the Library with External Data and Import selected](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-aec874226397c453dbfd0f528d0b59384d664f9f%2Fe4238ddfac_generic-et-external-data-import.png?alt=media)
2. In the **Import External Data** window, click **Browse** and select the folder with the respondent subfolders, then click **Load**. iMotions checks the files and lists the valid respondents and stimuli. If a respondent or file is not valid, click **Log** to see why.

   ![Import External Data with the study data folder and two valid respondents](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-01aa8b25a7f6f84f5c51b9fb7f855fa14f168d3b%2Fb3453839c9_generic-et-import-summary.png?alt=media)
3. Click **Save** to import the data. iMotions confirms which respondents were imported.

   ![Success message for the import of two respondents](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-59e79fb87eace5fc4389ec03642987e2bbd3254f%2F2f7a175bdb_generic-et-import-succeeded.png?alt=media)

iMotions creates one respondent per subfolder, named after the subfolder, with the imported eye tracking data. The **Recorded Data** tab shows the sample rate and data quality of each respondent.

![The imported respondents in the Respondents list, with the Recorded Data tab of Resp001](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-d2d3bda741045cbeb8e7e6e6b0730c479ed27593%2F1e14e41de3_generic-et-imported-respondents.png?alt=media)

You can now review the data in the [Respondent Replay](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/my-library/respondent-replay.md) and analyze it like data recorded in iMotions; see [Analysis overview](https://help.imotions.com/lab/getting-started/analysis-overview.md).

![The Respondent Replay with the imported gaze shown on the stimulus](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-9e4a75904f5efb9dbe924fe619eb4569e3a7aec9%2F4bc501ce74_generic-et-replay-imported-gaze.png?alt=media)

## Example files

The example data contains eye tracking files for two respondents, organized as described above, for a stimulus named `sampledata`. The example study is an iMotions study file with one stimulus and imported data; open it with **Load Study From File**, as described in [Clone, Save, and Import iMotions Studies](https://help.imotions.com/lab/study-setup-and-design/imotions-setup/clone-save-and-import-imotions-studies.md).

{% file src="/files/SxZ9whm3jpIheIDgveHR" %}
Generic eye tracking example data
{% endfile %}

{% file src="/files/n8reIDijmQdaVBxLI9YM" %}
Generic eye tracking import example study
{% endfile %}


---

# 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://help.imotions.com/lab/import-and-post-processing/importing-generic-screen-based-eye-tracking-into-imotions.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.
