kirby-matomo icon indicating copy to clipboard operation
kirby-matomo copied to clipboard

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

Open luxlogica opened this issue 5 years ago • 1 comments

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:

  • Basic User info on what 'content tracking' is: https://matomo.org/docs/content-tracking/

  • Developer info on how to set it up in your pages: https://developer.matomo.org/guides/content-tracking

  • How to retrieve tracked content data via API: https://developer.matomo.org/api-reference/reporting-api#Contents

luxlogica avatar Nov 25 '19 19:11 luxlogica

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

sylvainjule avatar Dec 04 '19 16:12 sylvainjule