This repo contains the code that records visitors' visits to static websites. It contains the Javascript code in /js that is embedded in frontend pages, as well as the Python code in /lambda which is deployed to AWS lambda. MongoDB is used to store the data for the visits.
It supports three types of visit records currently:
- Page visits: Logging each page the user visited in the web site
- External url visits: Logging the links to external web sites that the user has clicked
- Error pages: Logging the page visits where the status code != 200
New functions planning to be added:
- Logging which buttons the user clicked on
- Logging the time user spent on each page
- A static website
- An AWS account for creating Lambda function (1 million free requests / month)
- A MongoDB Atlas account (512 MB storage for free)
Since one record uses around 200 B storage space (depending on the lengths of the urls of the site), so around 2.5 million records can be saved into the DB.