问题描述
是否可以将多个查询打包到Google Analytics(分析)API?我正在使用AnalyticsService使用以下语法运行后续查询(记录为此处):
Is it possible to package multiple queries to the Google Analytics API? I'm running subsequent queries with the following syntax using the AnalyticsService (documented here):
var query = this.AnalyticsService.Data.Ga.Get(
this.GoogleAnalyticsProfileId, // profile id
start.ToString("yyyy-MM-dd"), // start date
DateTime.Now.ToString("yyyy-MM-dd"), // end date
QueryMetricMap[metric]); // metrics
var result = query.Fetch();
var query2 = this.AnalyticsService.Data.Ga.Get(
this.GoogleAnalyticsProfileId, // profile id
start.ToString("yyyy-MM-dd"), // start date
DateTime.Now.ToString("yyyy-MM-dd"), // end date
QueryMetricMap[metric]); // metrics
var result2 = query2.Fetch();
我了解可能有多种方法可以查询多个指标,但是为了简洁起见,上述示例被删节了-我在不同的查询上使用了不同的过滤器和维度,因此无法实现简单的布尔逻辑.我想简单地将多个查询打包到一个请求中.
I understand that there may be ways I can query for multiple metrics but the above samples are cut down for brevity - I use different filters and dimmensions on different queries that make simple boolean logic impossible. I would like to simply package up multiple queries into one request.
这可能吗?
推荐答案
添加上述问题的正确答案,Google数据协议中允许进行批处理,这是官方文档链接.
Adding the correct answer for the above mentioned question, Batch Processing is allowed in Google Data Protocol, here's the official documentation link.
这篇关于Google Analytics API多个查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!