  There is a growing interest in leveraging the prevalence of mobile technology
to improve health by delivering momentary, contextualized interventions to
individuals' smartphones. A just-in-time adaptive intervention (JITAI) adjusts
to an individual's changing state and/or context to provide the right
treatment, at the right time, in the right place. Micro-randomized trials
(MRTs) allow for the collection of data which aid in the construction of an
optimized JITAI by sequentially randomizing participants to different treatment
options at each of many decision points throughout the study. Often, this data
is collected passively using a mobile phone. To assess the causal effect of
treatment on a near-term outcome, care must be taken when designing the data
collection system to ensure it is of appropriately high quality. Here, we make
several recommendations for collecting and managing data from an MRT. We
provide advice on selecting which features to collect and when, choosing
between "agents" to implement randomization, identifying sources of missing
data, and overcoming other novel challenges. The recommendations are informed
by our experience with HeartSteps, an MRT designed to test the effects of an
intervention aimed at increasing physical activity in sedentary adults. We also
provide a checklist which can be used in designing a data collection system so
that scientists can focus more on their questions of interest, and less on
cleaning data.
