Librería PHP para Google Analytics

Librería PHP que nos permite obtener los datos de Google Analytics tipo Visitas y Páginas Vistas de forma muy sencilla y cómoda:

//session_start for caching, if desired
//get the class
require 'ga/analytics.class.php';
//sign in and grab profile
$analytics = new analytics('', 'myP@ssw0rd');
//set the date range for which I want stats for (could also be $analytics->setDateRange('YYYY-MM-DD', 'YYYY-MM-DD'))
$analytics->setMonth(date('n'), date('Y'));
//get array of visitors by day
//get array of pageviews by day

Google Analytics PHP API class

Vía / David Walsh Blog

Similar Posts