statistic
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
統計情報エンドポイントは、詳細なアプリと組織の分析情報を提供します。アプリと組織の月間有効ユーザー数 (MAU)、ストレージ使用量、帯域幅消費量を、異なる時間間隔で追跡できます。このデータは、アプリの成長、リソース使用量、容量計画のために不可欠です。
メトリクスを理解する
「メトリクスを理解する」のセクション- MAU (月間有効ユーザー数): 最近 30 日間でアクセスしたユニークなデバイスの数
- Storage: バンドルとリソースの合計サイズ (バイト)
- Bandwidth: バンドルダウンロードの合計データ転送量 (バイト)
Best Practices
セクション: "Best Practices"- Regular Monitoring: 統計を定期的に確認して成長と利用パターンを追跡する
- Resource Planning: ストレージとバンド幅メトリクスを使用して容量計画
- User Engagement: __CAPGO_KEEP_0__をトラッキングしてユーザー エンゲージメントの傾向を理解する
- コスト管理: リソースの使用を監視してコストを最適化する
エンドポイント
セクション「エンドポイント」GET /statistics/app/:app_id/
セクション「GET /statistics/app/:app_id/」特定のアプリのパフォーマンスを監視するために役立つこのエンドポイントを使用して、アプリの統計を取得します。
クエリ パラメータ
セクション「クエリ パラメータ」interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}例:リクエスト
Section titled “サンプルリクエスト”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/app/com.demo.app/?from=2024-01-01&to=2024-02-01"サンプルレスポンス
Section titled “サンプルレスポンス”[ { "date": "2024-01-01", "mau": 1500, "storage": 536870912, // 512MB in bytes "bandwidth": 1073741824 // 1GB in bytes }, { "date": "2024-01-02", "mau": 1550, "storage": 537919488, // 513MB in bytes "bandwidth": 1074790400 // 1.01GB in bytes }]GET /statistics/org/:org_id/
Section titled “GET /statistics/org/:org_id/”特定の組織の統計を取得します。組織レベルの使用状況を監視するのに役立ちます。
クエリパラメータ
Section titled “クエリパラメータ”interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD) breakdown: boolean // default false, optional if true it return the breakdown by app noAccumulate: boolean // default false, optional if true it will not accumulate data and just return day by day result}Example Request
Section titled “Example Request”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/org/046a36ac-e03c-4590-9257-bd6c9dba9ee8/?from=2024-01-01&to=2024-02-01"Example Response
Section titled “Example Response”[ { "date": "2024-01-01", "mau": 10000, "storage": 536870912, // 512MB in bytes "bandwidth": 1073741824 // 1GB in bytes }, { "date": "2024-01-02", "mau": 10200, "storage": 537919488, // 513MB in bytes "bandwidth": 1074790400 // 1.01GB in bytes }]GET /statistics/user/
Section titled “GET /statistics/user/”Get aggregated statistics across all organizations you have access to. Perfect for overall usage monitoring.
Query Parameters
Section titled “Query Parameters”interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}例のリクエスト
「例のリクエスト」のセクションcurl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/user/?from=2024-01-01&to=2024-02-01"例のレスポンス
「例のレスポンス」のセクション[ { "date": "2024-01-01", "mau": 25000, "storage": 1073741824, // 1GB in bytes "bandwidth": 2147483648 // 2GB in bytes }, { "date": "2024-01-02", "mau": 25500, "storage": 1074790400, // 1.01GB in bytes "bandwidth": 2148532224 // 2.01GB in bytes }]GET /statistics/app/:app_id/bundle_usage
「GET /statistics/app/:app_id/bundle_usage」のセクション特定のアプリのバンドル使用状況の統計を取得し、指定された期間内にユーザー間でバンドル(バージョン)の分布を表示します。
クエリパラメータ
クエリ パラメータinterface BundleUsageQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}リクエスト例
リクエスト例curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/app/com.demo.app/bundle_usage?from=2024-01-01&to=2024-02-01"レスポンス例
レスポンス例{ "labels": ["2024-01-01", "2024-01-02", "2024-01-03"], "datasets": [ { "label": "1.0.0", "data": [60.5, 58.2, 55.3] }, { "label": "1.0.1", "data": [39.5, 41.8, 44.7] } ]}エラー処理
エラー処理一般的なエラーシナリオとそのレスポンス:
// Invalid body{ "status": "Invalid body", "error": "Invalid date format or missing parameters"}
// Permission denied{ "status": "You can't access this app", "error": "Insufficient permissions to access statistics"}
// Permission denied for organization{ "status": "You can't access this organization", "error": "Insufficient permissions to access organization statistics"}
// No organizations found for user statistics{ "status": "No organizations found", "error": "No organizations found"}
// Internal server error{ "status": "Cannot get app statistics", "error": "Internal server error message"}一般的な使用例
「一般的な使用例」のセクション- 成長の追跡: 時間の経過とともにMAUの成長を監視
- リソースの最適化: 費用の最適化のためにストレージとバンド幅の使用を追跡
- 容量の計画: 将来のリソースの必要性を計画するためにトレンドを使用
- 使用状況のレポート: 利害関係者向けに定期的な使用状況のレポートを生成
- バンドル(バージョン)の配布分析: __CAPGO_KEEP_0__を使用したさまざまなアプリパッケージ (バージョン) のユーザー分布を理解するためのバンドル使用統計
分析のヒント
「分析のヒント」セクション- 期間の比較: 月間または年間のトレンドを確認する
- 比率の追跡: ユーザーごとの帯域幅またはアプリごとのストレージを監視する
- アラートの設定: 不思議な使用量の急増に警告する
- 定期的なバックアップ: 歴史分析のために統計を定期的にエクスポートする
- バンドル (バージョン) の採用: バンドルの使用状況を使用して、バンドルの新しいバージョンの採用率を追跡する
Keep going from Statistics
Statisticsから続けるSection titled “Statisticsから続ける” Capgoを使用している場合 Statistics Capgoを使用してストレージとファイルの管理を計画する場合、@capgo/capacitor-data-storage-sqliteと接続する @capgo/capacitor-data-storage-sqliteの実装詳細については@capgo/capacitor-data-storage-sqliteを参照してください @capgo/capacitor-data-storage-sqliteを使用 @capgo/capacitor-data-storage-sqliteのネイティブ機能を使用する @capgo/capacitor-file @capgo/capacitor-fileの実装詳細については@capgo/capacitor-fileを参照してください @capgo/capacitorファイルを使用して native capabilityを使用して@capgo/capacitorファイルを使用し @capgo/capacitorアップローダー @capgo/capacitorアップローダーの実装詳細を使用して