statistic
このプラグインのインストール手順とマークダウンガイドをコピーする
アプリや組織の詳細な分析データを提供する統計エンドポイントです。月間有効ユーザー数(MAU)、ストレージ使用量、バンド幅消費量を異なる時間間隔で追跡できます。このデータは、アプリの成長、リソース使用量、容量計画のために不可欠です。
メトリクスを理解する
「メトリクスを理解する」のセクション- 月間有効ユーザー数(MAU)アプリにアクセスしたユニークなデバイスの数 (30 日間)
- ストレージバンドルとリソースの合計サイズ (バイト)
- バンド幅バンドルダウンロードの合計データ転送量 (バイト)
ベスト プラクティス
ベスト プラクティス- 定期的な監視リソース計画
- ユーザー エンゲージメントアプリの成長と使用パターンを追跡するために、定期的に統計を確認すること
- ストレージとバンド幅のメトリックを使用して容量計画を行うこと: __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/””組織の特定の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}例のリクエスト
「例のリクエスト」のセクション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"例のレスポンス
「例のレスポンス」のセクション[ { "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/
「GET /statistics/user/」のセクションあなたがアクセスできるすべての組織の間で集計された統計を取得します。全体的な使用状況の監視に適しています。
クエリパラメータ
「クエリパラメータ」のセクション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の成長を監視
- リソース最適化: 費用を最適化するためにストレージとバンド幅の使用を追跡
- 容量計画: 将来のリソースのニーズを計画するためにトレンドを使用
- 使用状況レポート: ステークホルダー向けに定期的な使用状況レポートを生成
- バンドル(バージョン)配布分析: アプリのバンドル(バージョン)間のユーザー分布を理解するためのバンドル使用統計
分析のためのヒント
「分析のためのヒント」のセクション- 期間の比較: 月間または年間のトレンドを確認する
- 比率の追跡: ユーザーあたりのバンド幅またはアプリあたりのストレージを監視する
- アラートの設定: 使用率の異常なスパイクを監視するためのアラートを作成する
- 定期的なバックアップ: 統計を定期的にエクスポートして、過去の分析に使用する
- バンドル(バージョン)の採用: バンドル使用状況を使用して、バンドルの採用率を追跡する (バージョン)
Statistics から続けて
Section titled “Statistics から続けて”Capgo を使用している場合 Statistics Capgo を使用して データストレージとファイルハンドリングの計画に利用する場合、@capgo/capacitor-data-storage-sqlite に接続してください。 Capgo を使用してデータストレージとファイルハンドリングの計画に利用する場合、@capgo/capacitor-data-storage-sqlite の実装詳細を参照してください。 @capgo/capacitor-data-storage-sqlite を使用して Capgo を使用してデータストレージとファイルハンドリングの計画に利用する場合、@capgo/capacitor-data-storage-sqlite のネイティブ機能を使用してください。 @capgo/capacitor-file Capgo を使用してデータストレージとファイルハンドリングの計画に利用する場合、@capgo/capacitor-file の実装詳細を参照してください。 Using @capgo/capacitorファイル for the native capability in Using @capgo/capacitorファイル、そして @capgo/capacitorアップローダー for the implementation detail in @capgo/capacitorアップローダー。