API Reference

管理 API

這是 Management API 3.0 版參考指南。並完整提供 Google Analytics (分析) 設定資料的查詢和回應詳細資料。如需設定資料的概念和結構指南,請參閱 3.0 版 總覽.

本指南中的每個章節分別針對已驗證使用者的設定資料中某一實體定義要求方法和回應。所有要求都會以 REST 格式顯示。在每個方法的頁面最後,您可以透過「API Explorer」連結,以互動方式試用該要求。

資源類型

  1. 帳戶摘要
  2. 帳戶使用者連結
  3. 帳戶
  4. AdWords 連結
  5. 自訂資料來源
  6. 自訂維度
  7. 自訂指標
  8. 實驗
  9. 篩選器
  10. 目標
  11. 用戶端 ID
  12. 個人資料篩選器連結
  13. 個人資料使用者連結
  14. 再行銷目標對象
  15. 區隔
  16. 未取樣報表
  17. 上傳
  18. View (設定檔)
  19. 網站資源
  20. 網站資源使用者連結

帳戶摘要

如要進一步瞭解帳戶摘要資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
list GET  /management/accountSummaries 列出使用者有權存取的帳戶摘要 (由帳戶/資源/設定檔組成的簡易樹狀結構)。

如要進一步瞭解帳戶使用者連結資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/entityUserLinks/linkId 從指定帳戶中移除使用者。
插入 POST  /management/accounts/accountId/entityUserLinks 如果使用者的帳戶少於 100 個,就會在指定帳戶中新增使用者。
list GET  /management/accounts/accountId/entityUserLinks 列出特定帳戶的使用者帳戶連結。
更新 PUT  /management/accounts/accountId/entityUserLinks/linkId 更新指定帳戶中現有使用者的權限。

帳戶

如要進一步瞭解 Account 資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
list GET  /management/accounts 列出使用者有權存取的所有帳戶。

若要進一步瞭解 AdWords 連結資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks/webPropertyAdWordsLinkId 刪除網站資源 - AdWords 連結。
get GET  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks/webPropertyAdWordsLinkId 傳回使用者有權存取的網站資源-AdWords 連結。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks 建立 webProperty-AdWords 連結。
list GET  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks 列出特定網站資源的 webProperty-AdWords 連結。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks/webPropertyAdWordsLinkId 更新現有的 webProperty-AdWords 連結。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/entityAdWordsLinks/webPropertyAdWordsLinkId 更新現有的 webProperty-AdWords 連結。

自訂資料來源

如要進一步瞭解自訂資料來源資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
list GET  /management/accounts/accountId/webproperties/webPropertyId/customDataSources 列出使用者有權存取的自訂資料來源。

自訂維度

如要進一步瞭解自訂維度資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
get GET  /management/accounts/accountId/webproperties/webPropertyId/customDimensions/customDimensionId 建立使用者有權存取的自訂維度。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/customDimensions 建立新的自訂維度。
list GET  /management/accounts/accountId/webproperties/webPropertyId/customDimensions 列出使用者可存取的自訂維度。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/customDimensions/customDimensionId 更新現有的自訂維度。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/customDimensions/customDimensionId 更新現有的自訂維度。

自訂指標

如要進一步瞭解自訂指標資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
get GET  /management/accounts/accountId/webproperties/webPropertyId/customMetrics/customMetricId 取得使用者有權存取的自訂指標。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/customMetrics 建立新的自訂指標。
list GET  /management/accounts/accountId/webproperties/webPropertyId/customMetrics 列出使用者可存取的自訂指標。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/customMetrics/customMetricId 更新現有的自訂指標。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/customMetrics/customMetricId 更新現有的自訂指標。

實驗

如要進一步瞭解實驗資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments/experimentId 刪除實驗。
get GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments/experimentId 傳回使用者有權存取的實驗。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments 建立新實驗。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments 列出使用者可存取的實驗。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments/experimentId 更新現有實驗。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/experiments/experimentId 更新現有實驗。

篩選器

如需篩選器資源詳細資料,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/filters/filterId 刪除篩選器。
get GET  /management/accounts/accountId/filters/filterId 傳回使用者有權存取的篩選器。
插入 POST  /management/accounts/accountId/filters 建立新篩選器。
list GET  /management/accounts/accountId/filters 列出帳戶的所有篩選器
修補 PATCH  /management/accounts/accountId/filters/filterId 更新現有的篩選器。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/filters/filterId 更新現有的篩選器。

目標

