Tracking Categories

Hi,

I want to track my hits by category.
I have been successful in calling the stats for 5 categories through using Custom Variables, but I have many more categories than that. How can I call the stats for any category I have?

Is it possible to put a variable that stands for the category in the custom variable and pull it through the API? Please advise. :S

Thank you.

I have been successful in calling the stats for 5 categories through using Custom Variables, but I have many more categories than that. How can I call the stats for any category I have?

what are you doing exactly? what API urls do you use?

Is it possible to put a variable that stands for the category in the custom variable and pull it through the API? Please advise.

Yes you can record a custom variable and then call the Custom Variaable API to get all values.

Here are the categories I put in the tool, but i need more information than this… as I have other categories. Ideally, I want to pull a URL with the category and the page views in that category.

piwikTracker.setCustomVariable (1, ‘Category’, ‘ELC’, ‘page’);
piwikTracker.trackPageView()
piwikTracker.setCustomVariable (2, ‘Category’, ‘EUT’, ‘page’);
piwikTracker.trackPageView()
piwikTracker.setCustomVariable (3, ‘Category’, ‘ET&D’, ‘page’);
piwikTracker.trackPageView()
piwikTracker.setCustomVariable (4, ‘Category’, ‘IT Training KTBR’, ‘page’);
piwikTracker.trackPageView()
piwikTracker.setCustomVariable (5, ‘Category’, ‘Customer Projects’, ‘page’);

Currently we’re limited to 5 custom var per page unfortunately.

Matt,

I think it will do what I need it too. I want to capture the category the article is in. that really should require only 1 custom variable. What I did was look for a specific category, but can it pull any category id and its associated article? It seems like the variable. I noticed in one of the examples, Piwik could pull gender without the actual gender being set as part of the variable. But I couldn’t quite figure out how to make that work from the example shown.

I really only need to track the category and the pages associated to it. Is there no way to do this?

yes it’s possible with custom variables as well: see this tutorial: Using Custom Variables in Piwik (Tutorial) - Analytics Platform - Matomo