통계
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Statistics API 엔드포인트를 통해 앱과 조직에 대한 상세한 분석 데이터를 확인할 수 있습니다. 월간 활성 사용자 수(MAU), 스토리지 사용량, 대역폭 사용량을 여러 기간에 걸쳐 추적할 수 있습니다. 이 데이터는 앱 성장과 리소스 사용량을 모니터링하고 용량을 계획하는 데 필수적입니다.
메트릭 이해하기
“메트릭 이해하기” 섹션- MAU(월간 활성 사용자): 지난 30일 동안 앱에 접속한 고유 디바이스 수
- 스토리지: 저장된 모든 bundle과 리소스의 총 크기(byte 단위)
- 대역폭: bundle 다운로드에 사용된 총 데이터 전송량(byte 단위)
모범 사례
“권장 사항” 섹션- 정기 모니터링: 통계 데이터를 주기적으로 확인하여 성장세와 사용 패턴을 파악하세요
- 리소스 계획: 스토리지 및 대역폭 지표를 활용해 용량 계획을 세우세요
- 사용자 참여도: MAU를 추적하여 사용자 참여 트렌드를 이해하세요
- 비용 관리: 리소스 사용량을 모니터링하여 비용을 최적화하세요
엔드포인트
“엔드포인트” 섹션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)}요청 예시
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"[ { "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/” 섹션특정 조직의 통계 데이터를 가져옵니다. 조직 단위의 사용량을 모니터링할 때 유용합니다.
쿼리 파라미터
“쿼리 파라미터” 섹션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 섹션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)}요청 예시
Example Request 섹션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)}요청 예시
Example Request 섹션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] } ]}에러 핸들링
“Error Handling” 섹션모든 에러는 다음에 설명된 표준 에러 형식을 사용합니다 API 개요.
일반적인 에러 시나리오와 응답:
// The API key cannot read this app (HTTP 401){ "error": "no_access_to_app", "message": "No access to app", "moreInfo": { "data": "6aa76066-55ef-4238-ade6-0b32334a4097" }}
// The API key cannot read this organization (HTTP 401){ "error": "no_access_to_organization", "message": "No access to organization", "moreInfo": { "data": "6aa76066-55ef-4238-ade6-0b32334a4097" }}
// Organization statistics require an active plan (HTTP 402){ "error": "subscription_required", "message": "Organization subscription required or plan invalid", "moreInfo": { "orgId": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "isPayingAndGoodPlan": false }}
// User statistics when the user belongs to no organization (HTTP 401){ "error": "no_organizations_found", "message": "No organizations found", "moreInfo": { "data": "6aa76066-55ef-4238-ade6-0b32334a4097" }}주요 사용 사례
“일반적인 사용 사례” 섹션- 성장 추적: MAU 성장 추이 모니터링
- 리소스 최적화: 비용 최적화를 위한 스토리지 및 대역폭 사용량 추적
- 용량 계획: 트렌드 분석을 통한 향후 리소스 수요 계획
- 사용량 보고서: 이해관계자를 위한 정기 사용량 보고서 생성
- Bundle (버전) 분포 분석: Bundle 사용 통계를 통해 앱 Bundle(버전)별 사용자 분포 파악
분석 팁
“분석 팁” 섹션- 기간 비교: 전월 대비 또는 전년 대비 트렌드 확인
- 비율 추적: 사용자당 대역폭 또는 앱당 스토리지 모니터링
- 알림 설정: 사용량 급증 시 알림 생성
- 정기 백업: 과거 데이터 분석을 위해 통계 데이터 정기적 내보내기
- Bundle (버전) 채택률: Bundle 사용량을 통해 새 Bundle(버전)의 채택률 추적
통계에서 계속 이어가기
“Statistics 다음 단계” 섹션사용 중이라면 통계 저장 공간과 파일 처리를 계획하려면, 다음 항목과 연결하세요 @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-file 사용 시 네이티브 기능에 대해서는, 그리고 @capgo/capacitor-uploader @capgo/capacitor-uploader.의 구현 세부 사항에 대해서는