Google analytics 实时用户不反映在人口统计中
我使用php中的服务器端分析代码将Google分析与我的网站集成Google analytics 实时用户不反映在人口统计中,google-analytics,Google Analytics,我使用php中的服务器端分析代码将Google分析与我的网站集成 use UnitedPrototype\GoogleAnalytics; // Initilize GA Tracker $tracker = new GoogleAnalytics\Tracker('UA-XXXXXX', 'XXXXX.com'); // Assemble Visitor information // (could also get unserialized from da
use UnitedPrototype\GoogleAnalytics;
// Initilize GA Tracker
$tracker = new GoogleAnalytics\Tracker('UA-XXXXXX', 'XXXXX.com');
// Assemble Visitor information
// (could also get unserialized from database)
$visitor = new GoogleAnalytics\Visitor();
$visitor->setIpAddress($_SERVER['REMOTE_ADDR']);
$visitor->setUserAgent($_SERVER['HTTP_USER_AGENT']);
$visitor->setScreenResolution('1024x768');
// 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->setTitle('My Page');
// Track page view
$tracker->trackPageview($page, $session, $visitor);
问题是,昨天网站上显示的是实时用户,但今天网站上显示的总访问量为零。
这个服务器端实现有问题吗 最近谷歌推出了API-谷歌实时API,提供类似的功能。试试-