labvanced logoLabVanced
  • Research
    • Publications
    • Researcher Interviews
    • Use Cases
      • Developmental Psychology
      • Linguistics
      • Clinical & Digital Health
      • Educational Psychology
      • Cognitive & Neuro
      • Social & Personality
      • Arts Research
      • Sports & Movement
      • Marketing & Consumer Behavior
      • Economics
      • HCI / UX
      • Commercial / Industry Use
    • Labvanced Blog
    • Services
  • Technology
    • Feature Overview
    • Code-Free Study Building
    • Eye Tracking
    • Mouse Tracking
    • Generative AI Integration
    • Multi User Studies
    • More ...
      • Reaction Time/Precise Timing
      • Text Transcription
      • Heart Rate Detection (rPPG)
      • Emotion Detection
      • Questionnaires/Surveys
      • Experimental Control
      • Data Privacy & Security
      • Desktop App
      • Mobile App
  • Learn
    • Guide
    • Videos
    • Walkthroughs
    • FAQ
    • Release Notes
    • Documents
    • Classroom
  • Experiments
    • Cognitive Tests
    • Sample Studies
    • Public Experiment Library
  • Pricing
    • Licenses
    • Top-Up Recordings
    • Subject Recruitment
    • Study Building
    • Dedicated Support
    • Checkout
  • About
    • About Us
    • Contact
    • Downloads
    • Careers
    • Impressum
    • Disclaimer
    • Privacy & Security
    • Terms & Conditions
    • Third-Party Licenses
  • Appgo to app icon
  • Logingo to app icon
Learn
Guide
Videos
Walkthroughs
FAQ
Newsletter Archive
Documents
Classroom
  • 中國人
  • Deutsch
  • Français
  • Español
  • English
  • 日本語
Guide
Videos
Walkthroughs
FAQ
Newsletter Archive
Documents
Classroom
  • 中國人
  • Deutsch
  • Français
  • Español
  • English
  • 日本語
  • Guide
    • GETTING STARTED

      • Task Editor
      • Stimulus Presentation
      • Correctness of Response
      • Objects
      • Events
      • Variables
      • Task Wizard
      • Trial System
      • Study Design
        • Tasks
        • Blocks
        • Sessions
        • Groups
    • FEATURED TOPICS

      • Experiment Design
        • Creating a Study
        • Data Frame Patterns
      • Randomization & Balance
      • Eye Tracking
        • Presenting Stimuli in an Eye Tracking Task
        • How to Choose Eye Tracking Calibration Settings
        • Setting Up Eye Tracking in a Task
        • Recording and Exporting Gaze Data
        • Using Shapes as Areas of Interest (AOI) for Eye Tracking
        • The Participant Calibration Experience
      • Questionnaires
      • Desktop App
      • Sample Studies
      • Participant Recruitment
      • API Access
        • REST API
        • Webhook API
        • WebSocket API
      • Other Topics

        • Precise Stimulus Timings
        • Multi User Studies
        • Head Tracking in Labvanced | Guide
    • MAIN APP TABS

      • Overview: Main Tabs
      • Dashboard
      • My Studies
      • Shared Studies
      • My Files
      • Experiment Library
      • My Account
      • License & Services
    • STUDY TABS

      • Overview: Study-Specific Tabs
      • Study Design
        • Tasks
        • Blocks
        • Sessions
        • Groups
      • Task Editor
        • Task Controls
        • The Trial System
        • Canvas and Page Frames
        • Objects
        • Object Property Tables
        • Variables
        • System Variables Tables
        • The Event System
        • Text Editor Functions
        • Eye Tracking Options in the Task Editor
        • Head Tracking in a Task
        • Multi-User Studies
      • Settings
      • Variables
      • Media
      • Texts & Translate
      • Launch & Participate
      • Subject Management
      • Dataview and Export
        • Dataview and Variable & Task Selection (OLD Version)
        • Accessing Recordings (OLD Version)
  • Videos
    • Video Overview
    • Getting Started in Labvanced
    • Creating Tasks
    • Element Videos
    • Events & Variables
    • Advanced Topics
  • Walkthroughs
    • Introduction
    • Stroop Task
    • Lexical Decision Task
    • Posner Gaze Cueing Task
    • Change Blindness Flicker Paradigm
    • Eye-tracking Sample Study
    • Infant Eye-tracking Study
    • Attentional Capture Study with Mouse Tracking
    • Rapid Serial Visual Presentation
    • ChatGPT Study
    • Eye Tracking Demo: SVGs as AOIs
    • Multi-User Demo: Show Subjects' Cursors
    • Gamepad / Joystick Controller- Basic Set Up
    • Desktop App Study with EEG Integration
    • Between-subjects Group Balancing and Variable Setup
  • FAQ
    • Features
    • Support Policy & Guidelines
    • Security & Data Privacy
    • Licensing
    • Precision of Labvanced
    • Programmatic Use & API
    • Using Labvanced Offline
    • Troubleshooting
    • Study Creation Questions
  • Newsletter Archive
  • Documents
  • Classroom

