Using trigger values in Matomo Analytics event


(Dave Cranwell) #1

I’m trying to set up tag manager so that in addition to a tag for Matomo Analytics of pageviews, I can record clicks on arbitrary bits of UI.

So as I understand it, if I want to record events on a modal box’s closing “X” button, I need to:

  1. Create an “All Elements Click” trigger, where “Click Element” “Matches CSS Selector”: “.modal__close”
  2. Create a tag for Matomo Analytics of Events in which I define modal-closing-specific event category/name/value etc.

In step 1 I called my All Elements Click trigger “Modal closed” and I basically want this name to be the “Event name” I use in my tag setup for step 2.

This way I’d only need to set up one Matomo Analytics Event tag, and I could specify multiple triggers - one for each bit of UI I want to track - which each get to trigger it.

I can’t work out how (or if it’s even intended) to use the name of the trigger to populate the event. The option isn’t there to choose from.

Without being able to do this, it looks to me like I’d have to configure a pair (a Trigger and a new Matomo Analytics Events Tag) for every single custom event I want to record. e.g

new Trigger: Modal open
new Tag: Matomo Analytics Events tag - category “Modal” acton: “open”

Trigger: Modal close
Tag: Matomo Analytics Events tag - category “Modal” acton: “close”

Trigger: Menu open
Tag: Matomo Analytics Events tag - category “Menu” acton: “open”

Trigger: Menu close
Tag: Matomo Analytics Events tag - category “Menu” acton: “close”

I’ve got about 30 UI sections I want to track like this and it seems so avoidable repetitive I’m sure I’m doing something wrong?

Any help would be appreciated


#2

I can’t work out how (or if it’s even intended) to use the name of the trigger to populate the event. The option isn’t there to choose from.

that’s indeed not possible yet. Created Use the name of a trigger to populate an event / use it as variable · Issue #146 · matomo-org/tag-manager · GitHub have a look there for more details.


(Dave Cranwell) #3

Thanks for creating an issue.

In the meantime, Is my understanding of what I need to do correct? I’m happy to do the grunt work if that’s what’s required, but I’m still not clear if I’m going about things a suboptimal way.

Is there perhaps a more streamlined interface where new triggers and tags can be configure together? They seem really tightly coupled in a custom event scenario like this. It would certainly be a nice interface to have if it doesn’t exist yet.