Matomo Web analytics
Like Tiki, Matomo is written in PHP and uses a MySQL database.
Integrating Matomo with Tiki
The documentation is here:
Copy the code from Matomo and paste in Admin -> Look & Feel -> General Layout or Customization (depends on your version of Tiki) -> Custom End of <body> Code surrounded by literal tags, as shown below:
The literal tags indicate to the Smarty template engine not to interpret the code and to pass it as-is.
direct URL to access Custom End of <body> Code is: tiki-admin.php?page=look&cookietab=2
To identify users logged into Tiki and track their activity, modify the default Matomo code to pass the Tiki username to Matomo . This is done by adding the following in Admin -> Look & Feel -> Custom End of <body> Code. Note that the Tiki username must be passed before 'trackPageView' in the default Matomo code to track user activity reliably.
Matomo Visitor Log with Tiki user information
Embedding Matomo report on a wiki page
It is possible to embed Matomo report into wiki page.
- In Matomo Admin
- Permission and User
- Go to setting, users.
- Set permission for anonymous so all the data will be public or create a specific user to create a token that will be used for authentication (recommended and explained here).
- In Manage Access give this user "View" permission for the website(s) you want the token to be used to share the report.
- Report Selection and Credentials
- Click on the user icon (top right), select widget
- Select the kind of report you want to display and copy the HTML code found in the field "Embed Iframe" (at the bottom of the preview). Paste it in a text-editor.
- Add at the end of the "src" (it should start by "http://example.org...") the parameter to the API calls URLs that require authentication: "&token_auth=". Paste the token_auth you created for your specific user.
You have now all the necessary and basic code that should be placed in a Tiki Wiki page.
- In Tiki
- Create or edit the page where you want to display the report.
- Set permission for your usage (it can be embedded inside group plugin for example).
- Insert an HTML plugin and paste the code you've prepared.
- Approve the plugin
- Tada !
Visits Summary, Visits Overview (with graph) for doc.tiki.org (previous day)
Visitor Setting, Screen Resolution for doc.tiki.org (previous day)
Actions, Pages for doc.tiki.org (previous day)
See also Template Tricks
Related: Google Analytics