Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Google Analytics API获取过去30天的数据_Php_Date_Parameters_Google Analytics_Google Analytics Api - Fatal编程技术网

Php Google Analytics API获取过去30天的数据

Php Google Analytics API获取过去30天的数据,php,date,parameters,google-analytics,google-analytics-api,Php,Date,Parameters,Google Analytics,Google Analytics Api,我正在使用的代码: $ga->requestReportData(8digitidwhichIcorrectlyplaced, array('browser', 'browserVersion'), array('Pageviews'), $sort_metric=null, $filter=null, $start_date=null, $end_date=null, $start_index=1, $max_results=30); 这是从过去30天我在google analyti

我正在使用的代码:

$ga->requestReportData(8digitidwhichIcorrectlyplaced, array('browser',
'browserVersion'), array('Pageviews'), $sort_metric=null, $filter=null, 
$start_date=null, $end_date=null, $start_index=1, $max_results=30);
这是从过去30天我在google analytics的页面浏览量中得到的吗

谢谢

在下列情况下的文件:

你非常接近。根据核心报告API,需要
开始日期
结束日期
。试试这个:

$ga->requestReportData(8digitidwhichIcorrectlyplaced, array('browser',
'browserVersion'), array('pageviews'), $sort_metric=null, $filter=null, 
$start_date='30daysAgo', $end_date='today', $start_index=1, $max_results=30);
上面的代码未经测试,但根据,您应该执行上面概述的操作


另外,请查看用于测试您的查询的列表。

谢谢。但实际上这是默认值。开始日期为空。结束日期为空。我需要确认这是真的,但是。。。。。。。不过,我感谢您的回复。