Third option: Creating your counter in a central place where every page call passes along. I am not certain if the requesthandler is the correct place, but it might work. Check out the answer to this question https://forum.mendix.com/link/questions/5384.
Or maybe more to the point: https://www.mendix.com/blog/requesthandlers-at-your-service/ Old, but still valid.
Connect to mx.ui.getContentForm’s onNavigation and populate a context object attribute mx.ui.getContentForm().path and pass that into a microflow for server processing. You dont need it on every page, just have it load in once