Google Analytics getTotalsForAllResults对于不同的维度不一致 [英] Google Analytics getTotalsForAllResults inconsistent for different dimensions
问题描述
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors') - > getTotalsForAllResults());
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors',array('dimensions'=>' GA:visitorType')) - > getTotalsForAllResults());
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors',array('dimensions'=>' GA:OperatingSystem的')) - > getTotalsForAllResults());
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors',array('dimensions'=>' GA:浏览器')) - > getTotalsForAllResults());
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors',array('dimensions'=>' GA:networkLocation')) - > getTotalsForAllResults());
print_r($ service-> data_ga-> get('ga:78834361','2014-01-01','today','ga:visitors',array('dimensions'=>' GA:城市')) - > getTotalsForAllResults());
退货
Array
(
[ga:visitor] => 120
)
Array
(
[ga:visitor] => 123
)
Array
(
[ga:visitor] => 121
)
Array
(
[ga:visitor] => 121
)
数组
(
[ga:visitor] => 128
)
数组
(
[ga:访客] => 131
)
为什么结果不一致?除了尺寸外,一切都是一样的。
按照要求,我尝试了ga:访问而不是ga:访问者。结果在这里是一致的。
数组
(
[ga:visits] => 184
)
Array
(
[ga:visits] => 184
)
Array
(
[ga:visits] => 184
数组
(
[ga:visits] => 184
)
数组
(
[ga:visits] = > 184
)
Array
(
[ga:visits] => 184
)
经过一番思考,是否因为在那段时间内,新的访问者可能会在以后的时间内再次访问该网站,从而将其标记为回访者? (对于第二行代码,对于其他行类似的逻辑?)
No_name / p>
再提示一次 - 使用不同的结束日期(理想的是今天 - 两天)。
数据可能尚未处理完毕(Google声称在某些情况下可能需要 48小时处理所有内容)。
我我刚刚测试了类似的东西,并且我得到了正确的访问次数/访问者数量,不管我选择了什么维度。
希望这有助于。
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors')->getTotalsForAllResults());
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors', array('dimensions' => 'ga:visitorType'))->getTotalsForAllResults());
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors', array('dimensions' => 'ga:operatingSystem'))->getTotalsForAllResults());
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors', array('dimensions' => 'ga:browser'))->getTotalsForAllResults());
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors', array('dimensions' => 'ga:networkLocation'))->getTotalsForAllResults());
print_r($service->data_ga->get('ga:78834361', '2014-01-01', 'today', 'ga:visitors', array('dimensions' => 'ga:city'))->getTotalsForAllResults());
returns
Array ( [ga:visitors] => 120 ) Array ( [ga:visitors] => 123 ) Array ( [ga:visitors] => 121 ) Array ( [ga:visitors] => 121 ) Array ( [ga:visitors] => 128 ) Array ( [ga:visitors] => 131 )
Why are the results inconsistent? Everything is the same except for the dimensions.
As requested, I have tried with "ga:visits" instead of ga:visitors. The results are consistent here. Even more confusion.
Array ( [ga:visits] => 184 ) Array ( [ga:visits] => 184 ) Array ( [ga:visits] => 184 ) Array ( [ga:visits] => 184 ) Array ( [ga:visits] => 184 ) Array ( [ga:visits] => 184 )
After some thought, is it because during that time frame, a new visitor may have revisited the site again at a later date still within the time frame, thus flagging them as a returning visitor? (for second line of code. Similar logic for the other lines?)
No_name,
one more hint -- use different end-date (ideally today - 2 days).
The data might not have been processed yet (Google claims in some cases, it might take up to 48 hours to process everything).
I have just tested something similar and I got the correct number for both visits/visitors no matter what dimension I picked.
Hope this helps.
这篇关于Google Analytics getTotalsForAllResults对于不同的维度不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!