No description or website provided.


Fake Google Analytics (GA) is a tool used to shorten the feedback loop when testing the interaction of a website with Google Analytics. It does so by redirecting all traffic to to the web server run locally, storing it in the file, and exposing via simple HTTP interface. (an entry in /etc/hosts is added)



rvmsudo bundle install

'sudo' is necessary as adding an entry to the hosts file require root privileges.


In order to start intercepting all GA traffic execute:

bundle exec rake fake_ga:run

In order to clear the file containg all intercepted GA requests execute:

bundle exec rake fake_ga:clear

Accessing GA data

You can access data via HTTP:

You can purge collected data by executing DELETE method against:

You can also find a list of all requests to GA in the file: "db/requests.yml"

Technical details

This tool works by adding a custom entry to the hosts file. When this tool is running all traffic that goes to is going to be "intercepted" and logged instead of going to GA.


Fake Google Analytics is released under the MIT license, a copy of which can be found in LICENSE.

The public/ga/ folder contains code snippets from google see: ""