リアルタイムのディメンションと指標
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Analytics Data API のリアルタイム メソッドのクエリでサポートされているディメンションと指標。コア レポート メソッド(RunReport
など)では、リアルタイム メソッドとは異なるディメンションと指標のセットが使用されます。
ディメンション
次のディメンションは、どのプロパティのレポートでもリクエストできます。レポート レスポンスのディメンションの列の Dimension
リソースの name
フィールドで「API 名」を指定します。
API 名 |
UI 名 |
説明 |
appVersion |
アプリのバージョン |
アプリの versionName(Android の場合)または short bundle version(iOS の場合)。 |
audienceId |
オーディエンス ID |
オーディエンスの数値 ID。ユーザーは、レポートの期間中に属していたオーディエンスにレポートされます。現在のユーザーの行動によって、レポート済みのオーディエンスから変更されることはありません。 |
audienceName |
オーディエンス名 |
オーディエンスに指定した名前。ユーザーは、レポートの期間中に属していたオーディエンスにレポートされます。現在のユーザーの行動によって、レポート済みのオーディエンスから変更されることはありません。 |
audienceResourceName |
オーディエンス リソース名 |
このオーディエンスのリソース名。リソース名には、リソースを一意に識別するためのコレクションとリソースの両方の識別子が含まれています。詳細については、リソース名をご覧ください。 |
city |
市区町村 |
ユーザー アクションが発生した都市です。 |
cityId |
都市 ID |
ユーザー アクションが発生した都市の地域 ID。ユーザーの IP アドレスから取得されます。 |
country |
国 |
ユーザー アクションが発生した国です。 |
countryId |
国 ID |
ユーザー アクションが発生した国の地理 ID。ユーザーの IP アドレスから取得されます。ISO 3166-1 alpha-2 標準の形式を使用します。 |
deviceCategory |
デバイス カテゴリ |
端末の種類(パソコン、タブレット、またはモバイル)です。 |
eventName |
イベント名 |
イベントの名前。 |
minutesAgo |
リアルタイムの経過分数 |
イベントが収集された時刻から経過した分数。00 は現在の分、01 は前の分を意味します。 |
platform |
プラットフォーム |
アプリまたはウェブサイトが実行されたプラットフォームです(ウェブ、iOS、Android など)。レポートでストリームのタイプを特定するには、プラットフォームと streamId の両方を使用します。 |
streamId |
ストリーム ID |
アプリまたはウェブサイトの数値データ ストリーム識別子。 |
streamName |
ストリーム名 |
アプリまたはウェブサイトのデータ ストリーム名。 |
unifiedScreenName |
ページタイトルとスクリーン名 |
イベントが記録されたページのタイトル(ウェブ)またはスクリーン名(アプリ)。 |
カスタム ディメンション
Realtime Data API では、ユーザー スコープのカスタム ディメンションに関するレポートを作成できます。カスタム ディメンションについて詳しくは、カスタム ユーザー プロパティをご覧ください。カスタム ディメンションは、ディメンションのパラメータ名とスコープによって API レポート リクエストで指定されます。たとえば、"customUser:last_level"
を Data API リクエストに含めて、パラメータ名 "last_level"
のユーザー スコープのカスタム ディメンションのレポートを作成します。プロパティでこのユーザー スコープのカスタム ディメンションが登録されていない場合、この API リクエストは失敗します。
カスタム ディメンションの一般的な構文は次のとおりです。Metadata API メソッドにクエリを実行して、プロパティのすべてのカスタム ディメンションを一覧表示できます。
汎用 API 名 |
説明 |
customUser:parameter_name |
parameter_name のユーザー スコープのカスタム ディメンション。 |
イベント スコープのカスタム ディメンションは、Realtime API ではサポートされていません。
指標
次の指標は、どのプロパティのレポートでもリクエストできます。レポート レスポンスの指標の列について、Metric
リソースの name
フィールドで「API 名」を指定します。
API 名 |
UI 名 |
説明 |
activeUsers |
アクティブ ユーザー数 |
サイトまたはアプリにアクセスした個別のユーザーの数。 |
eventCount |
イベント数 |
イベントの数。 |
keyEvents |
キーイベント |
キーイベントの数。イベントにキーイベントとしてマークを付けると、作成時点以降のレポートに反映されますが、過去のデータは変更されません。Google アナリティクスでは、任意のイベントをキーとしてマークできますが、一部のイベント(first_open や purchase など)はデフォルトでキーイベントとしてマークされています。 |
screenPageViews |
視聴回数 |
ユーザーが閲覧したアプリの画面またはウェブページの数。同じページやスクリーンが繰り返し表示された場合も集計されます(計算方法: screen_view イベント数 + page_view イベント数)。 |
イベント スコープのカスタム指標は Realtime API ではサポートされていません。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-29 UTC。
[null,null,["最終更新日 2025-07-29 UTC。"],[[["\u003cp\u003eThe Realtime reporting method of the Analytics Data API allows you to query specific dimensions and metrics to analyze real-time user behavior on your app or website.\u003c/p\u003e\n"],["\u003cp\u003eSupported dimensions include user demographics (like city and country), device information, app version, audience data, event details, and user-scoped custom dimensions.\u003c/p\u003e\n"],["\u003cp\u003eYou can use metrics like \u003ccode\u003eactiveUsers\u003c/code\u003e, \u003ccode\u003eeventCount\u003c/code\u003e, \u003ccode\u003escreenPageViews\u003c/code\u003e, and \u003ccode\u003ekeyEvents\u003c/code\u003e to understand real-time user engagement.\u003c/p\u003e\n"],["\u003cp\u003eUnlike Core Reporting methods, the Realtime method uses a different set of dimensions and metrics and doesn't support event-scoped custom dimensions or metrics.\u003c/p\u003e\n"]]],["The Realtime Analytics Data API supports specific dimensions and metrics for querying. Dimensions include `appVersion`, `audienceId/Name/ResourceName`, geographic data (`city/Id`, `country/Id`), `deviceCategory`, `eventName`, `minutesAgo`, `platform`, `streamId/Name`, and `unifiedScreenName`. User-scoped custom dimensions are supported using the `customUser:parameter_name` format. Supported metrics are `activeUsers`, `eventCount`, `keyEvents`, and `screenPageViews`. Event-scoped custom dimensions and metrics are not supported in the Realtime API.\n"],null,["# Realtime Dimensions & Metrics\n\nThe dimensions and metrics supported in queries to the [Realtime method](/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runRealtimeReport) of the Analytics Data API. The\nCore Reporting methods ([`RunReport`](/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runReport)\nfor example) accept a different set of [Dimensions \\& Metrics](/analytics/devguides/reporting/data/v1/api-schema)\nthan the Realtime method.\n\nDimensions\n----------\n\nThe following dimensions can be requested in reports for any property. Specify\nthe \"API Name\" in a [`Dimension`](/analytics/devguides/reporting/data/v1/rest/v1beta/Dimension) resource's `name`\nfield for a column of the dimension in the report response.\n\n| API Name | UI Name | Description |\n|------------------------|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `appVersion` | App version | The app's versionName (Android) or short bundle version (iOS). |\n| `audienceId` | Audience ID | The numeric identifier of an Audience. Users are reported in the audiences to which they belonged during the report's date range. Current user behavior does not affect historical audience membership in reports. |\n| `audienceName` | Audience name | The given name of an Audience. Users are reported in the audiences to which they belonged during the report's date range. Current user behavior does not affect historical audience membership in reports. |\n| `audienceResourceName` | Audience resource name | The resource name of this audience. Resource names contain both collection \\& resource identifiers to uniquely identify a resource; to learn more, see [Resource names](//google.aip.dev/122). |\n| `city` | City | The city from which the user activity originated. |\n| `cityId` | City ID | The geographic ID of the city from which the user activity originated, derived from their IP address. |\n| `country` | Country | The country from which the user activity originated. |\n| `countryId` | Country ID | The geographic ID of the country from which the user activity originated, derived from their IP address. Formatted according to ISO 3166-1 alpha-2 standard. |\n| `deviceCategory` | Device category | The type of device: Desktop, Tablet, or Mobile. |\n| `eventName` | Event name | The name of the event. |\n| `minutesAgo` | Realtime minutes ago | The number of minutes ago that an event was collected. 00 is the current minute, and 01 means the previous minute. |\n| `platform` | Platform | The platform on which your app or website ran; for example, web, iOS, or Android. To determine a stream's type in a report, use both platform and streamId. |\n| `streamId` | Stream ID | The numeric data stream identifier for your app or website. |\n| `streamName` | Stream name | The data stream name for your app or website. |\n| `unifiedScreenName` | Page title and screen name | The page title (web) or screen name (app) on which the event was logged. |\n\n### Custom Dimensions\n\nThe Realtime Data API can create reports on User scoped Custom Dimensions. See\n[Custom user properties](//support.google.com/analytics/answer/9269570) to learn\nmore about custom dimensions. Custom dimensions are specified in an API report\nrequest by the dimension's parameter name and scope. For example, include\n`\"customUser:last_level\"` in a Data API request to create a report for the\nUser-scoped Custom Dimension with parameter name `\"last_level\"`. This API\nrequest will fail if the property has not registered this User-scoped Custom\nDimension.\n\nThe following are the general syntax for Custom Dimensions. You can query the\n[Metadata API method](/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata) to list all\nCustom Dimensions for a Property.\n\n| Generic API Name | Description |\n|-----------------------------|----------------------------------------------------|\n| `customUser:parameter_name` | User-scoped Custom Dimension for `parameter_name`. |\n\nEvent-scoped custom dimensions aren't supported in the Realtime API.\n\nMetrics\n-------\n\nThe following metrics can be requested in reports for any property. Specify the\n\"API Name\" in a [`Metric`](/analytics/devguides/reporting/data/v1/rest/v1beta/Metric) resource's `name` field for\na column of the metric in the report response.\n\n| API Name | UI Name | Description |\n|-------------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `activeUsers` | Active users | The number of distinct users who visited your site or app. |\n| `eventCount` | Event count | The count of events. |\n| `keyEvents` | Key events | The count of key events. Marking an event as a key event affects reports from time of creation. It doesn't change historic data. You can mark any event as key in Google Analytics, and some events (such as `first_open` or `purchase`) are marked as key events by default. |\n| `screenPageViews` | Views | The number of app screens or web pages your users viewed. Repeated views of a single page or screen are counted. (screen_view + page_view events). |\n\nEvent-scoped custom metrics aren't supported in the Realtime API."]]