# How to group autogenerated actions through different languages?

**URL:** <https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143>\
**Category:** Real User Monitoring\
**Tags:** user-actions, mobile-monitoring, ios\
**Created:** [June 9, 2023, 11:37am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143 "2023-06-09T11:37:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![grabz](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@grabz](https://community.dynatrace.com/u/grabz)\
**Post date:** [June 9, 2023, 11:37am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/1 "2023-06-09T11:37:37Z")

</div>

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&nbsp;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:&nbsp;[User action naming](https://www.dynatrace.com/support/help/platform-modules/digital-experience/mobile-applications/instrument-ios-app/customization/oneagent-sdk-for-ios#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”.

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [June 12, 2023, 6:23am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/2 "2023-06-12T06:23:06Z")

</div>

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:&nbsp;[OneAgent SDK for iOS in RUM Classic — Dynatrace Docs](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)](https://community.dynatrace.com/category/DynatraceProductIdeas)  
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.

---

<div class="post-metadata">

**Author:** ![grabz](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@grabz](https://community.dynatrace.com/u/grabz)\
**Post date:** [June 26, 2023, 9:23am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/3 "2023-06-26T09:23:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![grabz](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@grabz](https://community.dynatrace.com/u/grabz)\
**Post date:** [July 3, 2023, 2:03pm UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/4 "2023-07-03T14:03:47Z")

</div>

[@Patrick\_H](https://community.dynatrace.com/user/31862), to setup&nbsp;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?

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [July 4, 2023, 5:34am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/5 "2023-07-04T05:34:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![grabz](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@grabz](https://community.dynatrace.com/u/grabz)\
**Post date:** [July 4, 2023, 9:15am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/6 "2023-07-04T09:15:25Z")

</div>

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&nbsp;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.

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [July 4, 2023, 10:36am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/7 "2023-07-04T10:36:42Z")

</div>

so when you want to map all languages to one for having same user action name, would&nbsp;[OneAgent SDK for iOS in RUM Classic — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/ios-oneagent-sdk#custom-control-names)&nbsp;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…

---

<div class="post-metadata">

**Author:** ![grabz](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@grabz](https://community.dynatrace.com/u/grabz)\
**Post date:** [July 4, 2023, 10:44am UTC](https://community.dynatrace.com/t/how-to-group-autogenerated-actions-through-different-languages/40143/8 "2023-07-04T10:44:23Z")

</div>

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