Location tracking for history not live

I am trying to replace Google location history with a self hosted feature. I have read about using owntracks and owntracks recorder, or Orion to put something together.
But I read somewhere (don’t remember where) that home assistant mobile actually records the location automatically…
I then thought rather than having two apps to worry about tracking the data I could just use HA and capture the data somehow.
I don’t currently have my HAos open to the internet, and I was hoping that I could just record my location locally on my phone (in a Json) and then automatically sync it with my homelab when. I return.
Is this possible? Does anyone know of any issues or better way to achieve? I don’t need (and really don’t want) live tracking of my phone. But I would like a record (a history) of where it has been.
Any advice appreciated.

Thanks

youd have to build your own solution to do but if you really want i thnk google maps already does this for you lol