Engagement Tracker

Ghost-CLI version: 1.26.1
Local Install with defaults
Node v20.16.0, SQLite version 3.43.2, MacOS 14.6.1

Hello, I am new to front end dev work, and I am trying to create a member facing ‘level’ bar based on their engagement with reading blogs, and taking quizzes based on those blogs. I am having a tough time figuring out where to start on this. Could anyone give me some information on adding features like this to a ghost website? Or even just point me to documentation that might help?

Thanks!

A couple thoughts:

  • Easiest (but sorta flawed) way: run some javascript that uses a cookie or LocalStorage to save the user’s progress. Flaw: Won’t follow the user from device to device, lost on clearing cookies. Benefit: Easy to implement, could even be all code-injection, host anywhere you like.

  • Harder: Use an external database (I like Supabase - good free tier). Use some javascript running in the browser to update it as your users progress and retrieve values. (Use the user’s uuid or email to link their data across platforms.) Easier: let anyone with the user’s id/uuid/email update that user’s status in supabase. Harder: use the user’s jwt to authenticate, by way of a cloud function. Host Ghost anywhere, needs external services.

  • Hardest: Patch the Ghost core to store this user data. Requires building your own copy of Ghost and self hosting, and you’ll have to merge code and update your build whenever Ghost releases a bug fix or new feature that you want.

1 Like

This seems like a really good way… thank you so much for the response. Where should I be adding my scripts in Ghost’s files though? Should I be editing my theme mainly or ghost itself for something like this?

Thanks again!

In the theme. Leave the core alone unless you really have to, because it’ll mean you must self host.

1 Like