POST /api/v1/client-api/metrics/analytics/

Truy xuất dữ liệu phân tích

Truy xuất dữ liệu phân tích để có thông tin chi tiết về hành vi người dùng và các chỉ số hiệu suất nhằm sử dụng thêm trong các biểu đồ.

Doanh thu từ endpoint này dựa trên sự kiện: mỗi giá trị được gán cho ngày giao dịch — ngày xảy ra giao dịch mua, gia hạn hoặc hoàn tiền. Để gán doanh thu theo ngày cài đặt của từng người dùng (ví dụ: để đối chiếu với Ads Manager), hãy sử dụng endpoint cohort (POST /api/v1/client-api/metrics/cohort/).

Giới hạn tốc độ: 2 yêu cầu mỗi giây.

Request body

chart_idstringrequired

Chỉ định biểu đồ bạn cần. Bạn chỉ có thể chỉ định một loại biểu đồ trong mỗi yêu cầu.

One of: "revenue", "mrr", "arr", "arppu", "subscriptions_active", "subscriptions_new", "subscriptions_renewal_cancelled", "subscriptions_expired", "trials_active", "trials_new", "trials_renewal_cancelled", "trials_expired", "grace_period", "billing_issue", "refund_events", "refund_money", "non_subscriptions", "arpu", "installs"

filtersobjectrequired
datearray of stringrequired

Nhập ngày hoặc khoảng thời gian bạn muốn truy xuất dữ liệu biểu đồ

compare_datearray of string

Nhập ngày hoặc khoảng thời gian để so sánh

storearray of string

Lọc theo cửa hàng ứng dụng nơi giao dịch mua được thực hiện

countryarray of string

Lọc theo mã quốc gia 2 chữ cái nơi giao dịch mua diễn ra

store_product_idarray of string

ID sản phẩm có kèm tên cửa hàng, được định dạng theo cú pháp <store>:<product_id> — ví dụ app_store:premium_monthly hoặc play_store:premium_sub:monthly-base-plan đối với gói đăng ký Google có base plan. ID sản phẩm không có tiền tố cửa hàng sẽ bị từ chối.

durationarray of string

Chỉ định thời hạn gói đăng ký

attribution_sourcearray of string

Tích hợp nguồn cho attribution

attribution_statusarray of string

Cho biết attribution là organic hay non-organic

attribution_channelarray of string

Kênh marketing dẫn đến giao dịch

attribution_campaignarray of string

Chiến dịch marketing mang lại giao dịch

attribution_adgrouparray of string

Nhóm quảng cáo attribution mang lại giao dịch

attribution_adsetarray of string

Bộ quảng cáo attribution dẫn đến giao dịch

attribution_creativearray of string

Các yếu tố hình ảnh hoặc văn bản cụ thể trong quảng cáo hoặc chiến dịch được theo dõi để đo lường hiệu quả

offer_categoryarray of string

Chỉ định các danh mục ưu đãi bạn muốn truy xuất dữ liệu

offer_typearray of string

Chỉ định các loại ưu đãi bạn muốn truy xuất dữ liệu

offer_idarray of string

Chỉ định các ưu đãi cụ thể bạn muốn truy xuất dữ liệu

placement_idarray of string

ID nội bộ của Adapty cho các placement cần truy xuất dữ liệu — UUID trong URL placement trên dashboard, không phải ID placement bạn truyền vào SDK

audience_idarray of string

ID nội bộ của Adapty cho các đối tượng của placement cần truy xuất dữ liệu

paywall_idarray of string

ID nội bộ của Adapty cho các paywall cần truy xuất dữ liệu — UUID trong URL paywall trên dashboard

flow_idarray of string

ID nội bộ của Adapty cho các flow cần truy xuất dữ liệu — UUID trong URL flow trên dashboard

flow_screen_idarray of string

Các màn hình flow cần truy xuất dữ liệu, mỗi mục được định dạng theo cú pháp <flow_id>:<screen_id> — ví dụ 3f8a1c2e-0b7d-4e5a-9c61-2d4f8e7b1a90:paywall

segment_idarray of string

