matomo-org / tag-manager

Free Open Source Matomo Tag Manager - A simple way to manage and maintain all of your (third-party) tags on your website.
https://matomo.org
GNU General Public License v3.0
168 stars 57 forks source link

The preview mode does not respect the advanced settings of the tag #801

Open Chardonneaur opened 1 month ago

Chardonneaur commented 1 month ago

Hi team,

It appears that when we configure some advanced settings for a tag, for example: execute it once in a lifetime or once every 24 hours, the preview mode is not respecting those rules. Here is a video to understand better what is happening:

https://github.com/matomo-org/tag-manager/assets/28002238/b465b862-ebf8-4fba-96bc-dc71c61ef6b7

Expected behaviour would be that the preview mode respect those conditions, so to say the preview mode should not react to the associate tag for 24 hours or for a lifetime.

Enhancement: Implement a new setting which allows the customer to toggle whether tags are always triggered in debug mode or whether they follow the advanced settings. It should be possible by editing the code in this section.

atom-box commented 1 month ago

I had one user report this today.

snake14 commented 1 month ago

@Chardonneaur It appears that this was a deliberate design choice for debugging. Here's a snippet of the code that I found:

if (this.fireLimit === Tag.FIRE_LIMIT_ONCE_24HOURS && !window.mtmPreviewWindow) {
                        // in preview/debug mode we make sure to execute it
Chardonneaur commented 1 month ago

@snake14 thank you, would it be possible to make it as an on/off option?

snake14 commented 3 weeks ago

@Chardonneaur Sure. That looks possible. We'd just have to determine the best place to put such a setting in the UI. I went ahead and updated the description to reflect that enhancement.