若要進一步瞭解目標資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
get GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals/goalId 取得使用者可存取的目標。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals 建立新目標。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals 列出使用者可存取的目標。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals/goalId 更新現有目標。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals/goalId 更新現有目標。

用戶端 ID

如要進一步瞭解 Management.clientId 資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
hashClientId POST  /management/clientId:hashClientId 對指定的用戶端 ID 進行雜湊處理。

如需設定檔篩選器連結資源詳細資料,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId 刪除設定檔篩選器連結。
get GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId 傳回單一設定檔篩選器連結。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks 建立新的設定檔篩選器連結。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks 列出付款資料的所有個人資料篩選器連結。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId 更新現有的設定檔篩選器連結。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId 更新現有的設定檔篩選器連結。

如要進一步瞭解個人資料使用者連結資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/entityUserLinks/linkId 從指定資料檢視 (設定檔) 中移除使用者。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/entityUserLinks 將新使用者加進指定資料檢視 (設定檔)。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/entityUserLinks 列出特定資料檢視 (個人資料) 的個人資料連結。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/entityUserLinks/linkId 更新特定資料檢視 (設定檔) 現有使用者的權限。

再行銷目標對象

如要進一步瞭解再行銷目標對象資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId 刪除再行銷目標對象。
get GET  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId 取得使用者有權存取的再行銷目標對象。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences 建立新的再行銷目標對象。
list GET  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences 列出使用者有權存取的再行銷目標對象。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId 更新現有的再行銷目標對象。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId 更新現有的再行銷目標對象。

區隔

如要進一步瞭解區隔資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
list GET  /management/segments 列出使用者可存取的區隔。

未取樣報表

若要進一步瞭解未取樣報表資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/unsampledReports/unsampledReportId 刪除未取樣報表。
get GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/unsampledReports/unsampledReportId 傳回一份未取樣報表。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/unsampledReports 建立新的未取樣報表。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/unsampledReports 列出使用者可存取的未取樣報表。

上傳

如要進一步瞭解上傳資源詳細資料,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
deleteUploadData POST  /management/accounts/accountId/webproperties/webPropertyId/customDataSources/customDataSourceId/deleteUploadData 刪除與先前上傳作業相關的資料。
get GET  /management/accounts/accountId/webproperties/webPropertyId/customDataSources/customDataSourceId/uploads/uploadId 列出使用者可存取的上傳項目。
list GET  /management/accounts/accountId/webproperties/webPropertyId/customDataSources/customDataSourceId/uploads 列出使用者可存取的上傳項目。
uploadData POST
https://www.googleapis.com/upload/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/customDataSources/customDataSourceId/uploads
上傳自訂資料來源的資料。

檢視表 (設定檔)

如要進一步瞭解資料檢視 (設定檔) 資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId 刪除資料檢視 (設定檔)。
get GET  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId 取得使用者有權存取的資料檢視 (設定檔)。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/profiles 建立新的資料檢視 (設定檔)。
list GET  /management/accounts/accountId/webproperties/webPropertyId/profiles 列出使用者有權存取的資料檢視 (設定檔)。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId 更新現有的資料檢視 (設定檔)。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/profiles/profileId 更新現有的資料檢視 (設定檔)。

網站資源

如要進一步瞭解網站資源資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
get GET  /management/accounts/accountId/webproperties/webPropertyId 取得使用者有權存取的屬性。
插入 POST  /management/accounts/accountId/webproperties 建立新資源。
list GET  /management/accounts/accountId/webproperties 列出使用者俱有存取權的屬性。
修補 PATCH  /management/accounts/accountId/webproperties/webPropertyId 更新現有資源。這個方法支援修補語意。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId 更新現有資源。

如要進一步瞭解網站資源使用者連結資源,請參閱資源表示法網頁。

方法 HTTP 要求 說明
相對於 https://www.googleapis.com/analytics/v3 的 URI (除非另有註明)
刪除 DELETE  /management/accounts/accountId/webproperties/webPropertyId/entityUserLinks/linkId 從指定網站資源中移除使用者。
插入 POST  /management/accounts/accountId/webproperties/webPropertyId/entityUserLinks 在指定網站資源中新增使用者。
list GET  /management/accounts/accountId/webproperties/webPropertyId/entityUserLinks 列出特定網站資源的網站資源使用者連結。
更新 PUT  /management/accounts/accountId/webproperties/webPropertyId/entityUserLinks/linkId 更新指定網站資源上現有使用者的權限。