ID nội bộ của Adapty cho các phân khúc cần truy xuất dữ liệu

period_unitstring

Chỉ định khoảng thời gian để tổng hợp dữ liệu phân tích

One of: "day", "week", "month", "quarter", "year"

date_typestring

Chỉ định ngày nào sẽ được coi là ngày người dùng tham gia

One of: "purchase_date", "profile_install_date"

segmentationstring

Chia dữ liệu thành một chuỗi riêng cho mỗi giá trị của chiều này. Ví dụ, flow_id trả về một chuỗi riêng biệt cho mỗi flow, và placement_id cho mỗi placement.

One of: "period", "renewal_status", "cancellation_reason", "store_product_id", "country", "store", "paywall_id", "audience_id", "placement_id", "flow_id", "flow_screen_id", "segment_id", "duration", "offer_category", "offer_type", "offer_id", "attribution_source", "attribution_status", "attribution_channel", "attribution_campaign", "attribution_adgroup", "attribution_adset", "attribution_creative", "day", "week", "month", "year"

formatstring

Chỉ định định dạng tệp xuất

One of: "json", "csv"

Responses

Dữ liệu phân tích được truy xuất thành công

Schema

Phản hồi chứa dữ liệu phân tích cho loại biểu đồ được yêu cầu

dataobject

Đối tượng chứa các loại chỉ số khác nhau (revenue, proceeds, net_revenue, v.v.)

Example
{
  "data": {
    "revenue": {
      "data": [],
      "value": 0,
      "value_from": null,
      "value_to": null,
      "compare_value_from": null,
      "compare_value_to": null,
      "title": "revenue",
      "type": "multi",
      "default_aggregation": "sum",
      "description": "<div>Total money received from both subscriptions and one-time purchases. Does not include\nrevenue from subscriptions and purchases that were refunded afterward. Calculated before the store's fee.<br />\nFor example, there were 5 monthly $10 subs, 1 yearly $100 sub and 10 one-time $50 purchases today,<br />\nrevenue = 5*$10 + 1*$100 + 10*$50 = $650</div>",
      "metric_name": "Revenue",
      "is_json": true,
      "unit": "USD",
      "recommended_period": null
    },
    "proceeds": {
      "data": [],
      "value": 0,
      "value_from": null,
      "value_to": null,
      "compare_value_from": null,
      "compare_value_to": null,
      "title": "revenue",
      "type": "multi",
      "default_aggregation": "sum",
      "description": "<div>Total money received from both subscriptions and one-time purchases. Does not include\nrevenue from subscriptions and purchases that were refunded afterward. Calculated before the store's fee.<br />\nFor example, there were 5 monthly $10 subs, 1 yearly $100 sub and 10 one-time $50 purchases today,<br />\nrevenue = 5*$10 + 1*$100 + 10*$50 = $650</div>",
      "metric_name": "Revenue",
      "is_json": true,
      "unit": "USD",
      "recommended_period": null
    },
    "net_revenue": {
      "data": [],
      "value": 0,
      "value_from": null,
      "value_to": null,
      "compare_value_from": null,
      "compare_value_to": null,
      "title": "revenue",
      "type": "multi",
      "default_aggregation": "sum",
      "description": "<div>Total money received from both subscriptions and one-time purchases. Does not include\nrevenue from subscriptions and purchases that were refunded afterward. Calculated before the store's fee.<br />\nFor example, there were 5 monthly $10 subs, 1 yearly $100 sub and 10 one-time $50 purchases today,<br />\nrevenue = 5*$10 + 1*$100 + 10*$50 = $650</div>",
      "metric_name": "Revenue",
      "is_json": true,
      "unit": "USD",
      "recommended_period": null
    }
  }
}

Yêu cầu không hợp lệ

Schema
errorsarray of object
sourcestring
errorsarray of string
error_codestring
status_codeinteger

Không được xác thực

Schema
errorsarray of object
sourcestring
errorsarray of string
error_codestring
status_codeinteger

Vượt quá giới hạn tốc độ. Tối đa 2 yêu cầu mỗi giây cho mỗi ứng dụng, được chia sẻ bởi tất cả các API key của ứng dụng đó.