Add server side analytics
Due to the fact that only a fraction of our visitors allow tracking, we are missing a lot of valuable data. So we need a way to track page visits in Matomo on the server. If the user has not consented, don't track personal data.
Server-Side Analytics and GDPR Compliance
Anonymous Page Visit Events: You can send completely anonymous page visit events to Matomo on the server. This method can help you track basic visit metrics without relying on client-side tracking, which is often blocked by users or browser settings.
Data Types Allowed: When considering GDPR compliance, you need to be cautious about the types of data you collect and process. Here are some data types you might consider:
- IP Address: You can anonymize IP addresses before storing them in Matomo.
- User Agent: While user agents can provide valuable information about the browser and operating system, they can sometimes be combined with other data to identify individuals. Generally, user agents alone are not considered personal data, but they should be handled carefully. URL and Referrer: Tracking the URLs and referrers of page visits is usually permissible as long as they do not contain personal data.
- Timestamp: Storing the timestamp of visits is generally acceptable.
- Anonymized Session IDs: You can use session IDs that do not directly identify users.
Acceptance Criteria:
- Every time a page is loaded, the server sends a page visit event to Matomo.
- This needs to work for blog posts too.
- When a cached page is returned, we also send a page visit event.
Edited by Jens Uwe Becker