How does Piwik track link click events?

I personally do not use Piwik. I have developed a JavaScript tool/library for creating a menu system in SharePoint and someone who uses my library was asking about incorporating Piwik.

From what I have read I can see that Piwik catches/tracks click events. I suspect it does that by default for tags that have a href attribute.

My JS library creates

elements with an onclick event. I’ve read and understand that I can manually fire a click event using Piwik’s trackLink function function. I wanted to avoid doing that for numerous reasons.

So I wanted to see how exactly Piwik tracks click events so I can figure out how I can incorporate it in a more general way. I thought maybe I could make my onclick event fake something by creating an element and executing it’s click event but wasn’t sure if that would work.

Hi there,

Piwik does not track click events automatically. One needs to call ‘trackEvent’ JS function to track events. find a bit of documentation in: Event Tracking - Analytics Platform - Matomo

Oh. Thanks! I thought it auto-tracked clicks on page load.