sylvainjule / kirby-matomo

Matomo integration for Kirby, in both your panel and templates. Kirby 3 only.
MIT License
134 stars 8 forks source link

A 'Content' Widget for Pages Tracked as 'Contents' #20

Open luxlogica opened 4 years ago

luxlogica commented 4 years ago

Matomo has a built-in function called 'Content Tracking', which allows you to track how many times specific page elements are displayed in the viewport, and clicked by the user. This is often used, for example, for Ad tracking - counting how many times each ad was shown and clicked.

When developing site with 'content tracking', the content being tracked by client is often going to be managed in Kirby: usually, each 'content' is going to have its own page in Kirby. In the Ad tracking example, for instance, each Ad would have its own page in the Kirby backend - where the user can specify things like the dates the ad should start/stop showing on the site, and the pages where it should be shown.

When we have Kirby pages that are Matomo 'contents', the page widget doesn't work - because these are not 'pages', they are only elements that appear inside other pages. But we still need them tracked!... For this situation, we would need a special 'content' widget instead of a page widget - and a way to specify the content URL/details to be retrieved from Matomo. Like the page widget, the 'content widget' could have some useful summary information - like how many times the content was displayed and interacted with in the last month - which would save the user having to go into the Matomo dashboard to look.

Here is some useful information from the Matomo docs:

sylvainjule commented 4 years ago

Could be useful indeed! I won't be able to work on it in a near future though.