nojs-ga-php-tracking

Alternate server-side Google-Analytics-Tracking without JavaScript and Cookies. Uses PHP and Google Measurement Protocoll.

Advantages

Note: This script doesn’t track all data of the original Google Analytics code, especially no data that can only be determined with JavaScript, e.g. the screen resolution. The recognition of returning visitors is only as good as the server-side detection (e.g. login). Currently only the visitor is recognized within a session or by IP.

Installation

Save stat.php in web project folder, e. g. ‘inc/stat.php’

Usage

include('YOURPATH/stat.php');

Examples

Event tracking with jquery

function ga(s,t,ec,ea,el,ev){
 $.ajax({ type:"POST", url:"YOURPATH/stat.php", data:{"type":t,"ec":ec,"ea":ea,"el":el,"ev":ev} })
}

ga('send','event','CATEGORIE','ACTION','LABEL','VALUE')

Options

For all parameters look at Google Measurement Protocoll