Trigger for variable "greater then equals 1" doesn't fire


(Oliver Lippert) #1

Hey there,
I try to migrate completely to the Tag Manager, which is a quiet good Module of matomo (thank’s to the devs).

So I have a Popup on my Website. Not all users got that shown. I want to know two events:

  1. Popup shows up
  2. Popup fades out

I quickly got the first one running, but the second one is more tricky. The popup can close via multiple ways (click on an X-Icon, click on the background OR press ESC).

So I had a look on HTML and the popup get’s an special class after fading out. So I created a Variable

function () { return jQuery(".ulp-overlay.ulp-animated.ulp-fadeOut").length; }

So now I need an Trigger which can fire if this variable bigger than 0 or is equal or bigger than 1.

I used a Timer here (seems the best solution for me right now) and set an Condition: “myVariable is equal or bigger than 1” (translated from german).

And here’s the surprise: It doesn’t work.

I debugged that with the mtmPreviewMode.

  1. In this timer, the variable is 0 as long as I did not close this popup
  2. In the Variablestab on that event (first timer after popup close) I see, that the Variable is now 1
  3. In the Triggers tab on that event (first timer after popup close), that no trigger was executed
  4. In the Tags tab of that event (first timer after popup close) I see, that no tag was executed

I hope I did provide enough information for someone who knows the Tag manager better than me :slight_smile:

At the moment my container just has 8 tags, 11 triggers, 3 variables and 11 versions, so I think this is quiet small. But actually there is some logic left in the source code which I want to migrate this week.

Thanks for any feedback.


#2

Cheers @lippoliv

I was able to reproduce this and created a fix here: Fix greater than comparison is not working by tsteur · Pull Request #151 · matomo-org/tag-manager · GitHub

It will be included in the next release (should be Matomo 3.9.0)