从Google Analytics API获取所有配置文件

问题描述 投票:0回答:1

我正在尝试通过此端点的〜all选项获取所有配置文件

https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles

由于〜all,它不会返回所有配置文件。如果我包括帐户ID而不是〜all,则它将返回基于该帐户ID的配置文件-与〜all选项一起使用时会丢失。

https://www.googleapis.com/analytics/v3/management/accounts/89478503/webproperties/~all/profiles

我是在做错什么,还是这是GA API错误?

google-analytics google-analytics-api endpoint
1个回答
0
投票

我建议您使用account summaries list查看>

GET https://www.googleapis.com/analytics/v3/management/accountSummaries

这将返回用户的所有帐户信息。

{
  "kind": "analytics#accountSummaries",
  "username": "[email protected]",
  "totalResults": 15,
  "startIndex": 1,
  "itemsPerPage": 1000,
  "items": [
    {
      "id": "59183475",
      "kind": "analytics#accountSummary",
      "name": "Cube Analytics",
      "webProperties": [
        {
          "kind": "analytics#webPropertySummary",
          "id": "UA-59183475-1",
          "name": "Cube Analytics",
          "internalWebPropertyId": "93305066",
          "level": "STANDARD",
          "websiteUrl": "XXXXXXX",
          "profiles": [
            {
              "kind": "analytics#profileSummary",
              "id": "115455750",
              "name": "Alaternate",
              "type": "WEB"
            },
            {
              "kind": "analytics#profileSummary",
              "id": "97191919",
              "name": "All Web Site Data",
              "type": "WEB"
            },
            {
              "kind": "analytics#profileSummary",
              "id": "178538323",
              "name": "MobileView",
              "type": "APP"
            }
          ]
        },      ]
}

通过使用此呼叫,您只需要打一个电话就可以收回所有信息。

© www.soinside.com 2019 - 2024. All rights reserved.