統計
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップの質問をコピーします。
The Statistics endpoints provide detailed analytics about your apps and organizations. You can track Monthly Active Users (MAU), storage usage, and bandwidth consumption across different time periods. This data is essential for monitoring app growth, resource usage, and planning capacity.
Understanding the Metrics
Section titled “Understanding the Metrics”- MAU (Monthly Active Users):アプリにアクセスしたユニークなデバイスの数(過去30日間)
- Storage:すべてのバンドルとリソースの合計サイズ(バイト)
- Bandwidth:バンドルダウンロードの合計データ転送量(バイト)
Best Practices
Section titled “Best Practices”- Regular Monitoring: __CAPGO_KEEP_0__を定期的に確認して成長と使用パターンを追跡する
- Resource Planning: ストレージとバンド幅のメトリクスを使用して容量計画を行う
- User Engagement: MAUを使用してユーザー エンゲージメントのトレンドを理解する
- Cost Management: リソースの使用を監視してコストを最適化する
Endpoints
Section titled “Endpoints”: __CAPGO_KEEP_0__/statistics/app/:app_id/
Section titled “GET /statistics/app/:app_id/”特定アプリの統計を取得します。このエンドポイントは、個々のアプリのパフォーマンスを監視するのに役立ちます。
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)}Example Request
Section titled “Example Request”curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/app/com.demo.app/?from=2024-01-01&to=2024-02-01"Example Response
Section titled “Example Response”[ { "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/
GET /statistics/org/:org_id/組織の特定のIDを持つ組織の統計を取得します。組織レベルの使用状況を監視するのに役立ちます。
Query Parameters
Query Parametersinterface 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
ターミナル画面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"Section titled “GET /statistics/org/:org_id/”
Section titled “Query Parameters”[ { "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/__CAPGO_KEEP_1__
__CAPGO_KEEP_2__
__CAPGO_KEEP_3__interface StatsQuery { from: Date // Start date for the statistics (format: YYYY-MM-DD) to: Date // End date for the statistics (format: YYYY-MM-DD)}GET /statistics/user/
__CAPGO_KEEP_4__curl -H "authorization: your-api-key" \ "https://api.capgo.app/statistics/user/?from=2024-01-01&to=2024-02-01"__CAPGO_KEEP_7__
例としての応答[ { "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
例としての応答特定のアプリのバンドル使用状況の統計を取得します。使用状況は、指定された期間内にユーザーが使用したバンドル(バージョン)の分布を示します。
クエリ パラメータ
コピー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の成長を監視する
- リソースの最適化: ストレージと帯域幅の使用状況をトラッキングしてコストを最適化する
- Capacity Planning: 将来のリソースのニーズを計画するためのトレンドを使用する
- Usage Reports: 利害関係者向けの定期的な使用状況レポートを生成する
- Bundle (version) Distribution Analysis: アプリケーション バンドル (バージョン) の使用状況統計とユーザー分布を理解する
Tips for Analysis
分析のためのアドバイス- Compare Periods: 月間または年間のトレンドを比較する
- Track Ratios: ユーザーごとの帯域幅またはアプリごとのストレージを監視する
- Set Alerts: 不通常の使用上昇に応じてアラートを設定する
- Regular Backups: 過去の分析のために統計を定期的にエクスポートする
- Bundle (version) Adoption: バンドルの使用を使用して新しいバンドル (バージョン) の採用率を追跡する
Keep going from Statistics
: 統計から続けるIf you are using Statistics を使用してストレージとファイルの管理を計画する場合、を接続する @capgo/capacitor-data-storage-sqlite @capgo/capacitor-data-storage-sqliteの実装詳細については Capgoで@capgo/capacitor-data-storage-sqliteを使用 Capgoのネイティブ機能として@capgo/capacitor-data-storage-sqliteを使用 @capgo/capacitor-file @capgo/capacitor-fileの実装詳細については Capgoで@capgo/capacitor-fileを使用 Capgoのネイティブ機能として@capgo/capacitor-fileを使用 Capgoで@capgo/capacitor-uploaderを使用 @capgo/capacitor-uploaderの実装詳細については