库:"google/apiclient": "^2.2"
框架:Laravel 5.5
我有一个工作正常的过滤器。但是只有这样才能真正起作用。它将获取所有具有ga:source
值的(direct)
。
$dimensionFilter = new Google_Service_AnalyticsReporting_DimensionFilter();
$dimensionFilter->setDimensionName('ga:source');
$dimensionFilter->setOperator('EXACT');
$dimensionFilter->setExpressions(['(direct)']);
$dimensionFilters[] = $dimensionFilter;
现在,当我尝试使用AND
$dimensionFilter = new Google_Service_AnalyticsReporting_DimensionFilter();
$dimensionFilter->setDimensionName('ga:source');
$dimensionFilter->setOperator('EXACT');
$dimensionFilter->setExpressions(['(direct)']);
$dimensionFilters[] = $dimensionFilter
$dimensionFilter = new Google_Service_AnalyticsReporting_DimensionFilter();
$dimensionFilter->setDimensionName('ga:date');
$dimensionFilter->setOperator('EXACT');
$dimensionFilter->setExpressions(['20180413']);
$dimensionFilters[] = $dimensionFilter;
它仅使用(direct)
以及20180413
检索全部。它应该只检索1个结果或同时包含(direct)
和20180413
的2个结果。