1856
Views
4
Comments
How to get the current screen name
Question

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?

2018-08-26 20-34-32
Pankaj pant

Hi Vincent,

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


Regards,

Pankaj

2020-09-21 08-42-47
Vincent Koning

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?

2022-07-12 16-41-57
Pedro Costa

Hi Vincent,


Try use this JS:

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


Thanks !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.