Skip to content

Wanchai/PHP-JS-TinyAnalytics

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 4 commits ahead of benyafai:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TinyAnalytics

TinyAnalytics is a lightweight web analytics tool based on the idea that:

  • The two most useful things are: number of unique visitors per day (with a nice chart) and list of referers who send some traffic to your websites,

  • It should give the idea of the traffic, even for multiple websites, on a single dashboard (without having to click in lots of menu items to change the currently displayed website, etc.),

  • It should be fast and lightweight.

If you're looking for more informations than those (such as country, browser, screen resolution, time spent on a page, etc.), then TinyAnalytics is not the right tool for you. Please try Google Analytics, Open Web Analytics or Piwik instead. I personally found the two last ones not very handy for me.

After years, I've noticed that I prefer to have few (important) informations that I can consult each day in 30 seconds, rather than lots of informations for which I would need 15 or 30 minutes per day for an in-depth analysis.

Install

There are three easy steps:

  1. Unzip this package to a host accessible with https.

  2. Add the following tracking code to your websites at the end of files:

<script>
    const xhr = new XMLHttpRequest();
    xhr.open('POST', 'https:// myhost /req.php');
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.send(JSON.stringify({ "sn": "my-website-name" , "ref": document.referrer }));
</script>
  1. Modify your password in config.php and set the allowed domains there.

It's done! Visit at least one of your tracked websites, and open https:// myhost /index.php in your browser!

About

Author: Joseph Ernest (@JosephErnest)

Thanks to WhiteHat for his help on the chart visualization design.

PHP only version by Ben Yafai

Javascript version by Thomas Malicet (@tmalicet)

License

MIT license

About

TinyAnalytics is a lightweight analytics tool (unique visitors count, etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 77.1%
  • JavaScript 14.2%
  • CSS 8.7%