Privacy & GDPR
How Insights ensures GDPR/DSGVO compliance and protects user privacy.
Insights was built from the ground up with privacy as a core principle. It provides meaningful analytics without compromising user privacy or requiring consent banners.
No Cookies
Insights does not use cookies, localStorage, or any other client-side storage mechanism. This means:
- No cookie consent banner required
- No "accept cookies" popups
- Compliant with strict cookie laws (GDPR, ePrivacy, CCPA)
No Fingerprinting
Unlike many analytics tools, Insights does not fingerprint users. We don't collect or combine:
- Canvas fingerprints
- WebGL fingerprints
- Audio fingerprints
- Installed fonts or plugins
- Screen resolution (only category: small/medium/large)
- Timezone
- Hardware characteristics
Visitor Identification
Instead of tracking individuals, Insights uses a daily-rotating hash based on the same approach as Plausible and Fathom:
hash = SHA256(salt | date | ip | browser | language | screen)
Hash Attributes
Important: The IP address is used only for generating this hash and is immediately discarded. It is never written to any database, log file, or storage.
Why This Is GDPR Compliant
- IP is never stored - Only used for hash calculation, then discarded
- Hash is irreversible - SHA256 is a one-way function
- Daily rotation - Salt and date change daily, no long-term tracking possible
- No cookies/storage - Nothing is stored on the visitor's device
- Legal basis - Legitimate interest (Art. 6(1)(f) GDPR)
Properties
IP Address Handling
IP addresses are never stored - they are only used transiently for:
- Visitor hash generation - Combined with salt, date, browser, language, and screen to create an anonymous daily identifier
- Excluded IP filtering (Pro) - Your configured IP/CIDR exclusions
- GeoIP lookup (Pro) - Extracting country code only
Bot detection uses User-Agent analysis, not IP addresses. Common bot signatures like "bot", "crawler", "spider", "lighthouse", "pingdom", "uptimerobot" are filtered automatically.
Data Flow
- Browser loads
insights.js - JS sends POST to
/actions/insights/track(User-Agent, Accept-Language, IP sent automatically) - Server generates hash via
VisitorService.generateHash() - Database is updated (
uniqueVisitors += 1) - IP is NOT stored
Request arrives with IP + User-Agent + Accept-Language
↓
Bot check (User-Agent only): "googlebot" → reject
↓
IP exclusion check (Pro): 192.168.1.0/24 → reject
↓
Generate visitor hash: SHA256(salt | date | ip | browser | language | screen)
↓
GeoIP lookup (Pro): IP → "DE" (country code only)
↓
IP immediately discarded (never written to disk)
↓
Only hash and country code stored
Why This Is Safe
Limitations
The daily salt rotation means Insights cannot distinguish between new and returning visitors across days. The same person visiting today and tomorrow generates two unrelated hashes. This is an intentional privacy trade-off.
Static Caching
Static caching is not a problem since POST requests are not cached. When using a CDN or reverse proxy, ensure trustedProxies is configured in Craft to get the correct visitor IP.
Data Minimization
Insights practices strict data minimization:
Aggregated Storage
Raw events are never stored. All data is immediately aggregated:
Pageview → UPDATE stats SET views = views + 1 WHERE url = '/page'
This means:
- No individual user sessions
- No event logs
- No user timelines
- No way to reconstruct individual behavior
Data Retention
Configure automatic data cleanup:
// config/insights.php
return [
'dataRetentionDays' => 365, // Delete data older than 1 year
'autoCleanup' => true, // Run daily cleanup
];
Cleanup is automatic and irreversible. Old data is permanently deleted.
Do Not Track
Insights respects the browser's DNT (Do Not Track) header by default:
'respectDoNotTrack' => true, // Default
When enabled:
- Requests with
DNT: 1header are not tracked - No data is collected for these visitors
User Rights (GDPR)
Because Insights doesn't collect personal data:
Legal Basis
Since Insights:
- Collects no personal data
- Uses no cookies
- Performs no fingerprinting
- Stores only aggregated statistics
It typically falls outside GDPR scope for personal data processing. However, always consult with legal counsel for your specific situation.
Comparison with Other Tools
Configuration Checklist
For maximum privacy:
return [
// Respect browser privacy preferences
'respectDoNotTrack' => true,
// Reasonable data retention
'dataRetentionDays' => 365,
'autoCleanup' => true,
];