/bubble-integrations

Bubble.io and Google Fit integration: Step-by-Step Guide 2024

Explore our step-by-step guide to effortlessly integrate Bubble.io with Google Fit and optimize your fitness tracking capabilities.

What is Google Fit?

Google Fit is a health-tracking platform developed by Google for Android, Wear OS and Apple Inc.'s iOS. It uses sensors in a user's activity tracker or mobile device to record physical fitness activities (such as walk or run), which are measured against the user's fitness goals to provide a comprehensive view of their fitness. Capabilities of Google Fit include step tracking, nutrition information, heart rate monitoring, and exercise tracking.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a free No-Code consultation

How to integrate Bubble.io with Google Fit?

Integrating Bubble.io with Google Fit will require configuring Google API settings and setting up relevant workflows in Bubble. Here's a step-by-step guide for doing this:

Step 1: Enable Google Fitness API for your application

The very first step is to enable the Google Fitness API for your Google Cloud project. If you do not have a Google Cloud project, you need to create one. Follow the below steps in order to do so:

  • Visit the Google Developers Console by clicking on this link
  • Log in to your google account or create a new one.
  • Click on the Select a Project dropdown and select the Project for which you want to enable the Google Fitness API.
  • Click on Open in case the project is already created or if not then click on New Project.
  • Fill in the Project Name and Location and click on `Create to create a new project.
  • After selecting the project, click on the hamburger menu on the top left corner, go to APIs & Services and select Library.
  • Type Fitness in the search bar and then select the Fitness API from the dropdown.
  • Click on Enable to enable the Fitness API for your selected project.

Step 2: Creating OAuth 2.0 Client IDs

An OAuth 2.0 Client ID is required to authenticate requests associated with your project for usage and billing purposes.

  • Navigate back to the Dashboard by clicking the hamburger menu on the top-left corner and then clicking on Dashboard.
  • Click on the OAuth consent screen tab.
  • Complete the form by providing application information such as your application's name, logo, and support email.
  • Click on Save and Continue.
  • Go through the Scopes and Test Users tab and finally click on Back to Dashboard.
  • Now. Click on Credentials on the left sidebar.
  • Click on Create Credentials at the top and select OAuth client ID.
  • In the Application type field, select Web application.
  • Enter a name for the client ID, for example, Bubble OAuth Client.
  • In the Authorized redirect URIs field, you will need to enter your Bubble app’s URL, with /version-test/api/1.1/oauth_redirect on the end. For instance, if your Bubble app’s URL is https://fitapp.bubbleapps.io, you should enter https://fitapp.bubbleapps.io/version-test/api/1.1/oauth_redirect. If your app is on a custom domain, simply replace fitapp.bubbleapps.io with your custom domain.
  • Click Create. You will be provided with a client ID and a client secret. Make sure to copy these and store them in a secure location.

Step 3: Setting up Bubble

Now that you have created a Google Cloud project and have enabled the API for it, you will now need to configure the Bubble settings.

  • Navigate over to your application on Bubble.
  • From the Bubble Dashboard, navigate to the Plugins tab and install the API Connector plugin if you have not done so already.
  • Click on API Connector and ADD another API
  • Fill in the details of the API with a name of your choice e.g. Google Fit
  • Click on Authentication dropdown and select oAuth2 User-Agent Flow
  • Fill in the details as follows. Replace the client_id and client_secret placeholders with the Client ID and Client Secret from your Google Cloud project.
    • Authorize: https://accounts.google.com/o/oauth2/v2/auth?client_id={{client_id}}&response_type=code&scope=https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.body.read&include_granted_scopes=true&state=state_parameter_passthrough_value&redirect_uri=https://yourdomain.com/api/1.1/oauth_redirect
    • Token: https://oauth2.googleapis.com/token
    • UserIdKey: id
    • Client_id: Your client_id
    • Client_secret: Your client_secret
  • Save these settings.

Step 4: Setting up workflows to authorize access

Now that we have set up both Google and Bubble, all we need to do now is create a workflow in Bubble to authorize users for accessing their Google Fitness data.

  • Navigate back to Bubble’s design tab and then go to the page where you want the login to appear.
  • Add a button to the page for authorizing Google Fitness.
  • Go to the Workflow tab, click + to add a new workflow, select the button that you added in the previous step, and click Start/Edit workflow.
  • Add an API Connector action, and select Signup/Login with a social network.
  • From the Provider dropdown, select the Google Fit API you created.
  • Test the workflow by previewing your app and clicking on the button.

That is it! You have successfully integrated Bubble with Google Fit. Users will be asked to authorize access to their Google Fit data upon clicking on the Authorize Google Fit button in your Bubble app.

Troubleshooting

If you encounter any issues during the setup, verify that you've accurately followed each step.

  • Make sure the API is properly enabled in the Google Console.
  • Double-check your OAuth 2.0 client ID and secret, including whether the redirect URLs in the Google Console and Bubble match.
  • Verify that the scopes requested during the OAuth flow match the ones enabled in the Google Console.
  • Ensure that you’ve installed and correctly set up the API Connector plugin on Bubble.
  • Lastly, refer to the Google Fit and Bubble documentation if you need more help understanding specific fields or settings.

Bubble.io and Google Fit integration usecase

Scenario: A health and wellness startup is using Bubble.io to build a health tracker app for their clients. The app lets users record their exercise routines, diet, and sleep patterns to help them make healthier lifestyle choices. To make the app more interactive and accurate, the startup wants to integrate it with Google Fit. This integration will allow users to automatically sync their physical activities data from Google Fit to the app, ensuring a holistic view of their health.

Solution: Integrating Bubble.io with Google Fit

Build The Application: The startup uses Bubble.io to design and build a user-friendly health tracker app where users can enter their daily physical activities, meals, and sleep patterns.

Setting Up the Integration: The startup installs the Google Fit plugin in Bubble.io and configures it with their Google Fit API key. They then set up workflows in Bubble.io that trigger when new data related to physical activities is recorded in Google Fit.

Data Sync Workflow: Whenever a user records an activity in Google Fit, the workflow is triggered. The data (e.g., exercise duration, steps, calories burnt) is sent to the Bubble.io app using the configured Google Fit plugin action. This creates a new activity record in the app and is reflected in the user's overall health stats.

Analysis And Recommendations: The in-app algorithm analyzes the user's activities, diet, and sleep data collectively, allowing it to provide a more comprehensive understanding of the user's health. It then offers tailor-made health recommendations and workout plans.

Monitoring and Analytics: The integration allows for seamless tracking of physical activity data from Google Fit. The startup can monitor user engagement and analyze health patterns, driving data-based decisions to improve their app and health plans.

Benefits:

Accuracy: Integrating Google Fit ensures accurate tracking of user physical activities, reducing the reliance on manual entry.

Engagement: Automatic syncing of activities helps keep users engaged and the recorded data encourages consistent usage of the app.

Personalized Recommendations: The integration enables the app to provide recommendations based on comprehensive and accurate health data, enhancing the user experience.

Data Insights: The startup can analyze user engagement and health patterns, gaining insights to improve their health offerings.

By integrating Bubble.io with Google Fit, the health and wellness startup can create an interactive, comprehensive, and accurate health tracker app, ensuring personalized recommendations and improved user engagement.

Explore More Valuable No-Code Resources

No-Code Tools Reviews

Delve into comprehensive reviews of top no-code tools to find the perfect platform for your development needs. Explore expert insights, user feedback, and detailed comparisons to make informed decisions and accelerate your no-code project development.

Explore

WeWeb Tutorials

Discover our comprehensive WeWeb tutorial directory tailored for all skill levels. Unlock the potential of no-code development with our detailed guides, walkthroughs, and practical tips designed to elevate your WeWeb projects.

Explore

No-Code Tools Comparison

Discover the best no-code tools for your projects with our detailed comparisons and side-by-side reviews. Evaluate features, usability, and performance across leading platforms to choose the tool that fits your development needs and enhances your productivity.

Explore
Want to Enhance Your Business with Bubble?

Then all you have to do is schedule your free consultation. During our first discussion, we’ll sketch out a high-level plan, provide you with a timeline, and give you an estimate.

Book a free consultation

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences