Multiple tags are getting triggered in Matomo

Hi All,
I am using Matomo 4.9.1.
I have an event which has an allLinksClick Trigger. When I fire it the 2nd,3rd and 4th time the events gets triggered twice, thrice and 4 times respectively even though the action is performed only once.
I am identifying the trigger by the class name.

Hi @Nikhil_Bhade_IN,
Can you share the Matomo JavaScript code you inserted in the page?
How many containers you you have in your page? Do you use another Tag Manager than MTM?

I have only one container currently which is the default container.
I do not use any other Tag Manager. Only MTM

Can you share the Matomo JavaScript code you inserted in the page?

not able to copy paste the code here for some reason.

How many triggers and tags do you have in your container?

23 Tags and 33 Triggers.
10 of these tags have triggers meant for different language selections and are getting tracked perfectly.
When checked in Preview/Debug Mode, and we are encountering the aforementioned issue ; the tag is getting fired and the trigger has some long alphanumeric string.

Can you share a screenshot?

Is there any error in the JavaScript console of your browser?

None Observed in the javascript console.

There are warnings noticed, but those relate to content of the website.

Very strange that the name of the Fired tag…
What is the content of the Not Yet Fired Tags list? (does is contain only unnamed tags or do you see their name?)
What is the behaviour of the Not Yet Fired Tags list as you fire some triggers?
When a tag is fired twice or 3 times, what do you see in the Triggers tab of the debug view?

When this issue occurs, in debug mode the trigger only shows the trigger type.
Not Yet Fired tags also show the same alphanumeric string.
When the tag is fired multiple times, the trigger only shows the trigger type.

If I understand, when you problem occurs (eg. when you click twice, then you fires 3 tags, one for the 1st click and 2 for the 2nd click):

  • on the left part of the debugger, the “event” appears 3 times
  • For each of these 3 “events”, the tag is the same (except for the Fired count value)
  • For each of these 3 “events”, the trigger is the same.

Again I would be interested in the whole code you added in your page to declare Matomo / MTM. To do that, don’t forget to use the code button (on a blank new line): image

Hi Phillippe,
The Issue is that for a single event that is configured we are recording multiple instances being recorded.
When multiple instances are being recorded,the tag and trigger is the same; however I observe that the tag triggered has an alphanumeric value for both fired and not yet fired tags.

The tracking code that I have used is -

<!-- Matomo Tag Manager -->
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=''; s.parentNode.insertBefore(g,s);
<!-- End Matomo Tag Manager -->

I see several mtm.PageViews in the events logs (on the left of the debugger).
I think your behaviour may come from this… The I deduce you are in a single page app.
Can you share the definition of this tag? (and also the definition of the event that fires mtm.PageView tag?)

Yes, the functionality of that CTA is to redirect it to the same page.
The definition of the tag is that it is in the default matomo configuration.
It is an Event where the event category and event action is set by us while the event name is {{ClickText}}
Additionally the trigger for the mtm.PageView is that it should satisfy the condition that the PageURL contains the PageUrl to which it loads.
Note this is observed for AllElementsClick and AllLinksClick as well.

I think the solution is there:

while this may be for pageviews, how do I fix this issue for events.