正在取得成效資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
查詢每日的資料量,即可快速查詢效能資料,而且不會超過配額。
您必須選擇要納入資料中的資訊:哪些搜尋類型 (網頁、圖片、影片等)
以及指定維度 (網頁、查詢、國家/地區或裝置),以及是否要依網頁或資源將結果分組。查詢網頁和/或查詢字串時,某些資料可能會遭到捨棄 (瞭解原因)。
總覽
- 建議您使用下方所述的查詢樣式,每天執行查詢,涵蓋一天的資料。每日查詢一天的資料不應超過每日配額。系統通常需 2 到 3 天後才能取得資料;您可以查看過去 10 天內依日期分組的簡單查詢,瞭解最新資料。編寫查詢時:
- 選擇是否要依網頁或資源分類結果。
- 選擇要在查詢中納入更完整的計數或維度。注意:您必須使用兩步驟程序查詢搜尋外觀資料 (AMP、藍色連結、複合式搜尋結果等)。
- 重新執行相同查詢,將要求中的
startRow
值調高 25,000,直到抵達最後一頁 (傳回 0 列的回應),以頁面瀏覽結果。
- 您可以選擇使用其他
type
參數執行相同查詢。
以下是單一查詢的虛擬程式碼範例。針對您想要的資料,您可以每天
為每個 type
值執行一次此測試。
int maxRows = 25000; // Current max response size
int i = 0;
do {
response = Request(startDate = 3_days_ago,
endDate = 3_days_ago,
... add dimensions, type ...
rowLimit = maxRows,
startRow = i * maxRows);
i++;
… // Do something with the response data.
} while (response.rows.count() != 0); // Page through all result rows
數據用量上限
除了 API 用量配額之外,Search Analytics 方法每天最多能為每種搜尋類型 (網頁、圖片等) 顯示 5 萬列資料 (按點擊次數排序)。
查詢詳細資料
您可以查詢依網頁或資源分組的資料。
已依網頁分組
如要獲得準確的計數,您必須略過網頁和查詢維度,如下所示:
"startDate": "2018-06-01",
"endDate": "2018-06-01",
"dimensions": ["country", "device"],
"type": "web",
"aggregationType": "byPage"
startDate
/ endDate
:選取同一日期,即可選用一天的回溯期。
dimensions
:視需要加入 country
和/或 device
。
type
:在獨立查詢中視需要以
每個 type
值進行列舉。
aggregationType
:必須為 byPage
。
如需網頁和/或查詢資訊等詳細資訊,請執行以下查詢,但您可能會遺失部分資料:
"startDate": "2018-06-01",
"endDate": "2018-06-01",
"dimensions": ["page", "query", "country", "device"],
"type": "web"
startDate
/ endDate
:選取同一日期,即可選用一天的回溯期。
dimensions
:包含 page
。視需要納入 query
、country
或 device
的任意組合。
type
:在獨立查詢中視需要以
每個 type
值進行列舉。
已依資源分組
如要獲得準確的計數,您必須略過網頁和查詢維度,如下所示:
"startDate": "2018-06-01",
"endDate": "2018-06-01",
"dimensions": ["country", "device"],
"type": "web"
startDate
/ endDate
:選取同一日期,即可選用一天的回溯期。
dimensions
:視需要加入 country
和/或 device
。
type
:視需要在獨立查詢中,逐一列舉
每個 type
值。
如需查詢、國家/地區和/或裝置資訊等更詳細的資訊,系統可能會遺失部分資料,但您必須執行下列查詢:
"startDate": "2018-06-01",
"endDate": "2018-06-01",
"dimensions": ["query", "country", "device"],
"type": "web"
startDate
/ endDate
:選取同一日期,即可選用一天的回溯期。
dimensions
:視需要納入 query
、country
或 device
的任意組合。
type
:在獨立查詢中視需要以
每個 type
值進行列舉。
依網頁或資源將結果分組
依網頁 (而非資源) 分組結果時,曝光次數、點擊次數、排名和點閱率的計算方式會有所不同。瞭解詳情。
為什麼在要求詳細資訊時遺失資料?
依網頁和/或查詢分組時,系統可能會捨棄部分資料,以便在合理的運算資源內計算出結果。
取得搜尋外觀資料
搜尋外觀無法與其他維度一併提供。因此,如要查看網站的搜尋外觀資訊,請按照下列程序操作:
- 指定「
searchAppearance
」做為唯一的維度,這會依搜尋外觀類型將所有資料分組,而且沒有其他維度。
- 視需要執行第二次查詢,依照步驟 1 列出的其中一個搜尋外觀類型進行篩選,在查詢中加入任何所需維度 (網頁、國家/地區、查詢等)。
如要擷取多種搜尋外觀類型的資料,您必須針對步驟 1 列出的每個搜尋外觀類型執行第二個步驟。
第一個查詢:
取得網站上搜尋外觀類型的清單。
{
"startDate": "2018-05-01",
"endDate": "2018-05-31",
"type": "web",
"dimensions": [
"searchAppearance"
]
}
結果:
您的網站類型為 INSTANT_APP、AMP_BLUE_LINK 等。
"rows": [
{
"keys": [
"INSTANT_APP"
],
"clicks": 443024.0,
"impressions": 4109826.0,
"ctr": 0.10779629113251997,
"position": 1.088168452873674
},
{
"keys": [
"AMP_BLUE_LINK"
],
"clicks": 429887.0,
"impressions": 1.7090884E7,
"ctr": 0.025152999692701676,
"position": 7.313451603790653
},...
第二項查詢:
您可以按照步驟 1 提供的其中一種搜尋外觀類型進行篩選,並視需要篩選任何維度 (網頁、裝置等)。我們是根據 AMP_BLUE_LINK 進行篩選。
{
"startDate": "2018-05-01",
"endDate": "2018-05-31",
"type": "web",
"dimensions": [
"device" // and/or page, country, ...
],
"dimensionFilterGroups": [
{
"filters": [
{
"dimension": "searchAppearance",
"operator": "equals",
"expression": "AMP_BLUE_LINK"
}
]
}
]
}
結果:
AMP_BLUE_LINK 細目,依裝置類型顯示。
"rows": [
{
"keys": [
"MOBILE"
],
"clicks": 429887.0,
"impressions": 1.7090783E7,
"ctr": 0.025153148337323107,
"position": 7.31339517914422
},
{
"keys": [
"DESKTOP"
],
"clicks": 0.0,
"impressions": 66.0,
"ctr": 0.0,
"position": 12.257575757575758
},
...
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-07-23 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-07-23 (世界標準時間)。"],[[["\u003cp\u003eQuery performance data daily for one day's worth of data to avoid exceeding quota and retrieve data for web, image, or video searches.\u003c/p\u003e\n"],["\u003cp\u003eChoose to group results by page or property, understanding that grouping by page with page/query dimensions may result in some data loss.\u003c/p\u003e\n"],["\u003cp\u003eSearch appearance data requires a two-step query process, first identifying search appearance types and then filtering by a specific type for detailed analysis.\u003c/p\u003e\n"],["\u003cp\u003eWhen grouping by page or property, metrics like impressions, clicks, and position are calculated differently, impacting the interpretation of results.\u003c/p\u003e\n"],["\u003cp\u003eTo retrieve comprehensive data, paginate through results by increasing the \u003ccode\u003estartRow\u003c/code\u003e value in subsequent queries until all rows are retrieved.\u003c/p\u003e\n"]]],["To retrieve performance data, run daily queries for one day's data, specifying search types (web, image, etc.) and dimensions (page, query, country, device). Choose to group by page or property. For detailed data (page/query), some data loss may occur. Page through results by incrementing `startRow`. To obtain search appearance data, first query for search appearance types, then query again, filtering by a specific type and desired dimensions. Daily queries must stay under 50K rows per search type.\n"],null,["# Getting your performance data\n\nYou can query your performance data quickly, and without exceeding your quota, by\nrunning a daily query for one day's worth of data.\n\nYou must choose what information you want in your data: which search types (web, image, video, etc.)\nand which dimensions (page, query, country, or device), as well as whether to\n[group results by page\nor property](https://support.google.com/webmasters/answer/7576553#urlorsite). When querying for page and/or query string, some data may be dropped ([*here's why*](#lose_data)).\n\nOverview\n--------\n\n1. We recommend running a query each day for one day's worth of data using one of the [query\n styles described below](#queries). Running a daily query for one day of data should not exceed your daily quota. Data is typically available after 2-3 days; you can learn what is the most recently available data by running a [simple query grouped by date](/webmaster-tools/v1/how-tos/search_analytics#verify--the-presence-of-data) for the past 10 days. In writing your query:\n - Choose whether to group results by page or property.\n - Choose whether you want more complete counts or more dimensions in your query. **Note:** search appearance data (AMP, blue link, rich result, and so on) must be queried using a [two-step process](#search-appearance-data).\n2. Page through results by re-running the same query, increasing the `startRow` value by 25,000 in the request until you reach the last page (a response with 0 rows).\n3. Optionally run the same query with another `type` parameter.\n\nHere is a pseudocode example for a single query. You can run this once per day [for each `type` value](/webmaster-tools/v1/searchanalytics/query#type) that you want data for. \n\n```carbon\nint maxRows = 25000; // Current max response size\nint i = 0;\ndo {\n response = Request(startDate = 3_days_ago,\n endDate = 3_days_ago,\n ... add dimensions, type ...\n rowLimit = maxRows,\n startRow = i * maxRows);\n i++;\n ... // Do something with the response data.\n} while (response.rows.count() != 0); // Page through all result rows\n```\n\nData limits\n-----------\n\nIn addition to [API usage quota, the Search Analytics method](/webmaster-tools/limits)\nexposes a maximum of 50K rows of data per day per search type (web, image, and so on--sorted\nby clicks).\n\nQuery details\n-------------\n\nYou can query data grouped by [page](#by_page) or [property](#by-property).\n\n### Grouped by page\n\n**For accurate counts,** you must omit the page and query dimensions, like this: \n\n```carbon\n\"startDate\": \"2018-06-01\",\n\"endDate\": \"2018-06-01\",\n\"dimensions\": [\"country\", \"device\"],\n\"type\": \"web\",\n\"aggregationType\": \"byPage\"\n```\n\n- `startDate` / `endDate`: Choose a one-day window by selecting the same date.\n- `dimensions`: Optionally include `country` and/or `device`.\n- `type`: Enumerate over [each `type` value](/webmaster-tools/v1/searchanalytics/query#type) as desired in a separate query.\n- `aggregationType`: Must be `byPage`.\n\n**For greater detail, including page and/or query information**, at the expense of losing some data, run a query like this: \n\n```carbon\n\"startDate\": \"2018-06-01\",\n\"endDate\": \"2018-06-01\",\n\"dimensions\": [\"page\", \"query\", \"country\", \"device\"],\n\"type\": \"web\"\n```\n\n- `startDate` / `endDate`: Choose a one-day window by selecting the same date.\n- `dimensions`: Include `page`. Optionally include any combination of `query`, `country`, or `device`.\n- `type`: Enumerate over [each `type` value](/webmaster-tools/v1/searchanalytics/query#type) as desired in a separate query.\n\n### Grouped by property\n\n**For accurate counts,** you must omit the page and query dimensions, like this: \n\n```carbon\n\"startDate\": \"2018-06-01\",\n\"endDate\": \"2018-06-01\",\n\"dimensions\": [\"country\", \"device\"],\n\"type\": \"web\"\n```\n\n- `startDate` / `endDate`: Choose a one-day window by selecting the same date.\n- `dimensions`: Optionally include `country` and/or `device`.\n- `type`: Optionally enumerate over [each `type` value](/webmaster-tools/v1/searchanalytics/query#type) as desired in a separate query.\n\n**For greater detail, including query, country, and/or device information**, at the expense of losing some data, run a query like this: \n\n```carbon\n\"startDate\": \"2018-06-01\",\n\"endDate\": \"2018-06-01\",\n\"dimensions\": [\"query\", \"country\", \"device\"],\n\"type\": \"web\"\n```\n\n- `startDate` / `endDate`: Choose a one-day window by selecting the same date.\n- `dimensions`: Optionally include any combination of `query`, `country`, or `device`.\n- `type`: Enumerate over [each `type` value](/webmaster-tools/v1/searchanalytics/query#type) as desired in a separate query.\n\nGrouping results by page or property\n------------------------------------\n\nImpressions, clicks, position, and click-through-rate are are calculated differently when grouping results by page rather than by property. [Learn more.](https://support.google.com/webmasters/answer/7576553#urlorsite)\n\nWhy do I lose data when asking for more detail?\n-----------------------------------------------\n\nWhen you group by page and/or query, our system may drop some data in order to be able to calculate results in a reasonable time using a reasonable amount of computing resources.\n\nGetting search appearance data\n------------------------------\n\nSearch appearance is not available as a column along with any other dimensions. Therefore, if you want to see search appearance information for your site, you must follow this process:\n\n1. Specify `searchAppearance` as the only dimension, which will group all data by search appearance type with no other dimensions.\n2. Optionally run a second query, filtering by one of the search appearance types listed in step 1, adding any desired dimensions to the query (page, country, query, etc).\n\nTo retrieve data about multiple search appearance types, you must run the second step once per search appearance type listed step 1.\n\n**First query:**\n\nGet list of search appearance types on your site. \n\n```carbon\n{\n \"startDate\": \"2018-05-01\",\n \"endDate\": \"2018-05-31\",\n \"type\": \"web\",\n \"dimensions\": [\n \"searchAppearance\"\n ]\n}\n```\n\n**Results:**\n\nYour site has type INSTANT_APP, AMP_BLUE_LINK, and so on. \n\n```scdoc\n \"rows\": [\n {\n \"keys\": [\n \"INSTANT_APP\"\n ],\n \"clicks\": 443024.0,\n \"impressions\": 4109826.0,\n \"ctr\": 0.10779629113251997,\n \"position\": 1.088168452873674\n },\n {\n \"keys\": [\n \"AMP_BLUE_LINK\"\n ],\n \"clicks\": 429887.0,\n \"impressions\": 1.7090884E7,\n \"ctr\": 0.025152999692701676,\n \"position\": 7.313451603790653\n },...\n```\n\n**Second query:**\n\nFilter by one of the search appearance types found in step 1, along with any dimensions that you like (page, device, etc). Here we filter by AMP_BLUE_LINK. \n\n```carbon\n{\n \"startDate\": \"2018-05-01\",\n \"endDate\": \"2018-05-31\",\n \"type\": \"web\",\n \"dimensions\": [\n \"device\" // and/or page, country, ...\n ],\n \"dimensionFilterGroups\": [\n {\n \"filters\": [\n {\n \"dimension\": \"searchAppearance\",\n \"operator\": \"equals\",\n \"expression\": \"AMP_BLUE_LINK\"\n }\n ]\n }\n ]\n}\n```\n\n**Results:**\n\nBreakdown of AMP_BLUE_LINK by device types. \n\n```text\n\"rows\": [\n {\n \"keys\": [\n \"MOBILE\"\n ],\n \"clicks\": 429887.0,\n \"impressions\": 1.7090783E7,\n \"ctr\": 0.025153148337323107,\n \"position\": 7.31339517914422\n },\n {\n \"keys\": [\n \"DESKTOP\"\n ],\n \"clicks\": 0.0,\n \"impressions\": 66.0,\n \"ctr\": 0.0,\n \"position\": 12.257575757575758\n },\n...\n```"]]