Enabling Google Fit

by Scott Dilley - CTO 18 Jan 2022

This article will guide you through enabling Google Fit on your platform. Enabling this requires a Google Cloud Account and also a verification process via Google which may or may not incur fees.

What is it?

Google Fit allows fundraisers to record and track fitness activity from their Android or iPhone; it is able to access the data from 3rd-party apps installed on a phone (e.g., Strava), as well as access the data that your phone captures on its own (e.g., Apple Health and Google Health). 

Who is it most useful for?

Adding Google Fit to your website then allows fundraisers to have this data sent directly to their fundraising pages where we can display things like Daily Steps, Distances, and Fitness Duration. 

What are the benefits?

The benefit being that Google Fit can access fitness activity data from many different data sources such as Fitbit, Strava, etc. 

Key terms:

Fundraisers: members or participants that signed up to the event and have fundraising pages

Fitness activity: activity that can be tracked through fitness apps and can be measured by either the number of steps, distances by km or miles, or duration

Fitness API: an application programming interface that is used to integrate applications with fitness data and fitness tools

Fitbit: a fitness app that can be connected to the Funraisin platform once enabled

Strava: a fitness app that can be connected to the Funraisin platform once enabled

Google Fit is another fitness integration that can be added to a platform. If connected, entrants can connect to Google Fit to pull through their recorded activity.

Google Fit is not commonly used as it can incur fees from Google.

Follow these steps to request an OAuth 2.0 client ID for the Fitness API.

  1. Go to the Google API Console.
  2. Select a project, or create a new one.
  3. Click Continue to enable the Fitness API.
  4. Click Go to credentials.
  5. Click New credentials, then select OAuth Client ID.
  6. Under Application type, select Web application.
  7. Under Authorized JavaScript origins, enter the base URL of your site (e.g. https://www.funraisin.co).
  8. Under Authorized redirect URI, enter the URL of your site followed by /login/googlefit (e.g. https://www.funraisin.co/login/googlefit).
  9. Click Create. Your new OAuth 2.0 Client ID and secret appear in the list of IDs for your project. An OAuth 2.0 Client ID is a string of characters, something like this:

    780816631155-gbvyo1o7r2pn95qc4ei9d61io4uh48hl.apps.googleusercontent.com

Once you have your Client ID and Secret, jump into Funraisin > Platform Setup > General Setup > Apps Settings and enter these under the Google Fit section.

Click to expand

Testing

As Google Fit API access requires verification from Google, if you wish to test the integration whilst that is happening, you can add test users to your Google Console.

Click into OAuth Consent Screen in the Google Console whilst editing your project, and you will see a section called "Test Users"; simply add in the emails of those you wish to test the integration with, and you will be able to then connect your Google Fit account to your fundraising profile.

Applying for Verification

Google requires that any integration that accesses personal data should go through verification so they can check that everything is in order. The link below explains how to submit your integration for verification.

https://support.google.com/cloud/answer/9110914#sensitive-restricted-scopes&zippy=%2Csteps-for-apps-requesting-sensitive-scopes%2Csteps-to-submit-your-app

Keep in mind that this process can take up to a month to get approved. Additionally, if you are going to be providing Google Fit integration for more than 100 users, you will be required at some point to go through a Google Security Assessment which can occur annually and usually comes at a cost.

If you’d like further help, please pop in a support ticket from your Funraisin admin, and our team will assist you.