Skip to content

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

@mattab

Description

@mattab

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.

Metadata

Metadata

Assignees

Labels

c: Website matomo.orgFor issues related to our matomo.org website.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions