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.73k stars 2.63k forks source link

Support custom dimensions for more tracking methods #21647

Open Starker3 opened 10 months ago

Starker3 commented 10 months ago

What happened?

As explained in the documentation here: https://developer.matomo.org/guides/tracking-javascript-guide#custom-dimensions It's possible to track Custom Dimensions with specific tracking requests instead of setting them globally and then needing to reset them before the next tracking request is sent.

However, this method does not work for any of the content tracking methods, such as: _paq.push(['trackContentImpression', 'Content Topic', 'More data', 'Other data', {dimension5: 'my dimension value'}]);

What should happen?

The Custom Dimension should be tracked

How can this be reproduced?

Use the above tracking method in your browser console and check the tracking request - no dimension parameter is sent and no custom dimension is tracked by Matomo

Matomo major version

Matomo 5

Matomo minor or patch Version

rc8

PHP version

8.1

Server operating system

Debian

What browsers are you seeing the problem on?

Not applicable (e.g. an API call etc.)

Computer operating system

N/A

Relevant log output

No response

Validations

mneudert commented 10 months ago

Might also be relevant for other tracking functions, thinking about trackContentInteraction, logEcommerceOrder, everything else sending a request.

Will relabel as an Enhancement as the feature is just not available at the moment.

Starker3 commented 10 months ago

I forgot to mention that I also tested with trackContentInteraction and it doesn't work there either. Didn't get a change to test with an ecommerce order.

tsteur commented 10 months ago

We also just had a customer who would like to track custom dimensions for Ecommerce such as the currency to work around https://github.com/matomo-org/matomo/issues/3812

However, despite the dimension value being sent to the server, the dimension in scope action is not stored along the ecommerce conversion.