App Analytics
Stripe cung cấp analytics tích hợp cho các app marketplace đã xuất bản, giúp bạn có cái nhìn rõ ràng về lượt cài đặt, hiệu suất listing và mức độ tương tác của người dùng. Bạn cũng có thể xây dựng analytics tùy chỉnh bằng webhooks và Stripe API.
Báo Cáo Có Sẵn
Stripe Dashboard cung cấp các analytics sau cho app đã xuất bản của bạn:
Số Liệu Cài Đặt
| Số Liệu | Mô Tả |
|---|---|
| Installs | Tổng số lượt cài đặt app mới trong kỳ đã chọn |
| Uninstalls | Tổng số lượt gỡ cài đặt app trong kỳ đã chọn |
| Cumulative Net Installs | Tổng tích lũy số lượt cài đặt trừ gỡ cài đặt theo thời gian |
Hiệu Suất Listing
| Số Liệu | Mô Tả |
|---|---|
| Listing Views | Tổng số lượt xem trang listing marketplace của app |
| Unique Views | Khách truy cập duy nhất đã xem listing marketplace của bạn |
| MoM Conversion Rate | Tỷ lệ phần trăm tháng-qua-tháng của người xem listing cài đặt app |
Số Liệu Tăng Trưởng
| Số Liệu | Mô Tả |
|---|---|
| MoM Growth Rate | Tăng trưởng tháng-qua-tháng trong net installs |
| Churn Rate | Tỷ lệ phần trăm người dùng đã cài đặt gỡ cài đặt mỗi tháng |
Độ Mới Của Dữ Liệu
Caution
Dữ liệu analytics có độ trễ 48 giờ. Dữ liệu bạn thấy trong dashboard phản ánh hoạt động từ khoảng hai ngày trước. Lên kế hoạch cửa sổ báo cáo của bạn phù hợp.
- Dữ liệu được cập nhật hàng ngày với độ trễ xử lý 48 giờ
- Dữ liệu lịch sử có sẵn từ ngày app được xuất bản lần đầu
- Các số liệu được tính theo múi giờ UTC
- Xuất dữ liệu dưới dạng CSV từ Stripe Dashboard để phân tích bên ngoài
Truy Cập Analytics Qua API
Bạn có thể truy cập analytics app theo chương trình bằng Stripe Reporting API:
Dữ Liệu Cài Đặt
# Fetch app install reportcurl https://api.stripe.com/v1/reporting/report_runs \ -u sk_live_xxxxx: \ -d "report_type=app.installs.daily" \ -d "parameters[interval_start]=1709251200" \ -d "parameters[interval_end]=1711929600" \ -d "parameters[app_id]=com.tajo.brevo-integration"Lượt Xem Listing
# Fetch listing views reportcurl https://api.stripe.com/v1/reporting/report_runs \ -u sk_live_xxxxx: \ -d "report_type=app.listing_views.daily" \ -d "parameters[interval_start]=1709251200" \ -d "parameters[interval_end]=1711929600" \ -d "parameters[app_id]=com.tajo.brevo-integration"Truy Cập Theo Chương Trình (Node.js)
const stripe = require('stripe')('sk_live_xxxxx');
// Create a report run for app installsconst reportRun = await stripe.reporting.reportRuns.create({ report_type: 'app.installs.daily', parameters: { interval_start: Math.floor(new Date('2025-03-01').getTime() / 1000), interval_end: Math.floor(new Date('2025-03-31').getTime() / 1000), app_id: 'com.tajo.brevo-integration', },});
// Poll for report completionconst checkReport = async (reportId) => { const report = await stripe.reporting.reportRuns.retrieve(reportId);
if (report.status === 'succeeded') { // Download the report file const file = await stripe.files.retrieve(report.result.id); console.log('Report URL:', file.url); return file; }
if (report.status === 'failed') { throw new Error('Report generation failed'); }
// Report still processing return null;};Tab Users
Tab Users trong analytics của app hiển thị dữ liệu cấp tài khoản riêng lẻ:
| Cột | Mô Tả |
|---|---|
| Account ID | Tài khoản Stripe đã cài đặt app của bạn |
| Install Date | Thời điểm app được cài đặt |
| Status | Đang hoạt động hoặc đã gỡ cài đặt |
| Uninstall Date | Thời điểm app bị gỡ cài đặt (nếu có) |
Sử dụng dữ liệu này để:
- Theo dõi trạng thái kích hoạt tài khoản riêng lẻ
- Theo dõi các tài khoản đã cài đặt nhưng chưa hoàn thành onboarding
- Xác định các tài khoản đã gỡ cài đặt và hiểu nguyên nhân churn
- Tương quan dữ liệu cài đặt với analytics nền tảng của bạn
Analytics Tùy Chỉnh Với Webhooks
Để có analytics theo thời gian thực và thông tin sâu hơn, hãy thiết lập webhooks để theo dõi sự kiện app:
Sự Kiện Webhook
Lắng nghe các sự kiện này để xây dựng analytics tùy chỉnh:
| Sự Kiện | Mô Tả |
|---|---|
account.application.authorized | Người dùng đã cài đặt app của bạn |
account.application.deauthorized | Người dùng đã gỡ cài đặt app của bạn |
Webhook Handler
const express = require('express');const stripe = require('stripe')('sk_live_xxxxx');
const app = express();
app.post('/webhooks/stripe-app', express.raw({ type: 'application/json' }), async (req, res) => { const sig = req.headers['stripe-signature']; const webhookSecret = process.env.STRIPE_APP_WEBHOOK_SECRET;
let event;
try { event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret); } catch (err) { console.error('Webhook signature verification failed:', err.message); return res.status(400).send('Webhook signature verification failed'); }
switch (event.type) { case 'account.application.authorized': { const account = event.data.object; console.log('App installed by:', account.id);
// Track in your analytics system await trackEvent('app_installed', { account_id: account.id, timestamp: new Date(event.created * 1000), });
// Trigger onboarding email await sendOnboardingEmail(account.id); break; }
case 'account.application.deauthorized': { const account = event.data.object; console.log('App uninstalled by:', account.id);
// Track churn await trackEvent('app_uninstalled', { account_id: account.id, timestamp: new Date(event.created * 1000), });
// Clean up account data await cleanupAccountData(account.id); break; }
default: console.log('Unhandled event type:', event.type); }
res.json({ received: true });});Connect List API
Với các nền tảng Connect, hãy sử dụng Connect List API để lấy thông tin về các tài khoản đã cài đặt app:
const stripe = require('stripe')('sk_live_xxxxx');
// List all connected accounts with your app installedconst getInstalledAccounts = async () => { const accounts = []; let hasMore = true; let startingAfter = null;
while (hasMore) { const params = { limit: 100 }; if (startingAfter) { params.starting_after = startingAfter; }
const response = await stripe.accounts.list(params);
for (const account of response.data) { // Check if your app is installed on this account if (account.settings?.apps?.includes('com.tajo.brevo-integration')) { accounts.push({ id: account.id, email: account.email, created: account.created, }); } }
hasMore = response.has_more; if (response.data.length > 0) { startingAfter = response.data[response.data.length - 1].id; } }
return accounts;};Xây Dựng Dashboard Analytics Tùy Chỉnh
Kết hợp Stripe analytics với dữ liệu của bạn để có cái nhìn toàn diện:
// Aggregate analytics for reportingconst getAppAnalytics = async (startDate, endDate) => { const [stripeInstalls, brevoSyncStats, activationData] = await Promise.all([ // Stripe install data getStripeInstallReport(startDate, endDate), // Brevo sync metrics from Tajo getBrevoSyncMetrics(startDate, endDate), // Activation funnel from your database getActivationFunnel(startDate, endDate), ]);
return { // Acquisition totalInstalls: stripeInstalls.installs, totalUninstalls: stripeInstalls.uninstalls, netInstalls: stripeInstalls.installs - stripeInstalls.uninstalls, listingConversionRate: stripeInstalls.conversionRate,
// Activation onboardingCompleted: activationData.completedOnboarding, brevoConnected: activationData.connectedBrevo, firstSyncCompleted: activationData.firstSyncCompleted, activationRate: activationData.completedOnboarding / stripeInstalls.installs,
// Engagement totalCustomersSynced: brevoSyncStats.totalCustomers, totalEventsSynced: brevoSyncStats.totalEvents, averageSyncFrequency: brevoSyncStats.avgSyncPerDay,
// Retention churnRate: stripeInstalls.uninstalls / stripeInstalls.totalActive, monthlyGrowthRate: stripeInstalls.momGrowth, };};Số Liệu Chính Cần Theo Dõi
Với tích hợp Tajo Brevo, hãy tập trung vào các số liệu này:
| Số Liệu | Mục Tiêu | Tại Sao Quan Trọng |
|---|---|---|
| Tỷ lệ Cài Đặt-đến-Kích Hoạt | > 70% | Tỷ lệ người cài đặt hoàn thành thiết lập Brevo |
| Thời Gian Đến Lần Đồng Bộ Đầu Tiên | < 5 phút | Tốc độ người dùng thấy giá trị sau khi cài đặt |
| Giữ Chân 30 Ngày | > 80% | Tỷ lệ người dùng vẫn hoạt động sau 30 ngày |
| Tỷ Lệ Churn Hàng Tháng | < 5% | Giảm thiểu gỡ cài đặt với tích hợp có giá trị |
| Tỷ Lệ Chuyển Đổi Listing | > 15% | Tỷ lệ người xem listing cài đặt |
| Khách Hàng Được Đồng Bộ Mỗi Tài Khoản | > 100 | Cho thấy độ sâu sử dụng tích hợp |
Tip
Thiết lập cảnh báo tự động cho các thay đổi số liệu đáng kể. Tăng đột biến trong gỡ cài đặt hoặc giảm tỷ lệ kích hoạt có thể cho thấy lỗi hoặc vấn đề UX cần được chú ý ngay lập tức.