// Google Analytics Test require_once $_SERVER['DOCUMENT_ROOT'].'/ga/autoload.php'; use UnitedPrototype\GoogleAnalytics; // Initilize GA Tracker $tracker = new GoogleAnalytics\Tracker('MO-3170970-6', 'www.nakayama.de'); // Assemble Visitor information // (could also get unserialized from database) $visitor = new GoogleAnalytics\Visitor(); $visitor->setIpAddress($_SERVER['REMOTE_ADDR']); $visitor->setUserAgent($_SERVER['HTTP_USER_AGENT']); // Assemble Session information // (could also get unserialized from PHP session) $session = new GoogleAnalytics\Session(); // Assemble Page information $page = new GoogleAnalytics\Page($_SERVER['REQUEST_URI']); $page->setReferrer($_SERVER['HTTP_REFERER']); $page->setTitle("Index"); // Track page view //print_r($page); $tracker->trackPageview($page, $session, $visitor); ?>