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
172 stars 58 forks source link

[Enhancement] Ask Matomo user if they want to keep Matomo configuration variable when importing a Matomo Tag Manager version #644

Open SW-Vincent opened 1 year ago

SW-Vincent commented 1 year ago

Hi,

When managing several Matomo account it is pretty common to import a Matomo Tag Manager version from an other account. This can lead to forgetting to change back the configuration variable (ex : idSite or Matomo URL).

Being able (when importing a Matomo Tag Manager version) to not overwrite configuration would be a nice addition to the import feature !

snake14 commented 1 year ago

Hi @SW-Vincent . Thank you for the suggestion. If I'm understanding correctly, that sounds like it might be a good enhancement to improve customer experience. Could you please provide a little more detail, possibly an example, of what changes you would like made?

heurteph-ei commented 1 year ago

Here is my workaround on this: I have an MTM container template (just used as the base for all new MTM containers). In this template, in order to be sure to never track on the wrong site ID, I put ZERO for the site ID (in string, as the number 0 is refused by the UI. Then when I export then import the container, if I forget to update the site ID, the tracking goes to site ID ZERO, then is ignored! No pollution of other site IDs.

SW-Vincent commented 1 year ago

Hi @SW-Vincent . Thank you for the suggestion. If I'm understanding correctly, that sounds like it might be a good enhancement to improve customer experience. Could you please provide a little more detail, possibly an example, of what changes you would like made?

Hi, in my opinion there are several ways to do so :

Option 1 :

The user pastes his container in the dedicated window as follows :

image

After clicking on the "Overwrite draft with this version" button a new pop-up appears :

image Depending on the answer, the configuration variable is or is not overwritten

Option 2 :

There are checkboxes within the dedicated window with default value "do not overwrite configuration"


Important Edit :

Since you can litteraly tag an other website with any Matomo Tag Manager and one container can contain several configuration variables, maybe the most reliable option would be :

The user pastes his container in the dedicated window as follows :

image

After clicking on the "Overwrite draft with this version" button a new pop-up appears :

image Maybe a special message could be displayed if Matomo URL / IDSite are not the sames as the ones hosting the container.

When "Yes" is clicked, the list of configuration variables is displayed, configuration variables can edited through this list. Maybe this list could be developped to see which tags are related to which configuration (when there are several of them), if there is the possibility for the user to trag and drop tags from one configuration variable to the other.

SW-Vincent commented 1 year ago

Here is my workaround on this: I have an MTM container template (just used as the base for all new MTM containers). In this template, in order to be sure to never track on the wrong site ID, I put ZERO for the site ID (in string, as the number 0 is refused by the UI. Then when I export then import the container, if I forget to update the site ID, the tracking goes to site ID ZERO, then is ignored! No pollution of other site IDs.

That is a nice workaround indeed. Is there something similar with Matomo URL ?

heurteph-ei commented 1 year ago

@SW-Vincent , as workaround, you can put a fake URL like http://example.com/