rdorado/site-analyzer

Analyze a php-based website with minimum configuration. Features include: hit counter, user analysis, ab tests, and user profiling.

0.0.1 2018-11-02 02:19 UTC

README

MIT License Latest Release Scrutinizer Quality Score

SiteAnalyzer is a package created to perform analysis of sites developed in PHP. SiteAnalyzer can be installed into any PHP site that fits the requirements in minutes. SiteAnalyzer makes use of machine learning algorithms and statistics to create powerful reports and analysis.

Features

  • Page counter/analysis
  • Report of pages per User
  • PSR-4 compatible.

Installation

You can install SiteAnalyzer through Composer:

$ composer require rdorado/site-analyzer

Or modify your composer.json requirements:

    "require": {
        "rdorado/site-analyzer": "^0.0.1"
    }

and then update your project:

$ composer update

Usage

Count all the views/pages you want to observe by importing the SiteAnalyzer class and then using the count static method:

use SiteAnalyzer\SiteAnalyzer;

SiteAnalyzer::count();

You can also include other options to be stored on the database. That depends on the kind of reportings or analyzis you want to perform:

$options = ['id' = $myid];
SiteAnalyzer::count($options);

Reporting/Displaying the stored information

Once you have started to count the page hits, different sort of reports can be displayed. For example, a very basic report is the number of hits per page stored on the database:

$data = SiteAnalyzer::getStats();
print( SiteAnalyzer::transform($data, "html") );