コンテンツにスキップ

statistic

統計エンドポイントは、詳細なアプリと組織の分析データを提供します。月間有効ユーザー数(MAU)、ストレージ使用量、帯域幅消費量を、異なる時間間隔で追跡できます。このデータは、アプリの成長、リソース使用量、容量計画の監視に不可欠です。

  • 月間有効ユーザー数(MAU)アプリにアクセスしたユニークなデバイスの数 (30 日間)
  • ストレージバンドルとリソースの合計サイズ (バイト)
  • バンド幅バンド幅

ベスト プラクティス

ベスト プラクティス
  1. 定期的な監視リソース計画
  2. ユーザー エンゲージメントアプリにアクセスしたユニークなデバイスの数 (30 日間)
  3. ストレージ: ユーザー エンゲージメントの傾向を理解するために MAU を追跡します。
  4. コスト管理: コストの最適化を実現するためにリソース使用を監視します。

エンドポイント

「エンドポイント」

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)
}
ターミナル画面
curl -H "authorization: your-api-key" \
"https://api.capgo.app/statistics/app/com.demo.app/?from=2024-01-01&to=2024-02-01"
[
{
"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
}
]

特定の組織の統計を取得します。組織レベルの使用状況を監視するのに役立ちます。

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
}
]

あなたがアクセスできるすべての組織の統合統計を取得します。全体的な使用状況の監視に適しています。

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
}
]

特定のアプリのバンドル使用状況の統計を取得し、指定された期間内にユーザー間でバンドル(バージョン)の分布を表示します。

クエリパラメータ

クエリ パラメータ
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"
}
  1. 成長追跡: 時間の経過とともにMAUの成長を監視
  2. リソース最適化: ストレージとバンド幅の使用状況を追跡してコストを最適化
  3. 容量計画: 将来のリソースのニーズを計画するためにトレンドを使用
  4. 使用状況レポート: 利用者にレポートを周期的に生成
  5. バンドル(バージョン)配布分析: アプリのバンドル(バージョン)ごとのユーザー分布を理解する
  1. 期間の比較: 月間または年間のトレンドを確認する
  2. 比率の追跡: ユーザーごとの帯域幅またはアプリごとのストレージを監視する
  3. アラートの設定: 不思議な使用量の急増を検知するアラートを作成する
  4. 定期的なバックアップ: 統計を定期的にエクスポートして過去の分析を行う
  5. バンドル(バージョン)の採用: バンドル使用を使用して、バンドルの採用率を追跡する (バージョン)

Capgo を使用している場合 Statistics Capgo を使用して @capgo/capacitor-data-storage-sqlite @capgo/capacitor-data-storage-sqlite Capgo を使用して @capgo/capacitor-data-storage-sqlite を実装する際の詳細 Capgo を使用して @capgo/capacitor-data-storage-sqlite を使用する Capgo を使用して @capgo/capacitor-data-storage-sqlite のネイティブ機能を使用する @capgo/capacitor-file として使用する場合の実装詳細は @capgo/capacitor-file です Using @capgo/capacitor-file for the native capability in Using @capgo/capacitor-file, and @capgo/capacitor-uploader for the implementation detail in @capgo/capacitor-uploader.