-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
In #6111 (comment) and #11579 we created new APIs to let plugin developers extend the Visitor Log and the Visitor Profile in Piwik.
It would be valuable to write a guide to explain to developers how this can be easily done, on http://developer.piwik.org/develop
How to extend Visitor Profile in a Matomo plugin?
It is possible to add any dynamic content in the visitor profile,
you can define a class that extends ProfileSummaryAbstract in the ProfileSummary / directory
it should be automatically detected and loaded,
See for example how it is used in Matomo so that each plugin adds its infos to the profile:
https://github.com/matomo-org/matomo/search?q=ProfileSummaryAbstract&unscoped_q=ProfileSummaryAbstract
in particular for example: https://github.com/matomo-org/matomo/blob/1a76568aa7f85920e8f4b58e0aa2fd32f64de8ad/plugins/DevicesDetection/ProfileSummary/DevicesSummary.php
invoking a twig template: https://github.com/matomo-org/matomo/blob/1a76568aa7f85920e8f4b58e0aa2fd32f64de8ad/plugins/DevicesDetection/templates/_profileSummary.twig
So you can easily write out any dynamic text on the Visitor Profile.