Add simple analytics
McPringle opened this issue · 0 comments
McPringle commented
Log page requests
Step 1: Extract the data from the request and response headers
- URL
- date and time
- IP address
- user-agent
- accept-language
- referrer
- status code
Step 2: Process the data asynchronously
- date (as is) and time (remove seconds)
- page requested (based on URL)
- browser and version (based on user-agent)
- OS and version (based on user-agent)
- country (based on IP address)
- language (based on accept-language)
- referrer (as is)
Step 3: Respect privacy
- save the result from data processing in step 2 only
- don't save the raw header data
- don't save the IP address
- don't save the user-agent string
- use separate tables (e.g.
page_requests
,browsers
,languages
, etc), so we will not be able to make connections between them - store date and time (down to minutes, no seconds) for
page_requests
only - for all other data (
browsers
,languages
, etc), store just the date (no time) -> no connection by timestamp possible
Brainstorming: Is it okay to save the complete referrer? It should not contain any sensitive data. Just the page the user was linked from. IMHO it should be okay.
Step 4: Documentation on the website
- why are we tracking
- what are we tracking
- how are we tracking