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

Make pre-configured Variables fully configurable #791

Open 9joshua opened 1 month ago

9joshua commented 1 month ago

When selecting a default variable like {{ClickDestinationUrl}} there is no way to edit the configuration as allowed by the Advanced Settings available to custom variables. The option to assign a default value and lookup tables to pre-configured variables is not provided.

For example, say I wanted to convert the destination URL to a social media name using a lookup table... image This is currently not possible with pre-configured variables, nor is there a way to use variables like {{ClickDestinationUrl}} which are associated with actions as custom variables. In other words, no such option exists when choosing from custom variable types... image

snake14 commented 1 month ago

Hi @9joshua . Thank you for taking the time to create this issue. You're talking about the pre-configured variables, right? image

It seems like being able to use them right out of the box without any configuration is kind of the point, so I don't know if we're going to change that.

That being said, I believe there's an option. You could create a Custom JavaScript variable, use a JavaScript Function like function () { return {{ClickDestinationUrl}}; }, and then use the advanced settings as you mentioned.

9joshua commented 1 month ago

Thank you @snake14 Your solution does work... Screenshot from 2024-05-10 11-21-24 Screenshot from 2024-05-10 11-22-25

I think being able to extend pre-configured variables without the need to use custom JavaScript variables would be useful. I understand the simplicity of having pre-configured variable, but it would be great if, optionally, they also had flexibility. Your solution does this, it is just not clear how it can be done without an explanation. I can create an FAQ for this, but still hopeful we may be able to have the option for advanced settings for pre-configured variables in the future.

snake14 commented 1 month ago

Thank you @9joshua . A FAQ would likely be helpful if you get a chance to create one. I can leave this issue open and let the Product team determine whether it's something they'd like to prioritise.