-
Notifications
You must be signed in to change notification settings - Fork 22
Piwik
⚠️ This page documents the legacy Piwik setup and is kept for reference only. Piwik has been replaced by Matomo. See Start Matomo for the current analytics setup.
See the piwik section in configuration There are three trackers (site_ids) - oai, bitstreams and views (statistics.api). Bitstreams are the actual file downloads. Those are logged by *BitstreamReader. Views are "page views" logged by tracking code in footer. These two are displayed to the users from either the statistics menu or as a pdf report. OAI tracks the access to the machine to machine OAI-PMH endpoint.
In piwik you have to create user(s) with auth token, that can read/write from these sites. And paste the tokens into the configuration.
With 2017.04 there are two new configuration options:
- lr.statistics.api.mode =
- mode is
directorcached -
directis the pre #770 (https://github.com/ufal/lindat_piwik_reports) version
- mode is
- lr.statistics.api.cached.url =
- endpoint of the https://github.com/ufal/lindat_piwik_reports project if
cachedmode is used
- endpoint of the https://github.com/ufal/lindat_piwik_reports project if
If you want to enable access to piwik statistics create a group called "statistics_viewers" and add the users that should have access (hint. authenticated/anonymous group).
Still on the web page, open the particular day; if you are lucky "Visitor Log" on it's first page contains entry with a lot of actions, open the visitor profile -> ID, IP address otherwise use the sql below...
details about piwik backend: https://developer.piwik.org/guides/persistence-and-the-mysql-backend
mysql -u user -p'password' get the details in /var/www/config/config.ini.php
mysql crash course:
show databases;
use piwik_db;
show tables;
show columns from piwik_log_link_visit_action;
Finding visitors with a lot of actions
//hex(idvisitor) is what you see in the visitor profile, idvisitor is binary
//get top 15 ids from a site (4 is repository downloads in this case)
select hex(idvisitor),count(*) as count from piwik_log_link_visit_action where idsite=4 group by idvisitor order by count DESC LIMIT 15;
//or for particular date or date range use the server_time column e.g.
select hex(idvisitor),count(*) as count from piwik_log_link_visit_action where idsite=4 and server_time between '2016-04-08 00:00:00' and '2016-04-08 23:59:59' group by idvisitor order by count DESC LIMIT 15;
//or grouping by dates
select hex(idvisitor),count(*) as count, year(server_time), month(server_time),day(server_time) from piwik_log_link_visit_action where idsite=4 group by idvisitor, year(server_time), month(server_time), day(server_time) order by count DESC LIMIT 15;
deleting the records
delete from piwik_log_link_visit_action where idsite=4 and idvisitor=unhex('bd6611fbe712b84b') and server_time between '2016-04-08 00:00:00' and '2016-04-08 23:59:59';
//also clean the log_visit table
delete from piwik_log_visit where idsite=4 and idvisitor=unhex('bd6611fbe712b84b');
drop precomputed stats for the year_month you've touched
drop table piwik_archive_blob_2016_04;
drop table piwik_archive_numeric_2016_04;
Query OK, 0 rows affected (0.12 sec)
recompute:
root@piwik:/var/www# ./console core:archive --force-all-periods=315576000 --force-date-last-n=20 --url=http://ufal.mff.cuni.cz/piwik/ --force-idsites=4
-
--force-all-periods Limits archiving to websites with some traffic in the last [seconds] seconds.(last +- 10 years in the example) -
--force-date-last-n This script calls the API with period=lastN.(calls for last 20 days/weeks/months/years)
Getting Started
Features
- All Features — full categorised list
- CLARIN Licenses
- PIDs & Handles
- Featured Services / Refbox
- Field-Level Permissions
- File Previews
- Sharing a Submission
- Personal Access Tokens
- DOI Configuration per Community
- ROR Authority
Operations
- Kubernetes Deployment
- Samples (.env, Nginx)
- Nginx + Shibboleth
- Handle Server · Setup (v7)
- Shibboleth · DiscoJuice
- Shibboleth Accounts
- S3 Storage · CESNET S3
- Google Analytics
- Matomo
- Solr
- Logging
- Custom Namespace
- Health Report
For Users
Development
Reference
- Authorizations
- Metadata Info
- Citations (proposal)
- Repository Checklist
- Search, Browse & Filters
- Localization
- Importing Items (CLI)
- NFA Import - Steps
- OpenAIRE
- DOI Registration
- Inclusion in OLAC
- Unit Testing
- Deploy Checks
- Troubleshooting
- Versioning Theory
- Dynamic Resource Versioning
- Metashare Import · Schema
- Web Server Overview
- LINDAT Common Theme
- Workshop 2016 Results
- WebLicht Integration
- Google Dataset Search
Archive (v5 / stale)
- Old Home (v5)
- Installation (v5)
- Prerequisites (v5)
- Connecting Tomcat with Apache
- Using Apache
- Building Shibboleth FastCGI
- Shibboleth Install (v5)
- EUDAT Replication
- Backup (v5)
- Spring Social / Google Drive (v5)
- Clarin (→ Repository Checklist)
- Control Panel (v5)
- Overlays (v5)
- Configuration (v5)
- Speeding Up Downloads
- Debugging (v5)
- Selenium (v5)
- Code Contributions (v5)
- Best Practices (v5)
- Testing Hudson
- Working on Windows
- Prerequisites Checklist (v5)
- Migration to DSpace 7.2.1
- Upgrade From Lindat
- Piwik (→ Matomo) · Piwik Cleaning