Notion Habit Tracking

Notion Habit Tracking

Word Count
Last Edit
Mar 23, 2022 12:53 AM
Publish Date
Jun 1, 2021
Productivity In Notion
This is the 11th entry in a series on my Notion architecture for various life management systems. To see the full series, please visit the home page, 🏗️Productivity In Notion .
As anyone who knows me knows, I've been quite focused on habit tracking and goal setting. As I spent close to two years of my life building a platform to help people do just that, I am fairly well-versed in what makes a good way and not-so-good way to build habits.
Since that never really took off, I have moved a lot of my own tracking into Notion, obviously. And the ability to track habits was there, kind of, but it didn't really work well. Some people relied on a grid of checkboxes (with habits across the top and new days added as rows).
After experimenting with that, I opted for more of a tag-based approach as I outline here: 📆Daily Tracking in Notion. In short, I simply added tags for any habit I completed in a day, and used the total count of habits in a day or aggregated to the week or the month as a measure of my habit building.
But this too was not ideal for a number of reasons:
  • The list of habits was long, and even if a habit was done for the day, it still appeared. So there was not an easy way to see what other habits needed to be done.
  • The total habit count incentivized doing the "easy" habits and neglecting harder ones.
  • Relatedly, there was no good way to look habit by habit to see which ones I was slacking on.
And I could go on, but the point is not to discuss the failings of the past system... it's to discuss the brand new system!

Welcome to Habit Tracker MAX

Habit Tracker MAX is what happens when Notion releases their API and someone (me) really wants to build a habit tracker that has an app-like experience in Notion. And I've gotta say, I think I nailed it!
What the API enables in this case in particular is a way that a user can do two things that previously were very hard to combine:
  • have a very simple and clean checklist style experience: you check off your habits, and they disappear.
  • keep detailed data on that to provide useful insights about how you are doing on each habit and over time.
As a bonus, this system works well for handling any kind of recurring task or habit, so weekly, monthly, quarterly, and annual timings are accommodated as well.
So let's get into it! Here is the Habit Checklist tab that serves as the main and really the only interface for checking off habits. Indeed, after the initial setup of listing out your habits, you could only interact with this page. You check things off each day, and the script comes through overnight and resets it for you and you do it again the next day. That's habits!
notion image
So here we have it after having completed most of my other habits for the day. But this will reset and we'll see a longer list here tomorrow morning. This view also works quite well on mobile, as the weekly tasks move below the daily and checking off items is very phone friendly.
Now as a bit of a data nerd, I need data on my habits and how I'm doing. Scoff all you want, but human minds are quite deluding when it comes to one's own performance and the only way out of that trap is cold, hard data.
Thus we get to the Analyze tab. This will evolve over time, but has the basics. For each habit, we calculate the current streak, best streak, and average over the prior 7 and 30 days. This view sorts, so it is easy to see what is going well and what isn't.
Then on the right we have the weekly and monthly tracking. These aggregate and use a point value that is assigned to each habit based on my perception of it. So these will give good views of trends as well as a way to shoot for new highs each week or each month.
notion image
One wish I do have is that Notion had a few more options for conditional formatting of tables (e.g. shading) and obviously some graphing capabilities (line graphs, bar charts, etc). Some of this I may be able to bake in via computed fields or the API depending on how crazy we want to get. But it'd be nice to have some of these things natively.

Behind the Scenes

While this all feels simple and intuitive up front, there is much more interesting stuff going on behind the scenes. One bridge to that is the Habits table, which we do use for the checkboxes but is also where you'd go to add new habits or archive old ones!
That setup is actually quite simple: you just need to type in a habit, select a cadence, and optionally assign it a category, point value, link for where to go, etc. Any new habits here automatically become live, nothing else needed!
And last, but certainly not least, is the python script that runs every night leveraging the Notion API to record and process the data. In short, that script pulls in the data from Notion, does some calculations, resets the interface and records the stats, and that's it. It gets a bit messy with different schedules and things, but it is conceptually simple. Once the code is a bit cleaner, I will share on GitHub.
That script is now setup to run nightly on the cloud. I followed this great tutorial to set it up in what should be a free or very low cost, but highly reliable way, to run at 4am each night.

Last but not least...

Here is a video tour I made which has a couple of updates I've made since writing this. It should give you a sense of the ease of interaction. I talk through a bit of how it works as well to make it fully self-contained, but check it out!