Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how plugins can extend Visitor Log and Visitor Profile #12073

Closed
mattab opened this issue Sep 18, 2017 · 0 comments · Fixed by matomo-org/developer-documentation#340
Closed
Assignees
Labels
c: Website matomo.org For issues related to our matomo.org website.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Sep 18, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Website matomo.org For issues related to our matomo.org website.
Projects
None yet
2 participants