Google 分析管理 API - Python - 获取 views/profiles/accts 的列表。对于单个用户
Google Analytics Management API - Python - Get list of views/profiles/accts. for a single user
我到处搜索,似乎无法找到一种简单的方法来获取某个用户 email/ID 有权访问的所有 accounts/profile/views 的列表。
我可以考虑获取帐户的配置文件 ID 列表,获取每个配置文件的视图 ID,然后遍历每个配置文件以找到我感兴趣的用户电子邮件的正则表达式匹配项,然后将其打印出来。但这真的能解决问题吗?
P.s。我不是说像读、写访问权限,尽管在最终打印中有这样的权限会很好。
用例:我想为另一个具有相同级别的配置文件和视图访问权限的用户复制现有用户帐户;首先我想知道用户 1 的访问级别是什么,然后才能为用户 2 制作副本
除非该用户授予您访问权限,否则您将无法找到该用户有权访问的所有帐户。假设他们已对您进行 Google 分析的身份验证,那么您可以使用 Account Summaries: list 检索他们有权访问的所有帐户的列表。
Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.
要求:
GET https://www.googleapis.com/analytics/v3/management/accountSummaries
回应
{
"kind": "analytics#accountSummaries",
"username": string,
"totalResults": integer,
"startIndex": integer,
"itemsPerPage": integer,
"previousLink": string,
"nextLink": string,
"items": [
management.accountSummaries Resource
]
}
如果您无权访问该用户帐户并且他们未授予您访问权限。那么您唯一的选择可能会要求检查您怀疑用户有权访问的每个帐户的 Profile User Links: list。无法在管理 API.
中搜索用户
我到处搜索,似乎无法找到一种简单的方法来获取某个用户 email/ID 有权访问的所有 accounts/profile/views 的列表。
我可以考虑获取帐户的配置文件 ID 列表,获取每个配置文件的视图 ID,然后遍历每个配置文件以找到我感兴趣的用户电子邮件的正则表达式匹配项,然后将其打印出来。但这真的能解决问题吗?
P.s。我不是说像读、写访问权限,尽管在最终打印中有这样的权限会很好。
用例:我想为另一个具有相同级别的配置文件和视图访问权限的用户复制现有用户帐户;首先我想知道用户 1 的访问级别是什么,然后才能为用户 2 制作副本
除非该用户授予您访问权限,否则您将无法找到该用户有权访问的所有帐户。假设他们已对您进行 Google 分析的身份验证,那么您可以使用 Account Summaries: list 检索他们有权访问的所有帐户的列表。
Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.
要求:
GET https://www.googleapis.com/analytics/v3/management/accountSummaries
回应
{
"kind": "analytics#accountSummaries",
"username": string,
"totalResults": integer,
"startIndex": integer,
"itemsPerPage": integer,
"previousLink": string,
"nextLink": string,
"items": [
management.accountSummaries Resource
]
}
如果您无权访问该用户帐户并且他们未授予您访问权限。那么您唯一的选择可能会要求检查您怀疑用户有权访问的每个帐户的 Profile User Links: list。无法在管理 API.
中搜索用户