top of page
B4A550D5-BB73-4C7C-8687-570F9EE35A1B-205
Google Fit Log Steps

The following steps can be a bit tricky so a video has been provided at the bottom of the page to demonstrate setting up this method. If you are unsure of the steps or when finished setting up get get an error message send me an email or message me through instagram.com/quinn.higgs and ill help you set it up

This method uses adapted code created by Robert Ellison all credit goes to him and his work and I thank him for making this publicly available.

The following steps need to be completed on a laptop/computer

​

  1. Open your "steps_rawdata" spreadsheet (This can be found in My drive -> Nutrition tracking -> rawdata)

  2. Enter the text Date in cell A1, Steps in B1 and Weight in C1

  3. Next select the "Tools" menu and then click 'Script editor...' which will open a new apps script project.

  4. Click on the "Resources" menu and then select "Libraries..."

  5. Give the apps script project a name (logsteps) and then press "Ok"

  6. In the add a library box paste in the following text; 1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF

  7. Click "Add, Select the "Version" list and choose the most recent version (largest number)

  8. Click "Save"

  9. Then select "File" menu click on "Project properties"

  10. Copy the Script ID (a long series of letters and numbers) and paste it in a notes/word/text to use later 

  11. In a new tab go to https://console.cloud.google.com/apis/dashboard

  12. Click the "Select a project" button in the blue bar and then click "New project"

  13. Name it "logsteps"

  14. Back on the Dashboard click "Enable APIs and Services" and find and search and select the "Fitness API"

  15. Click the blue "Enable" button

  16. You will be prompted to configure consent screen, press this button.

  17. Click "External" and then create

  18. Under "Application name" enter "logsteps"

  19. Scroll down to the bottom and press save

  20. Click on "Credentials" on the left hand side (key symbol)

  21. Click on "Create credentials" and then "OAuth client ID"

  22. Click "Web application" and scroll down to "Authorized redirect URIs"

  23. In this box paste the following text; https://script.google.com/macros/d/{SCRIPTID}/usercallback 

  24. Remove {SCRIPTID} and replace it with the Script ID you saved from a previous step

  25. Click the Create button and copy the "Client ID" and "Secret ID" given to you and paste it in a word/notes/pages ocument to use later.

  26. Go to https://docs.google.com/document/d/1LSLRgfiZZvUYG7xo0nSmIXjaVMCAixYbKnrHK_EMCWE/edit?usp=sharing

  27. Select all the text in this document and copy it to your clipboard

  28. Go back to your "logsteps" Google apps script tab on your browser (See image) ->

  29. Delete all the current text in the "Code.gs" box and paste the copied text.

  30. On the line with the text "var ClientID" paste the Client ID you saved during step 25 in between the apostrophes

  31. On the line with the text "var ClientSecret" paste the Secret ID you saved during step 25 in between the apostrophes

  32. Save your project by clicking the save icon or going to File -> Save

  33. Go back to your "steps_rawdata" google sheet and reload the tab

  34. After reloading there will be a Google Fit menu item in the top row. Click on this and select "Authorise"

  35. Click "Continue" when prompted

  36. When the "This app isn't verified" screen opens, select "Advanced" and then click "Go to logsteps" (The code being used for this does not allow access to anyone accept yourself and all data stays in your ownership)

  37. Click "Allow"

  38. You will be redirected back to your "steps_rawdata" sheet. Click on the blue underlined "Authorize" text and follow the steps.

  39. When completed you should see the text "Success! You can close this tab."

  40. Go back to your "steps_rawdata" spreadsheet

  41. To manually pull data from your Google Fit account Select Google fit -> Get metrics for yesterday.

​

If you are currently using Google Fit to track your steps you should see yesterdays date and step count pop up after pressing this button. If you receive an error message contact me (contact form at the bottom of the Home page or message me through instagram.com/quinn.higgs) and I will help fix the issue

​

The following steps are to set up the automatic daily retrieval of your step count

  1. Go to your "steps_rawdata"

  2. Click on the "Tools" tab and then select "Script editor"

  3. You will be redirected to your logsteps script. Click the "Edit" tab and then select "Current project's triggers"

  4. Click the blue "Add trigger" button in the bottom right corner

  5. Under "Choose which function to run" select "getMetrics"

  6. Under "Select event source" choose "Time driven"

  7. Under "Select type of time based trigger" choose "Day timer"

  8. Under "Select time of day" choose "5am to 6am" 

  9. Click "Save"

  10. Go back to your "steps_rawdata" google sheet

  11. Click "Share" -> "Get shareable link"

  12. Copy the URL of steps_rawdata

  13. Open your "Nutrition Tracking" sheet and select the "Settings" tab

  14. Paste URL in adjacent cell to steps_rawdata

​

​

To get started, Install Google Fit from Google Play if it’s not already installed.. Then launch the “Fit” app on your Android phone.

You’ll have to set up Google Fit, including giving it access to the sensors it needs to monitor your step count. Google  Fit is also compatible with lots of other apps and fitness watches.

​

At this point you're all set. Every day the spreadsheet will automatically update with your step count from the day before and show it on your "Nutrition Tracking" spreadsheet. 

​

​

Capture.PNG
bottom of page