試用 Google Analytics 的 MCP 伺服器。從
GitHub 安裝,詳情請參閱
公告。
Method: accounts.getDataSharingSettings
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
GET https://analyticsadmin.googleapis.com/v1alpha/{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 管理員 UI 中的「商家最佳化建議」欄位。
|
sharingWithGoogleAnySalesEnabled (deprecated) |
boolean
已淘汰,這個欄位已不再使用,一律會傳回 false。
|
sharingWithGoogleProductsEnabled |
boolean
允許 Google 使用資料改善其他 Google 產品或服務。 這個欄位會對應至 Google Analytics 管理員 UI 中的「Google 產品和服務」欄位。
|
sharingWithOthersEnabled |
boolean
提供匿名評估資料,系統就能啟用預測、模擬資料和基準化等功能,為您提供更豐富的業務洞察資料。您提供的資料 (包括共用資源的相關資訊) 會經過匯總和去識別化,然後才用來產生業務洞察資料。 這個欄位會對應至 Google Analytics 管理員 UI 中的「根據輸入內容和業務洞察資料建立模型」欄位。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eGet data sharing settings for a Google Analytics account using an HTTP GET request.\u003c/p\u003e\n"],["\u003cp\u003eThis request requires the account ID as a path parameter and an empty request body.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a JSON representation of the account's data sharing settings, including various sharing options with Google and others.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is necessary using specific OAuth scopes related to Analytics read or edit permissions.\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/v1alpha/{name=accounts/*/dataSharingSettings}`, where `name` specifies the account. The request body must be empty. The response contains a JSON object with fields such as `name`, and boolean values indicating sharing settings (e.g., `sharingWithGoogleSupportEnabled`). Access requires either `analytics.readonly` or `analytics.edit` OAuth scopes.\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/v1alpha/{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`"]]