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

How to group autogenerated actions through different languages?

grabz
Visitor

Our iOS application is used in different languages, thus the same button has different labels in different languages. For example a button might be labeled as "Register" in English, and "Registrieren" in German (+ other way in other languages), so in Dynatrace User Session Dashboard I'll see these as different actions: "Touch on Register", "Touch on Registrieren".

This is okay in user session analysing but it causes problems on action based dashboard creation, since (as far as I found) there's no way to group these.

I found the naming rule here: User action naming, this says that unfortunately there's no way to use a generic title as the all the possible values are user language dependent. I'd report it as a bug, if there's no realistic workaround.

I found that we could one by one overwrite every tappable UI element's autogenerated action, but I find this cumbersome and was hoping to have a different way to resolve this.

Is there a way to use a non-user language dependent action name for tappable items without the need to change every tappable item? Taking the above registering example: both German and English should be logged as "Touch on Register", even if the button label in German is "Registrieren".

7 REPLIES 7

Patrick_H
Dynatrace Leader
Dynatrace Leader

Currently there only is the option to change the name of user actions by evaluating all of them. But there is a centralized approach to do so: https://www.dynatrace.com/support/help/shortlink/ios-oneagent-sdk#modify-any-auto-action

If you need something different please create a request for enhancement/product idea (RFE)
Bear in mind that when we read the label of buttons, we also do not have context of what the non-translated text would be - so we could detect the language the app is set to, but we do not have a way to report a generic name for a control's label.

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

thank you Patrick! I found the link you shared for setAutoUserActionCreationCallback. We'll give this a try, but I might still open an RFE

@Patrick_H, to setup setAutoUserActionCreationCallback properly I'd need to know every possible variations of the default strings that are logged. E.g.: "Touch on <string>", "Touch on<string> Back", "Touch on<string> something" etc. Could you please provide such a list?

Patrick_H
Dynatrace Leader
Dynatrace Leader

Why so complicated? You can just use pattern matching/RegEx or prefix checking (e.g. if a string starts with "Touch on"). Or is there a Pattern where this would not work for you?

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

That works if OneAgent doesn't put anything at the end.

So let's say that I have the below strings in my project:

"key_register" = "Register"
"key_turn_on" = "Turn on"
"key_how_are_you" = "How are you?"

Then if the user taps on for example the 3rd one OneAgent will log: "Touch on How are you?" as you suggest I can do a simple pattern matching to check what's after "Touch on ", then it'll work. I already did that in my project.

However I found that there are logs of OneAgent where it puts some words to the end of the string as well. For example if my sub-screen's title is "How are you?" and I press the back button on that screen then OneAgent will log: "Touch on How are you? Back". So using my above logic (check what is after "Touch on "), I'll try to translate: "How are you? Back". As "Back" isn't part of my string, I won't find it and won't be able to use a common language for logging with OneAgent. So for example in German "How are you?" is "Wie geht's?" meaning that for German users who tap back on this screen I'd log: "Touch on Wie geht's? Back" but for English users I'd log: "Touch on How are you? Back", however the two actions are the same.

So I'd need to check in setAutoUserActionCreationCallback not just every string that starts with "Touch on ", but other variations as well, where at the end of the string there's "Back", so I won't try to translate the whole string, but the part between "Touch on " and "Back".

I could write the logic already for that, but as this is only based on my heuristic research I cannot be sure that there aren't other variations. So if OneAgent might log at the end "action button" then I'd need to know that to have a proper pattern matching logic.

I know that this sounds a little hairsplitting, but our goal is to use the same language for all kind of logs to have meaningful usage dashboards.

Patrick_H
Dynatrace Leader
Dynatrace Leader

so when you want to map all languages to one for having same user action name, would https://www.dynatrace.com/support/help/shortlink/ios-oneagent-sdk#custom-control-names work out for you - there you could assign a custom name for any control

as for prefix postfix I know of
"Touch on" ....
"Touch on" .... " Back"
and
"Touch on" .... "@j:k" - where the @ part is the indexpath of e.g. a table cell
but this could change with newly supported controls...

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

Thanks Patrick. I stick with the setAutoUserActionCreationCallback to not pollute the code too much

Featured Posts