How to get the current screen name

I'm working on a Mobile app. In this app I need to add some tracking software so measure the usage of our Enterprise app and how people are using this app. 

To make sure that I register the correct data without any faults from us, the developers, I would like to get the name of the screen automatically. Does anyone know if it's possible to get the name of the screen currently viewed?

Hi Vincent,

I would suggest you use Google Analytics plugin in your use case.


Regards,

Pankaj

Google is not allowed at my company by the legal team. So we use other methods and/or providers instead where possible. For Google Analytics we use Matomo instead. 

But thank you for the suggestion. Do you also happen to know how to get the current screen name at runtime?

Hi Vincent,


Try use this JS:

document.location.href.match(/[^\/]+$/)[0]


Thanks !