ビジネスの分析情報を取得する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このチュートリアルでは、ビジネス プロフィールでビジネス指標を取得する方法について説明します。
Google My Business API には、次のタイプのデータを取得するためのビジネス指標が用意されています。
始める前に
Google My Business API を使用するには、事前にアプリケーションを登録して、OAuth 2.0 の認証情報を取得する必要があります。 Google My Business API の使用方法について詳しくは、基本設定をご覧ください。
サポートされている分析情報
サポートされている分析情報については、Metric のリファレンス ページを参照してください。
基本的な分析情報
指定したビジネスの一覧の基本的な分析情報を取得できます。accounts.locations.reportInsights
API を使用すると、特定のビジネスに関連付けられている分析情報が返されます。
ビジネスに関連付けられた基本的な分析情報を返すには、次のように記述します。
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights
{
"locationNames": [
"accounts/{accountId}/locations/{locationId}"
],
"basicRequest": {
"metricRequests": [
{
"metric": "QUERIES_DIRECT"
},
{
"metric": "QUERIES_INDIRECT"
}
],
"timeRange": {
"startTime": "2016-10-12T01:01:23.045123456Z",
"endTime": "2017-01-10T23:59:59.045123456Z"
}
}
}
運転ルート
指定したビジネスの一覧に関係する運転ルートの指標を取得します。accounts.locations.reportInsights
API を使用すると、特定のビジネスに関連付けられている運転ルートの指標が返されます。
運転ルートの指標を返すには、次のように記述します。
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights
{
"locationNames": [
"accounts/{accountId}/locations/{locationId}"
],
"drivingDirectionsRequest": {
"numDays": "NINETY"
}
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-27 UTC。
[[["わかりやすい","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-11-27 UTC。"],[[["This tutorial demonstrates how to retrieve location metrics, such as basic insights and driving directions, using the Google My Business API."],["Before using the API, you'll need to register your application and obtain OAuth 2.0 credentials as outlined in the basic setup guide."],["You can retrieve basic insights like direct and indirect queries for specific locations within a defined timeframe using the `accounts.locations.reportInsights` API."],["Driving direction metrics, including data for the past 90 days, can also be retrieved using the `accounts.locations.reportInsights` API with a driving directions request."],["Refer to the Metric reference page for a comprehensive list of supported insights available through the Google My Business API."]]],[]]