Giter Site home page Giter Site logo

google-sheets-strava's Introduction

Sheets of Strava

Overview

This is automation that gives you a button to export Strava activities to Google Sheets, specifically to a sheet titled raw_data. What you do with that afterwards is up to you.

I personally have the below set up:

  • Google Data Studio Dashboard @ cycling.agmsb.xyz
  • monthly_data roll-up sheet
  • yearly_data roll-up sheet
  • gear_data roll-up sheet
  • friends_data roll-up sheet

Setting up raw_data

Create a sheet titled raw_data and add the below columns starting with column A:

  • Date
  • Name
  • Duration
  • Distance
  • Elevation
  • Average Speed
  • Max Speed
  • Kilojoules
  • Average Heart Rate
  • Max Heart Rate
  • Gear ID
  • Athlete Count

In Tools > Script Editor, update code.js and create a new file:

  • oauth.js

Update oauth.js with your Strava client id and client secret.

Install the OAuth2 library for Google Apps Script, see setup here. In your first time running your code, run the function getRides in Code.js from Tools > Script Editor - it will fail and prompt you to authorize in browser with a provided URL.

Setting up monthly_data or yearly_data

Example: roll-up rides by month

// A2 being month formatted as YEAR-MO aka "XXXX-YY"
=COUNTIF(raw_data!A:A, "*"&A2&"*")

Example: roll-up mileage by month

// A2 being month formatted as YEAR-MO aka "XXXX-YY"
=SUMIF(raw_data!A:A, "*"&A2&"*", raw_data!D:D)

Setting up gear_data

It ain't pretty but Strava creates unique IDs for your gear.

Example: roll-up mileage by gear.

// change gear ID in 2nd arg
=SUMIF(raw_data!K:K, "b7595586", raw_data!D:D)

Setting up friends_data

In raw_data, I append 3 columns at the end of the sheet:

  • Friends
  • Lifetime Distance
  • Lifetime Elevation

In Friends, I manually insert the friends I rode as First Name + + Last Name, with each friend separated by comma.

Then in the sheet friends_data, you can roll-up by data by friend using the below examples:

Example: roll-up rides by friend

// A2 being Friend Name
=COUNTIF(raw_data!M:M, "*"&A2&"*")

Example: roll-up mileage by friend

// A2 being Friend Name
=SUMIF(raw_data!M:M, "*"&A2&"*", raw_data!D:D)

TODO

  • Add tutorial on setting up Google Data Studio

google-sheets-strava's People

Contributors

agmsb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

google-sheets-strava's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.