Tracking events and metadata

Hello there!

I have an Angular SPA and would like to track events with metadata. For example, when a button is clicked, I want to send several parameters simultaneously:

  1. Event name
  2. Place in the application where the event occurred
  3. User’s role
  4. Param 4
  5. Param 5
  6. Param 6
  7. Param 7

As a workaround, I considered combining all the parameters into a string using the following format: [Event name]-[Place in app]-[User’s role]-[Param 4]-[Param 5]-[Param 6]-[Param 7] and assigning it to the “Event Action”. Then, I planned to filter the required data using Matomo Segments like this: “Event Action” contains “Name 1” AND “Event Action” contains “Place in app 1” AND “Event Action” contains “User role 1”. However, it is not working as I expected, and the events are not being filtered correctly.

Could you please tell me, what will be the correct way to implement it?

Best regards,