Recording and Exporting Gaze Data

Once eye tracking is enabled and configured for a task (see Setting Up Eye Tracking in a Task), you need events that actually capture gaze data as recorded variables.

Automated Event Setup

The moment you check Enable Eye-Tracking: in the task editor, an "Eyetracking Setup" dialog appears, offering to create these events for you:

Eyetracking Setup dialog offering to automatically create gaze and fixation recording events

  • Record gaze timeseries [X,Y,T,C]: creates a gaze-recording event, checked by default
  • Record fixation timeseries [X,Y,Dur,Start,End,Disp]: creates a fixation-recording event, checked by default. If your task's Fixation Detection mode was set to No Fixation Detection, accepting this option switches it on automatically.

You also choose the scope: On all frames (the default) applies the recording events across every frame in the trial, or Select a frame restricts them to one specific frame. Clicking Add Events creates the events with these choices; Skip closes the dialog without creating anything.

This covers the common case: recording every gaze and fixation sample across a trial. Build the events manually instead if you skipped this dialog, need to restrict recording to specific stimulus objects (see below), or are adding eye tracking events to a task that already exists.

Recording Gaze Coordinates Manually

To record a timeseries of gaze coordinates:

  1. Add a new event from the events editor.
  2. For the trigger, select Physiological Signal Triggers → Eyetracking Gaze.
  3. For the action, select Variable Actions → Set / Record Variable, then create a new variable:
    • Format: Array (recommended, so a pair of X/Y coordinates can be stored together)
    • Record Type: All changes / time series, so every gaze update is recorded, not just the final value at the end of a trial
  4. In the value select menu, choose Coord. + Time + Confidence [X,Y,T,C] Array from the Trigger (Eyetracking Gaze) options. This records the X and Y coordinates, a precise timestamp, and a confidence value in a single array.

There is also an Eyetracking Fixation trigger, which reports a participant's fixations (where their gaze settles, rather than every individual gaze sample) using the Fixation Detection mode configured in task setup. It is currently in beta.

Restricting Recording to Specific Stimulus Objects

Both the Eyetracking Gaze and Eyetracking Fixation triggers can be restricted to only fire when the participant is looking at specific stimulus objects, rather than anywhere on the frame. To do this, select the option to only trigger on specific elements, then add those elements as targets. This is useful when you only care whether a participant looked at a particular image or region, not their gaze position everywhere else on the frame.

Recording Calibration and Trial Error

Alongside gaze coordinates, you can record how accurate the eye tracking was for a given participant:

  1. Add another event, with On Frame Start as the trigger.
  2. For the action, select Variable Actions → Set / Record Variable.
  3. In the value select menu, under Frame/Task/Object → Eyetracking, choose Error Trial to record the error for the current trial, or Error Calibration to record the error from the original calibration.

