Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding Visit tag(UserID) to for every session for android app with auto instrumentation


I want add user Id as visit tag so that I can identify every visit with userId, I know we can do this by manual instrumentation but I am not sure every visit will have manual logs. so I am wondering is there a possibility to tag manually or by auto instrumentation for a android app.


Dynatrace Pro
Dynatrace Pro

Hi Shashank,

You can use auto-instrumentation and tag the visit manually by generating a mobile action containing the user id (similar to manual instrumentation).

When you want to use the Dynatrace Gradle plugin (for auto-instrumentation), then you have to perform the following steps:

  1. Include and configure the Dynatrace Gradle plugin for your project
  2. Add the mobile agent library as dependency to the project (see step "Combine with manual instrumentation" in the documentation)
  3. Press the Gradle Sync button in Android Studio (now the agent SDK should be available)
  4. Tag the visit manually (create an action and use the Dynatrace.reportValue call)
  5. Create a measure (category "Business Transaction Evaluation/Filter/Grouping Values") and configure the "Visit Tag" section for your mobile application in the "User Experience" settings.

Hi Thomas,

The problem doing it manually on android mobile application is, in a given visit session if there didn't has any manual log then that visit will be without tag and there is no way i know of to track dynatrace visit session.

Please clarify what you mean with "didn't has any manual log" - do you mean when a user is already logged in and does not perform a login? In that case you can create the same action you are using for tagging the visit on login when you check if a user is already logged in.