How should I track events (efficiently)?

I’m trying to track how many people scanned one of my QR codes. The way I do it is to make the QR code point to a specific redirect page that processes all the parameters and invokes Piwik PHP tracking API and then redirect the user to the correct page.

I’m seeking advice on what tracking action I should register with Piwik. From my understanding I’ll surely be using CustomVariables for recording information about my QR code, but should I record the action as an outlink or just a pageview? What are advantages / disadvantages of one approach over the other? Thanks

I would recommend as page view rather than outlinks (which may simplify it)

Hi Matt,

Thanks for your response. Since then I’ve spent a little more time with API documentation, and I think your suggestion is what I concluded in the end as well. By tracking page views (with customly set page URLs and page titles) I can record all the data I need, but now I have problem with displaying the information. I use two Custom Variables for each visitor, say Gender and Language, and I wish to plot the distribution of Language as a pie graph only for my male visitors i.e. Gender==Male. The metadata API allows me to plot graphs directly but I do not know how to plot such a graph which requires a condition. Do you have any clues?

I wish I could help with the custom variables graph, but it seems the ticket is still opened: Allow to plot custom variable values (or any rows) by searching & plotting - JS Graphs · Issue #2786 · matomo-org/matomo · GitHub .Maybe put your vote there!