1

我正在尝试使用Google Analytics(分析)Core Reporting API来查询某些过滤的会话数据。过滤器A返回结果,过滤器B返回结果,但应用过滤器A或B不返回任何结果。我错过了什么吗?Google Analytics核心报告API;或自定义尺寸过滤器

过滤通过精确匹配一个自定义维度:

curl -X GET -H "Authorization: OAuth <redacted>" 
    "https://www.googleapis.com/analytics/v2.4/data 
     ?ids=ga:<redacted> 
     &metrics=ga:sessions 
     &start-date=2014-06-01 
     &end-date=2016-05-25 
     &filters=ga:dimension1==MyMatchString" 

返回

<dxp:aggregates> 
    <dxp:metric name="ga:sessions" type="integer" value="12345"/> 
</dxp:aggregates> 

过滤通过其他自定义尺寸与精确匹配:

curl -X GET -H "Authorization: OAuth <redacted>" 
    "https://www.googleapis.com/analytics/v2.4/data 
     ?ids=ga:<redacted> 
     &metrics=ga:sessions 
     &start-date=2014-06-01 
     &end-date=2016-05-25 
     &filters=ga:dimension2==MyMatchString" 

返回

但与具有精确匹配任何自定义维度

curl -X GET -H "Authorization: OAuth <redacted>" 
    "https://www.googleapis.com/analytics/v2.4/data 
     ?ids=ga:<redacted> 
     &metrics=ga:sessions 
     &start-date=2014-06-01 
     &end-date=2016-05-25 
     &filters=ga:dimension1==MyMatchString,ga:dimension2==MyMatchString" 

不返回任何结果过滤:

<dxp:aggregates> 
    <dxp:metric name="ga:sessions" type="integer" value="0"/> 
</dxp:aggregates> 

我也试图与API的V3这些相同的请求,但有同样的结果。

+0

Web界面上的结果是否类似?另外尝试设置'samplingLevel:HIGHER_PRECISION'。 –

+0

@Kola设置'samplingLevel:HIGHER_PRECISION'没有效果。通过网络界面,你的意思是https://ga-dev-tools.appspot.com/query-explorer/?我无法使用它来测试此功能,因为我不拥有Google Analytics帐户来授权它 - 这是我们的客户之一,我只有refresh_token。 – sleeper2173

回答

相关问题