Tracking with Custom Variables get summarized/overwritten

Hello,

I’m trying to track page views using custom variables but I can’t get it right. For instance, if some user has logged in and opened Article A once + Article B twice, I assume to get “1” for Article A and “2” for Article B in a report.

But when I use page scope custom variables (cvar argument), it summarizes page views and returns “3” for each article.

[matomoSite]/matomo.php?cvar={"1":["article_id","A"]}&e_c=Content&e_a=Details&e_n=Article&idsite=6&rec=1&_id=af344a398df83894&uid=150&rand=123457
[matomoSite]/matomo.php?cvar={"1":["article_id","B"]}&e_c=Content&e_a=Details&e_n=Article&idsite=6&rec=1&_id=af344a398df83895&uid=150&rand=123458

When I use visit scope custom variables (_cvar argument), it overwrites previously recorded data and returns “0” for Articls A and “3” for Article B, which is incorrect, too.

[matomoSite]/matomo.php?_cvar={"1":["article_id","A"]}&e_c=Content&e_a=Details&e_n=Article&idsite=6&rec=1&_id=af344a398df83896&uid=150&rand=123459
[matomoSite]/matomo.php?_cvar={"1":["article_id","B"]}&e_c=Content&e_a=Details&e_n=Article&idsite=6&rec=1&_id=af344a398df83897&uid=150&rand=123460

I don’t need any grouping by session or user, just an ordinary page views count. (I have to mention that there’re 2 possible kinds of a page view - “Dashboard” and “Details”, that’s why I pass event tracking info - e_c, e_a). I can provide any additional info, steps, record the screen reproducing the issue, etc.

Please help and thanks in advance,
Max

Anyone can shed some light on this please?

Hi there, i’m not sure about the issue you’re having, but have you tried using custom dimensions instead?
we highly recommend to use custom dimensions, where you shouldn’t have any issue: https://matomo.org/faq/general/faq_21117/
we will deprecate custom variables in the future

Guide at: https://matomo.org/docs/custom-dimensions/