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

Mobile User Tagging

I've inplemented the Mobile monitoring of an Android App with command line Auto instrumentation and the client wants to identify the user with the user tagging, however I've never done that before and I need some advice. So far I know that I have to use the OneAgent SDK for mobile and I read in the documentation that I can add it by adding it to the dependencies with the next instruction:

dependencies {
implementation 'com.dynatrace.agent:agent-android:<version>'

}

and that I can do the tag with the instruction:

Dynatrace.identifyUser(<usertag>);

However is it not clear for me how to do the tag could you help me please?

Also I have inplemented the mobile monitoring with manual Instrumentation (developer) for IOS can you also tell me how to do the user tagging for IOS please.

9 REPLIES 9

Thomas_Wirth1
Dynatrace Champion
Dynatrace Champion

You have to add the OneAgent library as dependency to your project (in the file build.gradle) with

dependencies {
implementation 'com.dynatrace.agent:agent-android:<version>'
}

, where version must be the equal to the version of the auto-instrumentor. The OneAgent library is now hosted on JCenter and MavenCentral, which allows you to easily upgrade the version. But in this case we recommend to use the Dynatrace Gradle plugin, because it automatically ensures that the version of the agent and auto-instrumentor are equal.

Yeah I already know that, what is not clear for me is how to apply the tag.


The tag is applied by using the API Dynatrace.identifyUser(<usertag>); where <usertag> is e.g. the users email address or a user id which you want to tag the session of a user.

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

@Patrick, where should the API be called/configured in the app in order to tag the session with the username?
Should the dev add that API call right after the login code, for example?
Only calling the API in one point of the APP will already tag the entire session successfully?

Different Patrick, but I can still help 😉

Calling identifyUser will tag the entire session. The earlier the tagging is done, the earlier the tag will be available for live session. Doing it after the login would be fine. But it also is no problem if you do it later on, as long as the point where you call the API is always executed for every user.

Dynatrace Certified Master, AppMon Certified Master - Dynatrace Partner - 360Performance.net

Great! Thank you, Patrick!

@Patrick H. Can you help me with this?

suresh230591
Mentor

Hi,

From where we should call this API Dynatrace.identifyUser("john.doe@example.com"); Is it possible to do this from GUI.


You call it when you know which user a session should be tagged with (e.g. after login finished or after app was started and you already know which user is logged in). It has te be set on every app restart as the user tag is not persisted.
I don't understand the GUI part of this question... but you can call it from everywhere


iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

Featured Posts