matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.92k stars 2.66k forks source link

Matomo can't see custom variable #22708

Closed analyticskislist closed 4 weeks ago

analyticskislist commented 1 month ago

Hi, I am in the process of configuring analytics using Matomo Tag Manager, and my Debug View is not detecting custom events that look like this:

window._mtm.push({'event': 'purchase', 'orderTotal': {{purchase.amountWhole}}});

Without this event being visible, I am unable to track order values, which is a key function needed for analyzing the results of our efforts. Please help.

sgiehl commented 4 weeks ago

@AltamashShaikh @snake14 Can you help here? This seems to be a tagmanager problem/question.

snake14 commented 4 weeks ago

@analyticskislist Unless you have a Trigger configured to listed to that specific event, I don't think you'll see it in the Debug View, as mentioned in the developer documenation. Also, I'm not sure if _mtm supports {{}} variable notation. I see a syntax error in the JS console when I try to execute it. Do you have that purchase amount value stored in a JavaScript variable or dataLayer? If so, you should be able to use that when triggering the event.

sgiehl commented 4 weeks ago

@analyticskislist I hope your question has been answered.

For further questions/requests around this or similar topics, please try to find some help on our forum (https://forum.matomo.org) first or get in touch with our support. We are using the issue trackers on GitHub only for feature requests and bug reports. Cheers,