试用 Google Analytics 的 MCP 服务器。从
GitHub 安装,并参阅
公告了解详情。
Method: accounts.getDataSharingSettings
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*/dataSharingSettings}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。要查找的设置的名称。格式:accounts/{account}/dataSharingSettings 示例:accounts/1000/dataSharingSettings
|
响应正文
表示 Google Analytics 账号的数据共享设置的资源消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"name": string,
"sharingWithGoogleSupportEnabled": boolean,
"sharingWithGoogleAssignedSalesEnabled": boolean,
"sharingWithGoogleAnySalesEnabled": boolean,
"sharingWithGoogleProductsEnabled": boolean,
"sharingWithOthersEnabled": boolean
} |
字段 |
name |
string
仅限输出。资源名称。格式:accounts/{account}/dataSharingSettings 示例:“accounts/1000/dataSharingSettings”
|
sharingWithGoogleSupportEnabled |
boolean
允许 Google 技术支持服务代表在必要时访问您的 Google Analytics 数据和账号,以提供服务和寻找技术问题的解决办法。 此字段会映射到 Google Analytics“管理”界面中的“技术支持”字段。
|
sharingWithGoogleAssignedSalesEnabled |
boolean
允许 Google 访问您的 Google Analytics 账号数据,包括账号使用情况和配置数据、产品支出以及与您的 Google Analytics 账号关联的用户,以便 Google 帮助您充分利用各种 Google 产品,并为您提供有关 Google Analytics 和其他 Google 商业产品的数据洞见、优惠、建议和优化提示。 此字段会映射到 Google Analytics“管理”界面中的“针对您的业务的建议”字段。
|
sharingWithGoogleAnySalesEnabled (deprecated) |
boolean
已弃用。此字段已不再使用,并且始终返回 false。
|
sharingWithGoogleProductsEnabled |
boolean
允许 Google 使用这些数据来改进其他 Google 产品或服务。 此字段会映射到 Google Analytics“管理”界面中的“Google 产品和服务”字段。
|
sharingWithOthersEnabled |
boolean
如果选择贡献汇总的衡量数据,即可启用预测、模型估算和基准化分析等功能,获得更丰富的业务数据洞见。您共享的数据(包括数据共享来源媒体资源的有关信息)将会进行汇总和去标识化处理,然后才会用于生成业务数据洞见。 此字段会映射到 Google Analytics“管理”界面中的“根据模型估算贡献数据和业务数据洞见”字段。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eRetrieve data sharing settings for a Google Analytics account using a \u003ccode\u003eGET\u003c/code\u003e request to the specified endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThese settings control data sharing with Google support, sales teams, products, and others, and are configured at the account level.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes details on whether data sharing is enabled for various Google services and external parties.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes for read or edit access to analytics data.\u003c/p\u003e\n"]]],["This document details how to retrieve data sharing settings for a Google Analytics account. A `GET` request is sent to `https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*/dataSharingSettings}`, where `name` specifies the account. The request body must be empty. The response includes data sharing settings, represented in JSON format, with fields like `sharingWithGoogleSupportEnabled`, indicating whether the sharing of data is enabled for various Google support teams. This operation needs specific OAuth scopes, either `analytics.readonly` or `analytics.edit`.\n"],null,["# Method: accounts.getDataSharingSettings\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.DataSharingSettings.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGet data sharing settings on an account. Data sharing settings are singletons.\n\n### HTTP request\n\n`GET https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*/dataSharingSettings}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The name of the settings to lookup. Format: accounts/{account}/dataSharingSettings Example: `accounts/1000/dataSharingSettings` |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA resource message representing data sharing settings of a Google Analytics account.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"sharingWithGoogleSupportEnabled\": boolean, \"sharingWithGoogleAssignedSalesEnabled\": boolean, \"sharingWithGoogleAnySalesEnabled\": boolean, \"sharingWithGoogleProductsEnabled\": boolean, \"sharingWithOthersEnabled\": boolean } ``` |\n\n| Fields ||\n|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Output only. Resource name. Format: accounts/{account}/dataSharingSettings Example: \"accounts/1000/dataSharingSettings\" |\n| `sharingWithGoogleSupportEnabled` | `boolean` Allows Google technical support representatives access to your Google Analytics data and account when necessary to provide service and find solutions to technical issues. This field maps to the \"Technical support\" field in the Google Analytics Admin UI. |\n| `sharingWithGoogleAssignedSalesEnabled` | `boolean` Allows Google access to your Google Analytics account data, including account usage and configuration data, product spending, and users associated with your Google Analytics account, so that Google can help you make the most of Google products, providing you with insights, offers, recommendations, and optimization tips across Google Analytics and other Google products for business. This field maps to the \"Recommendations for your business\" field in the Google Analytics Admin UI. |\n| `sharingWithGoogleAnySalesEnabled` **(deprecated)** | `boolean` | This item is deprecated! Deprecated. This field is no longer used and always returns false. |\n| `sharingWithGoogleProductsEnabled` | `boolean` Allows Google to use the data to improve other Google products or services. This fields maps to the \"Google products \\& services\" field in the Google Analytics Admin UI. |\n| `sharingWithOthersEnabled` | `boolean` Enable features like predictions, modeled data, and benchmarking that can provide you with richer business insights when you contribute aggregated measurement data. The data you share (including information about the property from which it is shared) is aggregated and de-identified before being used to generate business insights. This field maps to the \"Modeling contributions \\& business insights\" field in the Google Analytics Admin UI. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/analytics.readonly`\n- `https://www.googleapis.com/auth/analytics.edit`"]]