Use Toggl to track daily goal achievements

Published: 29 Oct 2018. Estimated read time about 3 minutes.
šŸ‘Øā€šŸ’» This post was written by a human.
Categories: [toggl] [productivity]
Use Toggl to track daily goal achievements

Daily goals have got to be one of the most powerful ways to consistently achieve meaningful change and improvement upon yourself. For some people, all they need is a notebook and maybe some colourful sharpies and they are happy to track their progress every day. Iā€™m more of a no extra effort required type of guy, thankfully Toggl allows me to do just that.

A while ago I wrote a brief guide to Sync Fitbit workouts to Toggl and this is very much in the same vein. Since I track all my personal productive time and my daily goals usually tend to fall within one of those already time tracked Toggl projects I had an idea. What if I set up yet another webtask.io function to go do some magic for me. Data meet result. I wonā€™t need to force myself to manually go tick a box in some notebook after all.

Weekly goals image

Now for a fair waring. The idea here is to have the webtask call the Toggl API daily and based on tracked timers set a flag on another API which I have that runs my browser ā€œstartpageā€ aka personal dashboard. The startpage API is closed source (for now), but Iā€™m sure if you are even remotely interested in doing something similar you will be able to figure out some other service to point this webtask to. Perhaps something like getting the webtask to send you an email or call your mom with a prerecorded voice message telling her you donā€™t care for goals.

Now for the good stuff.

Track daily achievements with Toggl

All you need to get going is:

Go ahead to webtask.io/make and paste the code into a new webtask function.

Webtask image

First, we need to add the following secrets from Toggl (your Toggl API key and the ID of the project you want to use to measure your daily goal against).

The required secrets

Then we need to make sure to add the following NPM Modules for the function to work right.

The NPM Modules you will need

moment@2.4.0
request@2.88.0
toggl-api@1.0.1

You could probably use different versions if you really wanted to.

Time for some sparks, give it a try by pressing the play button for the Runner and then the Run button. It might be a good idea to check the console for errors as you start changing the ā€œsample goal tracking server requestā€ to do something specific to your use case. Tweet me with what you made it do on @jacob_pretorius as I would love to see what you come up with.

With that all done itā€™s probably a good idea to have the webtask run on a schedule, I prefer having mine run at four am each morning as I like to give myself until at least midnight to reach the goal and I wonā€™t need the data any earlier than four (and that also gives some general time zone mismatch weirdness buffer). Remember it only looks at tracked timers for the previous day.

Scheduler setup

If you found this somewhat useful Github stars are appreciated.

Thanks for stopping by.

Recommended Posts

Back to top ā‡ˆ