Google Health is Google’s platform for health and fitness data. It replaces the legacy Fitbit Web API, so data from Fitbit and Pixel Watch devices now reaches Avicenna through Google Health. Google combines the data from all devices connected to a participant’s Google account into a single stream. Avicenna collects this data from Google’s servers, so participants don’t need to export or upload anything themselves.
[!important] Google Health Replaces Fitbit
The legacy Fitbit data sources can no longer be added to new studies. Data already collected through them stays available for export. To keep collecting data from Fitbit devices, add the Google Health data sources to your study, and ask your participants to grant access to Google Health. Participants must grant access again even if they had already granted access to Fitbit. See the Moving from Fitbit section below for details.
Supported Google Health Metrics in Avicenna
In this section, we list the Google Health metrics that Avicenna supports. Each metric is a separate data source, so you can add only the ones your study needs.
Most metrics include these two fields, which describe where the record came from:
- Platform: The platform that recorded the data, as reported by Google. For example,
FITBITfor data from a Fitbit device, orHEALTH_CONNECTfor data that reached Google Health through Android Health Connect. Internally stored asplatform. - Recording Method: How the data was recorded. For example,
PASSIVELY_MEASUREDfor data measured automatically by a device,MANUALfor data the participant entered by hand, orDERIVEDfor data Google calculated from other measurements. Internally stored asrecording_method.
Google Health Heart Rate
Provides the participant’s heart rate measurements. It is stored internally as google_health_heart_rate and includes the following fields:
- Record Time: The time the heart rate was measured. Internally stored as
record_time. - Heart Rate: The heart rate, in beats per minute (BPM). Internally stored as
heart_rate. - Platform and Recording Method: See above.
Google Health Steps
Provides the number of steps the participant took. Google reports steps in short intervals (usually one minute). Each record covers one interval. It is stored internally as google_health_steps and includes the following fields:
- Record Time: The start time of the interval. Internally stored as
record_time. - Steps: The number of steps taken during the interval. Internally stored as
steps. - Platform and Recording Method: See above.
Google Health Distance
Provides the distance the participant traveled. Each record covers one interval. It is stored internally as google_health_distance and includes the following fields:
- Record Time: The start time of the interval. Internally stored as
record_time. - Distance: The distance traveled during the interval, in meters. Internally stored as
distance. - Platform and Recording Method: See above.
Google Health Floors
Provides the number of floors the participant climbed, as one total per day. It is stored internally as google_health_floors and includes the following fields:
- Record Time: The day the total belongs to, recorded as midnight UTC of that day. The day itself is the participant’s local calendar day. For example, floors climbed on March 5 in the participant’s own time zone are recorded as
March 5, 00:00 UTC. Internally stored asrecord_time. - Floors: The number of floors climbed during the day. Internally stored as
floors.
[!note]
Google provides floors only as a daily total, with no information about the recording device. So this data source has no Platform or Recording Method fields. Days with no floors climbed have no record.
Google Health Activity Level
Shows how active the participant was over time. Google classifies each short interval (usually one minute) into one activity level. It is stored internally as google_health_activity_level and includes the following fields:
- Record Time: The start time of the interval. Internally stored as
record_time. - Activity Level: The activity level for the interval. Internally stored as
activity_level. Possible values:SEDENTARYLIGHTLY_ACTIVEFAIRLY_ACTIVEVERY_ACTIVE
- Duration: The length of the interval, in seconds. Internally stored as
duration_sec. - Platform and Recording Method: See above.
[!tip]
To get the total time spent at each activity level in a day (similar to the Sedentary Duration, Lightly Active Duration, and other fields of the legacy Fitbit data sources), add up the Duration of all records with the same activity level in that day.
Google Health Active Zone Minutes
Provides the minutes the participant spent in elevated heart rate zones. It is stored internally as google_health_active_zone_minutes and includes the following fields:
- Record Time: The start time of the interval. Internally stored as
record_time. - Zone: The heart rate zone. Internally stored as
zone. Possible values:FAT_BURNCARDIOPEAK
- Minutes: The active zone minutes earned in this zone during the interval. Internally stored as
minutes. - Platform and Recording Method: See above.
[!note]
One interval can have up to three records, one per zone.
Google Health Sleep
Provides a summary of each sleep session. It is stored internally as google_health_sleep and includes the following fields:
- Record Time: The start time of the sleep session. Internally stored as
record_time. - Start Time: The start time of the sleep session. Internally stored as
start_time. - End Time: The end time of the sleep session. Internally stored as
end_time. - Log Type: The type of sleep data Google has for this session. Internally stored as
log_type. Possible values:STAGES: The session has sleep stages (light, deep, REM).CLASSIC: The session has only asleep, awake, and restless periods. This is common for short sessions, or when the device could not measure stages.
- Duration: The total length of the session, in seconds. Internally stored as
duration_sec. - Efficiency: The percentage of time in bed that the participant was asleep, from 0 to 100. Internally stored as
efficiency. - Main Sleep:
truefor a main sleep session, andfalsefor a nap. Internally stored asis_main_sleep. - After Wake Duration: The minutes the participant stayed in bed after waking up. Internally stored as
minutes_after_wakeup. - Asleep Duration: The total minutes the participant was asleep. Internally stored as
minutes_asleep. - Awake Duration: The total minutes the participant was awake during the session. Internally stored as
minutes_awake. - To Fall Asleep Duration: The minutes it took the participant to fall asleep. Internally stored as
minutes_to_fall_sleep. - In-Bed Duration: The total minutes of the sleep period. Internally stored as
minutes_in_bed. - Platform and Recording Method: See above.
[!note] Sleep Efficiency
Google does not provide a sleep efficiency value. Avicenna calculates it as Asleep Duration divided by In-Bed Duration. Values can be different from the efficiency the legacy Fitbit data source reported.
Google Health Sleep Level
Provides the sleep stages within each sleep session. Each record is one stage. It is stored internally as google_health_sleep_level and includes the following fields:
- Record Time: The start time of the stage. Internally stored as
record_time. - Level: The sleep stage. Internally stored as
level. Possible values:- For
STAGESsessions:AWAKE,LIGHT,DEEP,REM. - For
CLASSICsessions:ASLEEP,AWAKE,RESTLESS.
- For
- Duration: The length of the stage, in seconds. Internally stored as
duration_sec. - Platform and Recording Method: See above.
Google Health Weight
Provides the participant’s weight measurements, from a connected smart scale or entered manually. It is stored internally as google_health_weight and includes the following fields:
- Record Time: The time the weight was measured. Internally stored as
record_time. - Weight: The weight, in kilograms. Internally stored as
weight. - Platform and Recording Method: See above. Use Recording Method to tell scale readings from manual entries.
Google Health Body Fat
Provides the participant’s body fat measurements, from a connected smart scale or entered manually. It is stored internally as google_health_body_fat and includes the following fields:
- Record Time: The time the body fat was measured. Internally stored as
record_time. - Body Fat: The body fat percentage, from 0 to 100. Internally stored as
body_fat. - Platform and Recording Method: See above.
Google Health Nutrition Log
Provides the foods the participant logged. Each record is one logged food item. It is stored internally as google_health_nutrition_log and includes the following fields:
- Record Time: The time the food was logged for. Internally stored as
record_time. - Meal Type: The meal the food belongs to, for example breakfast or lunch. Internally stored as
meal_type. - Food ID: The unique ID of this food log entry. Internally stored as
food_id. - Food Name: The name of the food, as shown to the participant. Internally stored as
food_display_name. - Serving Amount: The number of servings eaten. Internally stored as
serving_amount. - Serving Unit ID: The ID of the serving unit, for example a cup or a slice. Internally stored as
serving_unit_id. - Energy: The energy of the food, in kilocalories (kcal). Internally stored as
energy_kcal. - Energy From Fat: The energy that comes from fat, in kcal. Internally stored as
energy_from_fat_kcal. - Carbohydrate: The total carbohydrate, in grams. Internally stored as
carbohydrate_grams. - Fat: The total fat, in grams. Internally stored as
fat_grams. - Platform and Recording Method: See above.
Fields that the participant did not provide (for example, the fat content of a custom food) are empty.
Google Health Hydration Log
Provides the water intake the participant logged. Each record is one log entry. It is stored internally as google_health_hydration_log and includes the following fields:
- Record Time: The time the water intake was logged for. Internally stored as
record_time. - Entry ID: The unique ID of this log entry. Two entries can have the same Record Time, so use this field to tell them apart. Internally stored as
entry_id. - Amount: The amount of water consumed, in milliliters. Internally stored as
amount_ml. - Platform and Recording Method: See above.
[!info] What Is Not Collected
Avicenna currently does not collect these Google Health data types:
- Active energy burned and total calories burned.
- Micronutrients (vitamins, minerals, and similar) in nutrition logs. Only the fields listed above are stored.
- Location, electrocardiogram (ECG), and irregular rhythm notifications.
- Oxygen saturation (SpO2), respiratory rate, skin temperature, heart rate variability, and cardio fitness.
Data Collection Behavior
The participant’s device syncs its data to the participant’s Google account, usually through the Fitbit app on their phone. When new data arrives, Google notifies Avicenna, and Avicenna then downloads the new data from Google’s servers. Nothing is collected directly from the device by the Avicenna app. This means:
- Data appears in Avicenna only after the device has synced with Google. If the participant does not open the Fitbit app or their phone is offline, the data arrives later, in a batch. Once Google has the data, it usually appears in Avicenna within a few minutes.
- Avicenna only stores records whose time is within the participant’s participation period in a study that includes the data source. Records from before the participant joined, or after their participation period ended, are not stored.
- Avicenna does not import historical data when a participant grants access. Collection starts from the moment of the grant.
- If a participant is enrolled in more than one study that collects the same Google Health data source, each study receives its own copy of the records.
- If Google is temporarily unavailable or limits the number of requests, Avicenna retries later. In this case, data can take several hours to appear.
- If the participant edits a record in the Fitbit app, the new version is collected. If the participant deletes a record in the Fitbit app, it is not removed from Avicenna.
All times are stored in UTC.
Adding Google Health As a Data Source
See Adding Data Sources. In the list of available data sources, choose the Google Health metrics you need. Their names start with Google Health.
When a participant grants access, Google asks them to allow access to groups of data, not to each metric. The groups needed depend on the data sources in your study:
| Google permission | Needed for |
|---|---|
| Activity and Fitness | Steps, Distance, Floors, Activity Level, Active Zone Minutes |
| Health Metrics and Measurements | Weight, Body Fat |
| Both of the above | Heart Rate |
| Sleep | Sleep, Sleep Level |
| Nutrition | Nutrition Log, Hydration Log |
If you add a new Google Health data source after participants have joined, and it needs a permission they have not granted yet, those participants need to grant access again.
Monitoring and Exporting Google Health Data
You can export and download the collected Google Health data using the Data Export page. Exports are produced in CSV format.
[!note]
Google Health data is available through data export only. It is not indexed in Kibana and has no dashboard visualization.
Google Health Data Source in Participant App
After joining a study, participants must grant Avicenna access to their Google Health data. Before they start, they need a Google account with a Fitbit profile, with their device connected to it. Participants who still sign in to the Fitbit app with an old Fitbit account must first move it to a Google account in the Fitbit app.
-
Open the Avicenna app and navigate to Settings > My Studies.
-
Select the study that collects Google Health data.
-
Tap on Data Sources. This page lists every data source the study collects.
(Screenshot: the Data Sources page)
-
Find the Google Health data source and tap the Grant Access button next to it. The app first shows which data Avicenna will collect and that the data is shared with the research team.
(Screenshot: the disclosure dialog)
-
A Google sign-in page opens in the phone’s browser. The participant signs in with the Google account their device is connected to.
-
Google shows the groups of data Avicenna asks for. The participant should allow all of them. If they leave out a group your study needs, the data source still shows as not granted, and the participant needs to grant access again.
(Screenshot: the Google consent page)
-
After the participant allows access, they return to the Avicenna app, and the Google Health data sources show as granted. Collection begins from that point onward.
One grant covers all the Google Health data sources of all the participant’s studies, and all the devices connected to their Google account.
[!note]
If the participant’s Google account has no Fitbit profile, the grant fails and the participant returns to the app without access. They need to sign up at fitbit.google.com with the same Google account, connect their device, and then grant access again.
Participants can stop sharing data at any time by returning to the Data Sources page for the study and tapping Revoke Access on the Google Health data source. Revoking removes Avicenna’s access to the participant’s Google Health data, for all their studies. Data collected before revocation is retained. Participants can also remove Avicenna’s access from their Google account settings.
Moving from Fitbit
Google is shutting down the legacy Fitbit Web API. Existing studies that collect the legacy Fitbit data sources should move to Google Health:
- Add the matching Google Health data sources to your study. The table below shows which Google Health data source replaces each Fitbit data source.
- Ask your participants to grant access to Google Health, as described in the Google Health Data Source in Participant App section above. When a participant grants access with the Google account that holds their Fitbit profile, Avicenna automatically stops collecting from their old Fitbit connection, so the same data is not collected twice.
| Legacy Fitbit data source | Google Health data source(s) |
|---|---|
| Fitbit Heart Rate | Google Health Heart Rate |
| Fitbit Sleep | Google Health Sleep |
| Fitbit Sleep Level | Google Health Sleep Level |
| Fitbit Activity, Fitbit Activity Summary | Google Health Steps, Distance, Floors, Activity Level |
| Fitbit Active Zone | Google Health Active Zone Minutes |
| Fitbit Weight Log | Google Health Weight, Google Health Body Fat |
| Fitbit Food Summary | Google Health Nutrition Log |
[!warning] The Data Is Not Identical
The Google Health data sources are new data sources with their own tables. Plan for these differences when you combine Fitbit and Google Health data in your analysis:
- Activity: Fitbit provided steps, distance, floors, calories, and activity durations together, per minute and per day. Google Health provides each metric as a separate data source. Floors are available as daily totals only, and calories are not collected.
- Weight: Google Health Weight is always in kilograms. Body fat is a separate data source.
- Sleep: Log Type has different values (
STAGES/CLASSICinstead ofauto_detected/manual), sleep stage names are different, and Efficiency is calculated by Avicenna.