为我工作。
require('gapi.class.php');
$ga = new gapi('[email protected]','google_analytics_password');
$filter = 'ga:pagePath==/home.php';
//first parameter is your Google Analytics profile id
/* How to find Google Analytics Profile ID
http://stackoverflow.com/questions/4119610/get-google-analytics-id-from-the-code-embed/4120625#4120625
*/
$ga->requestReportData(0000000,array('pagePath'),array('pageViews','UniquePageviews'), '-pageViews', $filter);
foreach($ga->getResults() as $result)
{
echo $result->getPageviews();
echo $result->getUniquePageviews();
echo $result->getPagePath();
}
?>
来源
2011-03-16 13:47:18
Tag
你的链接不好...我们该怎么办〜/ * /视图/ *? – VinnyG 2012-04-25 16:56:39
@yahelc,#〜是正确的,但*并不意味着你在正则表达式中的想法。实际上,在这种情况下,filters = ga:pagePath =〜/ profile/123 /就足够了。 – s6mike 2012-10-11 05:55:04
我在我的查询中保留了原来的双精度'==',并且对它为什么不工作感到困惑......实质上:'filters = ga:pagePath ==〜/ profile/123/*'> ___ < – 2014-08-20 15:49:06