Both error values are mean euclidean distances, in frame units, between predicted gaze coordinates and the actual target fixation locations shown during calibration or between trials. Recording both lets you exclude participants, or specific trials, that fall below your accuracy threshold during analysis.

Exporting Gaze Data

Navigate to the Dataview & Export tab to access your recorded data. There are two kinds of export:

  • Normal data: recorded once per trial, such as responses, conditions, and calibration/trial error if you chose to record them. Each variable is its own column, each trial its own row.
  • Timeseries data: recorded continuously throughout a trial, which is what gaze coordinates use since they update many times per second. Each row represents one gaze sample, alongside a separate times column shared across all timeseries variables.

Preview of data collected using Labvanced's webcam eye tracking.

Preview of data collected using Labvanced's webcam eye tracking
X: X-coordinate of gaze; Y: Y-coordinate of gaze; T: Timestamp; C: Confidence Interval

A few things to keep in mind when working with these columns:

  • Base your time measurements on T rather than the separate times column. T is the adjusted timestamp of when the camera actually captured the image, while times reflects when Labvanced recorded the value, which runs slightly behind the real capture moment since the algorithm needs a few milliseconds to process each snapshot first.
  • C ranges from 0 to 1. A value near 1 indicates a confident detection; a value near 0 typically indicates a blink or that the participant's eyes were not visible to the camera.
  • Sampling rate is not perfectly constant and can be determined from T. In general, sampling rates above 30Hz are not achievable, due to the hardware constraints of most commercially available webcams.

Labvanced's GitHub repository has scripts for further processing exported eye tracking and WebSocket data.

Frequently Asked Questions

If I skip the automated Eyetracking Setup dialog, can I still record gaze data?
Yes. Build the recording events manually instead, using an `Eyetracking Gaze` or `Eyetracking Fixation` trigger with a `Set / Record Variable` action, as covered above. This is also the path to take if you need to restrict recording to specific stimulus objects, or are adding eye tracking events to a task that already exists.
Should I base my timing analysis on the `times` column or on `T`?
Use `T`. `T` (`Camera Capture Time T`) is the adjusted timestamp of when the camera actually captured the image, while `times` reflects when Labvanced recorded the value, which lags slightly behind since the algorithm needs a few milliseconds to process each snapshot first. The same distinction applies to `Camera Capture Time T` under the Emotion Detection trigger's values in the Value-Select Menu.
What does a Confidence (`C`) value near 0 mean?
It typically indicates a blink or that the participant's eyes were not visible to the camera. A value near 1 indicates a confident detection.
Why isn't my gaze data sampled at a perfectly constant rate?
Sampling rate is not perfectly constant and can be determined from `T`. In general, sampling rates above 30Hz are not achievable, due to the hardware constraints of most commercially available webcams.
How do I know whether a low-quality calibration or a specific trial is responsible for bad gaze data?
Record both `Error Calibration` and `Error Trial` as variables. Both are mean euclidean distances, in frame units, between predicted gaze coordinates and the actual target fixation locations, letting you exclude participants or specific trials that fall below your accuracy threshold during analysis.
Can I record gaze data only for specific objects, rather than the whole frame?
Yes. Both the `Eyetracking Gaze` and `Eyetracking Fixation` triggers can be restricted to fire only when the participant is looking at specific stimulus objects added as targets, rather than anywhere on the frame.

Further Reading

Setting Up Eye Tracking in a Task

Enable eye tracking and configure recalibration before building the events on this page.

Using Shapes as Areas of Interest (AOI)

Define regions of a frame that gaze and fixation triggers can target.

Webcam Eye Tracking Technology

How Labvanced's webcam eye tracking technology works.

Time Series Variables

The general Record Type and Sampling Method settings that control how continuous data like gaze is captured.

Task Controls

The automated Eyetracking Setup dialog shown above, in the context of the full Task Controls reference.

Prev
Setting Up Eye Tracking in a Task
Next
Using Shapes as Areas of Interest (AOI) for Eye Tracking