Qualtrics Integration
Qualtrics is the survey engine at the heart of the TABS research project. It hosts the survey instrument, manages branching logic, captures respondent data, and handles the post-survey redirect flow. We interact with Qualtrics programmatically via its REST API v3, which enables us to copy surveys, inspect definitions, apply configuration changes, and export data — all from GitHub Actions.
Why Qualtrics
We chose Qualtrics for several reasons critical to a long-term academic survey:
- Sophisticated logic capabilities — Complex question branching adapts to the respondent's role and industry, ensuring participants see only the questions relevant to them.
- Enterprise-grade security — SOC 2 Type II compliance, data encryption at rest and in transit, and fine-grained access controls.
- API-first platform — Every aspect of survey management (creation, configuration, export) is accessible via REST endpoints, enabling full automation.
- Embedded Data & Survey Flow — The Survey Flow engine allows us to capture URL parameters, set variables, branch conditionally, and control the respondent experience without custom code.
API Integration Pattern
Every Qualtrics API call is authenticated with an X-API-TOKEN header. The token is stored as a GitHub Actions secret in the qualtrics-prod environment and is never committed to the repository.
Key environment values
QUALTRICS_BASE_URL— Datacenter root (e.g.,https://yul1.qualtrics.com)QUALTRICS_SURVEY_ID— Active survey ID (updated during annual rollover)QUALTRICS_API_TOKEN— API authentication secret
TypeScript Client Library
The repository includes a TypeScript client (src/lib/qualtrics-api.ts) that wraps common API operations. This client is used by both GitHub Actions workflows and local development scripts. Key functions include survey listing, definition export, question fetching, and metrics retrieval.
MCP Server Integration
For IDE-integrated AI agents, Qualtrics also provides an MCP (Model Context Protocol) server that supports OAuth 2.0 authentication. This allows coding agents in VS Code to query surveys, inspect definitions, and copy surveys interactively via the .vscode/mcp.json configuration. The MCP server supplements the REST API for interactive use cases.
Automated Workflows
Seven GitHub Actions workflows automate different aspects of Qualtrics management:
| Workflow | Purpose | Trigger | Read / Write |
|---|---|---|---|
| qualtrics-api-smoke | Connectivity & credential test | Manual | Read-only |
| qualtrics-dump-flow | Export Survey Flow JSON | Manual | Read-only |
| qualtrics-metrics-update | Update response counts & question count | Daily + Manual | Read-only |
| fetch-qualtrics-questions | Extract survey question metadata | Manual | Read-only |
| qualtrics-prolific-verify | Verify Prolific integration markers | Manual | Read-only |
| qualtrics-copy-survey | Copy survey for annual rollover | Manual (confirmation required) | Write |
| qualtrics-prolific-apply | Apply Prolific integration config | Manual (confirmation required) | Write |
Safety gates
Write workflows require explicit confirmation. The copy and apply workflows include a safety gate where you must type APPLY to confirm the operation. This prevents accidental modifications to the live survey.
Survey Flow Architecture
The most critical piece of the Qualtrics configuration is the Survey Flow — the sequence of logic steps executed for each respondent. The TABS survey uses a "redirect lockdown" pattern with two conditional branches that ensure every respondent ends up at the correct destination.
The Two-Branch Design
The survey accepts respondents from two channels: website visitors (via a button on technologyadoptionbarriers.org) and Prolific participants (launched by Prolific with participant IDs). After all question blocks, two conditional branches determine the redirect:
Branch 1 — SOURCE is not empty
Respondent came from a known channel. Sets COMPLETE_URL to the website completion page and redirects there.
Branch 2 — PROLIFIC_PID is not empty
Safety net for Prolific participants arriving without SOURCE. Sets the source and redirects to Prolific's completion URL.
The redirect lockdown prevents open-redirect vulnerabilities by hard-coding COMPLETE_URL in the Survey Flow rather than accepting it as a URL parameter. See the Technical Integrations overview for the full visual flow diagram.
Annual Survey Rollover
TABS runs a 10-year data collection effort. Each year, a new copy of the survey is created to keep yearly data cleanly separated. The recommended rollover sequence:
- Test connectivity — Run the smoke test workflow to verify API credentials are valid.
- Copy the survey — Use the copy workflow to clone the current year's survey.
- Update environment variable — Point
QUALTRICS_SURVEY_IDat the new survey ID in GitHub environment variables. - Verify configuration — Run the verification workflow against the new survey.
- Apply Prolific integration — If the copy didn't preserve Survey Flow branches, re-apply them using the apply workflow.
- Update Prolific study — Point the Prolific study's external URL at the new Qualtrics survey link.
This entire process can be completed in under 30 minutes using the automated workflows. All steps are documented in PROLIFIC_INTEGRATION.md.
Data-Driven Site Metrics
The Qualtrics integration feeds live data to the website. The daily metrics workflow queries the Qualtrics API for response counts and question metadata, then writes the results to src/data/qualtrics-metrics.json. The homepage and media page import this file to display:
- Surveys Completed — Total response count across all distribution channels
- Survey Questions — Actual question count fetched from the survey definition API (replacing a previously hardcoded "100+")
This ensures the numbers displayed on the site always reflect the current state of the survey without manual updates.
Related
- Technical Integrations overview
- Prolific Integration — participant recruitment and the Qualtrics–Prolific bridge
- Google Analytics Integration — impact measurement and verified visitors
This page documents the Qualtrics integration as of February 2026. For the most current API details, see qualtrics-api-cheatsheet.md in the project repository.
