Visibility Element Trigger with dynamic IDs and classes but constant elements


Im relatively new to matomo tag manager, but have at least some experience from google.
I have the following problem:

  • I want to create an event for form submissions
  • these are roundabout 15 or more
  • I wanted to use the success text

The code is as this in Inspector mode:

div id=“webform_JA8rOd_success_text” class=“std webforms-success-text” style="">Thank you for ordering our Drugs of Abuse Brochure. An e-mail with the respective download link will be sent to you immediately.</div

When I look at the class in inspector mode, it seems that it is dynamic, first time it is webform_eIl8RN_success_text or #webform_JA8rOd_success_text

So it looks to me that both, ID and class, are produced dynamically from the CMS (Magento). Is there any workaround or do I miss anything?

Selection mode: CSS Selector
CSS selector: .class
Only trigger when Visible Element Classes contains std webforms-success-text


Looks like there is no real solution …

Hi @cs_matomo

I don’t understand clearly when you speak about ID or class…
Please use triple ``` char (alone in its line) to start code in the forum, and again triple ``` char (still alone in its line) to end the code…

Ok, Im sorry. Im not an expert (yet :-))

So let me try again:
What I want:

  • Tracking of webform submissions as Events from a range of webforms.

I have tried a number of things in MTM; via ELEMENT ID or CSS Selector and Im not getting it to work.
It looks simple to do it, but Im not getting any events.


Why don’t you use the “Form Submit” trigger and restrict that by form id or class or name using “contains” or a regex?

We successfully track our forms with MTM like this. We also have changing form id, class, name (generated by nuxt.js).

While the form is visible in Inspector mode, it is not firing in matomo upon pushing the submit button. I dont know why.

TAG: matomo configuration
Tacking Type: Event
category: borchure
event action download
event name: webform

Trigger: Form Submit
without optional settings for test purposes
→ no response

did you try in MTM debug mode? do you see the trigger there?

No, I dont. Im not sure what is going on there. I must say though that I dont trust the debug mode. Some triggers dont seem to show up there, while I can see stuff live.