Skip to content

aliaslam/web-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the project

A basic Web Analytics API implemented using Go and Redis.

The API lets a site make POST requests to log page hits to Redis. And GET requests by users to get a count of hits logged between two dates or a count of unique visits, and get JSON responses back:

Log a hit

Get all visits to my site between any two arbitrary start and end times

Get all visits to a particular page on my site between any two arbitrary start and end times

Get all visits to my site by a particular referer between any two arbitrary start and end times

Get all visits to a particular page on my site by a particular referer between any two arbitrary start and end times

Get Daily, Monthly, and Yearly unique visitors to my site given a date

Code Walkthrough

A detailed screen cast of getting the app up and running and a detailed code walkthrough:

Pakages Used

Redis concepts used

How to run the App

  • Install Go
  • Install Redis and have it running locally at the default port 6379
  • Install redis-commander using npm
  • cd into the project directory and run: go run main.go
  • Start making POST & GET requests

Todos

  • Add tests
  • Easily able to add more dimensions to the app beyond referer and path
  • Change the getpageviews GET call to accept date format of YYYY/MM/DD, instead of UNIX_TIMESTAMP

About

Web Analytics using Golang and Redis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages