Webのアクセス解析「アナリティクス」からで
ページビュー数やセッション数をPHPで簡単に
取得する方法が紹介されていたのでメモ
Google Analyticsから訪問数・PV数をPHPでゲットするサンプルコード
これは、ランキングとか何かに使えそう
Retrieve Google Analytics Visits and PageViews with PHP
PHPでGoogle Analyticsの訪問数・PV数を取得
ページビュー数やセッション数をPHPで簡単に
取得する方法が紹介されていたのでメモ
Google Analyticsから訪問数・PV数をPHPでゲットするサンプルコード
これは、ランキングとか何かに使えそう
Retrieve Google Analytics Visits and PageViews with PHP
PHPでGoogle Analyticsの訪問数・PV数を取得
//session_start for caching, if desired
session_start();
//get the class
require 'ga/analytics.class.php';
//sign in and grab profile
$analytics = new analytics('david@davidwalsh.name', 'myP@ssw0rd');
$analytics->setProfileByName('davidwalsh.name');
//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
print_r($analytics->getVisitors());
//get array of pageviews by day
print_r($analytics->getPageviews());