如何在此Google Analytics(分析)查询中添加“过滤器”?

时间:2018-12-03 16:33:03

标签: google-analytics google-analytics-api

我正在尝试访问Google Analytics(分析)API。

如何添加仅提取以下数据的过滤器: ga:campaign包含“电视” ga:sourceMedium包含“ Google / CPC”

请,请参阅我当前的请求:

metrics_columns = [
  {expression: 'ga:transactions'},
  {expression: 'ga:adCost'}
];

dimensions_rows = [{
  name: 'ga:campaign'
}];

date_filters = [{
  startDate: 'today',
  endDate: 'today',
}];

sort = [{
  fieldName: 'ga:transactions',
  sortOrder: "DESCENDING"
}];

var req = {
  reportRequests: [{
    viewId: viewID,
    dateRanges: date_filters,
    metrics: metrics_columns,
    dimensions: dimensions_rows,
  }],
};

0 个答案:

没有答案