How to log transition from one NavController push/pop to other?

Version : 2.1.0

I am building an app which has heavy usage of Nav and tab controls. I want to track user behavior on my app.

Ex: User navigated Page A to Page B
User navigated Page B to Tab C

Initially, I thought of function wrapping each NavController’s push/pop method but that doesn’t seems to be a good idea.

Anyone has any other thoughts of solving this problem?