Skip to main content

What logging and analytics does a PI need from a study platform?

A PI needs an append-only event log recording every participant action with a timestamp, pseudonymous ID, study condition and software version, plus exports an analyst can load without cleaning. Built in from the start, this takes 44 to 82 hours, about $3,700 to $7,000 at $85 an hour. Retrofitted mid-pilot, it costs more and loses weeks of data.

Why logging is part of the research design, not a feature

An efficacy study tests whether an intervention works. If the platform cannot show who saw which condition, for how long, and on which version of the software, the analysis rests on assumptions. Reliability and logging are research validity: a dropped event is missing data, and a silent bug in one condition is a confound.

Program officers notice this too. A proposal that describes a logging schema, a data dictionary and a validation check reads as a study that will produce usable data. A proposal that says the app "will collect usage analytics" reads as a prototype.

What every logged event should contain

Log events, not summaries. Totals and dashboards can always be computed from events; events can never be rebuilt from totals. A minimal event record looks like this:

Field Example Why the analyst needs it
event_id UUID generated on the device Removes duplicates when a flaky network resends
participant_id Pseudonymous code, not a name or student number Links sessions without exposing identity
condition control, hint_v2, model_b Every analysis splits on it
client_time and server_time Both, in UTC Catches clock drift on school devices
session_id One per login Measures dosage and session length
event_type problem_started, answer_submitted, hint_requested The behavior being studied
payload Answer given, correct or not, item ID The outcome detail
app_version Git commit or release tag Separates data from before and after a fix
site_id / class_id Pseudonymous codes Supports nested models by teacher and school

For studies that use a language model, add the model name and version, the prompt template ID, the full prompt and response, latency and token counts. If you are comparing prompting strategies, the template ID matters more than anything else in the record.

The analytics layer: three audiences, three outputs

The analyst

A scheduled export (CSV or Parquet) with one row per event, a data dictionary describing every field, and a stable schema that does not change mid-study without a version note. This is what the efficacy study actually runs on.

The PI and program officer

A fidelity-of-implementation view: active participants per week, sessions per participant, minutes of use per condition, and which sites have gone quiet. This tells you in week three, not week twelve, that one district stopped using the tool.

Teachers

Whatever the protocol allows them to see, and nothing more. In some designs teacher-facing data is part of the intervention; in others it contaminates the control group. Decide this with your methodologist before building it.

FERPA-aware design choices

FERPA governs education records held by schools and districts, and your data use agreement with each district sets the specific terms. COPPA can apply when an online service collects personal information from children under 13. These are legal questions; your institution’s counsel or compliance office and IRB sign off, not the engineering team. What engineering can do is make the compliant answer easy:

  • Store pseudonymous IDs in the event log and keep the linkage table, which maps IDs to roster names, in a separate store with tighter access, or with the district only.
  • Collect only the fields the analysis plan needs. Free-text inputs and audio are the usual sources of accidental identifiers.
  • Write retention and deletion into the system so you can honor the end date in the data use agreement.
  • Keep an access log showing who exported what, and when.
  • Document all of the above in the technical disclosure a district IT office will ask for.

Worked example: sizing a one-semester pilot

Take 20 teachers with 25 students each, so 500 participants, using the platform three times a week for 12 weeks. At about 200 events per session, that is 500 × 3 × 12 × 200 = 3.6 million events. At roughly 1 KB per event, about 3.6 GB. Storage is not the constraint; data quality is.

The engineering effort, as a general range for a platform that already works as a prototype:

Step Duration Typical hours
Logging schema and data dictionary, agreed with the analyst Week 1 8–12
Instrument the client, with offline queue and retry Weeks 1–2 16–30
Server-side validation, deduplication and version stamping Week 2 8–16
Scheduled analyst export and fidelity dashboard Week 3 8–16
Dry run with test accounts, then purge them Weeks 3–4 4–8

That totals 44–82 hours, or about $3,700–$7,000 at our $85 hourly rate. The top of the range is when the study uses a language model, has more than two conditions, or must run offline on school Chromebooks.

What breaks first when research code meets a school network

  1. Lost events on weak Wi-Fi. A prototype that sends events directly to the server drops them when the connection blinks. Queue events on the device and resend until the server confirms.
  2. Duplicates from resends. The fix for the first problem creates this one. A device-generated event_id lets the server ignore repeats.
  3. Version drift. A bug fix shipped in week four changes behavior for half the study. Stamp every event with app_version and keep a release log the analyst can read.
  4. Test data in the real data. Teacher demo accounts and developer logins end up in the export. Flag them at creation, not after.
  5. Saves that fail silently. If student work is lost, so is the outcome measure. On an NSF-funded React/Firebase research platform used across several universities, we made saving and loading student work 100% reliable and gave the distributed research groups one deployment pipeline.

Frequently asked questions

Can I just use Google Analytics for a research study?
Usually not as the primary data source. Web analytics tools aggregate data and use their own identifiers, so you cannot reliably tie an event to a pseudonymous participant and condition. They also send data to a third party, which complicates district data use agreements. Use your own event log for the study.

How much of a Phase II software budget should go to logging and data?
As a general range, plan on 40–80 engineering hours to build logging and exports into a working prototype, and more if the study compares AI models or runs offline. It is a small share of a Phase II software budget but one of the most consequential. List it as its own milestone so the program officer can see it.

Should I log full language model prompts and responses?
If the study compares prompting strategies or models, yes, along with model version, template ID, latency and token counts. Without them you cannot explain differences between conditions. Check with your IRB, since student inputs can contain identifying information, and plan redaction or restricted access accordingly.

Where should study data be stored to satisfy FERPA?
FERPA and your data use agreements set the terms, and your institution’s counsel decides what satisfies them. Common engineering patterns include pseudonymous IDs in the event log, a separately secured linkage table, encryption, access logs and scheduled deletion. Document these choices in the technical disclosure for district IT review.

Can a graduate student build the logging instead of hiring a team?
Yes, if they have time to design the schema with the analyst, handle offline retries and deduplication, and support the pilot when something breaks mid-semester. The risk is not writing the code but maintaining it during the study. Bring in a team when the pilot spans multiple sites or the student’s own deadlines compete with uptime.

Related answers

Planning a pilot and want the data to hold up?

We offer a free 30-minute review of your pilot plan or the technical section of your proposal. Bring the prototype’s repository or a demo, your pilot timeline, your analysis plan and the funder’s requirements. Start a conversation.