Insights API

Metrics API

POST https://api.tapcart.com/insights-pro/v2/metrics

Returns aggregated analytics data for your Tapcart app. Uses a consistent request body and a varying response shape depending on the metricType supplied in the request.


Authentication

Provide the following headers alongside the request body:

HeaderDescription
api-keyA static key with authorized access for your organization
app-idYour organization's Tapcart id. It's good practice to include this alongside all requests.

If you do not have access to your merchant api key, please reach out to support for assistance.


Request Body

All fields are required unless noted. Fields are validated at the server and unknown fields are stripped from the request.

FieldTypeDescription
metricTypestring (enum)The metric to query. See Metric Types below for all valid values.
appIdstringThe Tapcart app ID. Must match the app-id header when using session-based auth.
startTimestampstringStart of the date range (inclusive). ISO 8601 timestamp recommended (e.g. "2024-01-01T00:00:00Z").
endTimestampstringEnd of the date range (exclusive). ISO 8601 timestamp recommended.
timezonestringIANA timezone string used to localize time bucketing (e.g. "America/Los_Angeles").
granularity"hour" | "day" | "week" | "month"Time bucket size for time-series metrics. Required for metrics that return a time series; ignored otherwise.

Example request:

{
  "metricType": "overview_sessions_by_time",
  "appId": "abc123",
  "startTimestamp": "2024-01-01T00:00:00Z",
  "endTimestamp": "2024-02-01T00:00:00Z",
  "timezone": "America/New_York",
  "granularity": "day"
}

Response Envelope

All successful responses share the same top-level shape:

{
  "metricType": "<requested metricType>",
  "appId": "<requested appId>",
  "extras": {
    "currencyCode": "USD",
    "currencyFormat": "${{amount}}"
  },
  "count": 31,
  "records": [ ... ]
}
FieldTypeDescription
metricTypestringEchoed from the request.
appIdstringEchoed from the request.
extras.currencyCodestring?Your store currency code (e.g. "USD"). May be absent if not configured.
extras.currencyFormatstring?Your money format string (e.g. "${{amount}}"). May be absent if not configured.
countnumberNumber of records in the records array.
recordsobject[]Array of metric records. Shape varies by metricType. See below.

Error response: Validation, authentication, or usage based errors typically return a 4xx http status code. Internal errors typically return a 5xx status code. Usage based errors and internal errors may be retryable.


Metric Types

Push Explorer

push_explorer_individual

Aggregate performance metrics per individually sent push notification over the requested date range. One record per notificationId. Covers both push and inbox channel attribution.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
notificationIdstringUnique identifier for the notification.
sentAtstringISO timestamp when the notification was sent.
pushTypestringe.g. "individual", "custom_segment_individual"
channelstring?"only_push", "only_inbox", or "both_push_and_inbox"
titlestring?Notification title.
messagestring?Notification body text.
attachmentstring?Media attachment URL, if any.
segmentTitlestring?Name of the target segment, if applicable.
countSendsnumberTotal send attempts.
countSessionsnumberSessions attributed to this notification (push + inbox combined).
countCartsnumberCarts attributed to this notification.
countPurchasesnumberPurchases attributed to this notification.
totalRevenuenumberRevenue attributed to this notification.

push_explorer_automated

Aggregate performance metrics per automated push type (e.g. welcome, abandon cart) over the requested date range. One record per pushType.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
pushTypestringe.g. "welcome_push", "abandon_cart", "post_purchase", "win_back", "order_tracking"
createdAtstringISO timestamp when the automated job was configured.
countDevicesnumberTargeted devices.
countErrorsnumberSend errors.
countInactivenumberInactive/unregistered devices skipped.
countSendsnumberSuccessful sends.
countSessionsnumberAttributed sessions.
countCartsnumberAttributed cart additions.
countPurchasesnumberAttributed purchases.
totalRevenuenumberAttributed revenue.

push_explorer_by_time

Push metrics for all notification types combined, aggregated by time bucket.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
countDevicesnumber
countErrorsnumber
countInactivenumber
countSendsnumber
countSessionsnumber
countCartsnumber
countPurchasesnumber
totalRevenuenumber

Overview

overview_sessions_by_time

Session counts broken down by OS, consumer type (new vs. returning), and source type per time bucket. Returns multiple records per bucket — one per unique combination of OS, consumer type, and source type.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
operatingSystem"ios" | "android"
consumerType"new" | "returning"
sourceType"direct" | "push" | "deeplink"How the session was initiated.
countSessionsnumber

overview_sessions_heatmap

Session counts bucketed by day of week and hour of day (in the requested timezone). Returns up to 168 records (7 days × 24 hours).

Requires granularity: No

Record shape:

FieldTypeDescription
dayOfWeek"sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday"
hournumberHour of day (0–23) in the requested timezone.
appIdstring
countSessionsnumber

overview_revenue_by_time

Total Tapcart App revenue per time bucket.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
totalRevenuenumber

Revenue

revenue_by_time

Revenue and order counts per time bucket. Average order value (AOV) can be derived as totalRevenue / countOrders.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
totalRevenuenumber
countOrdersnumber

revenue_source_of_orders

Single aggregate row breaking down total order counts by attribution source (direct, push, inbox) for the full date range.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
countOrdersnumberTotal Tapcart App orders.
countPushOrdersnumberOrders attributed to push notification click-throughs.
countInboxOrdersnumberOrders attributed to inbox click-throughs.
countDirectOrdersnumberRemaining orders not attributed to push or inbox (floored at 0).

revenue_promo_vs_revenue

Revenue split between discounted (promo) and non-discounted orders per time bucket.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
promoRevenuenumberRevenue from orders that had a discount applied.
otherRevenuenumberRevenue from orders with no discount.

revenue_aov_by_os

Total revenue and order count per OS, enabling AOV calculation (totalRevenue / countOrders) broken down by platform.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
operatingSystem"ios" | "android"
totalRevenuenumber
countOrdersnumber

Acquisition

acquisition_daily_active_users

Unique active device count (DAU) per time bucket and OS.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
operatingSystem"ios" | "android"
countDaunumberDistinct active devices in the bucket.

acquisition_source_of_opens

Single aggregate row of session counts broken down by how the session was initiated (direct, push, deeplink) for the full date range.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
countDirectnumberSessions opened directly.
countPushnumberSessions opened via push notification.
countDeeplinknumberSessions opened via deep link.
countTotalnumberTotal sessions.

acquisition_open_rate

Daily unique openers compared against the cumulative installed device base per time bucket. Open rate can be derived as countDailyOpeners / countInstalledBase. The installed base excludes devices inactive for 230+ days before endTimestamp.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
countDailyOpenersnumberUnique devices with at least one session in the bucket.
countInstalledBasenumberTotal active installed devices. This value is the same across all rows — it is computed once for the period end.

acquisition_app_installs

App install counts per time bucket and OS.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
operatingSystem"ios" | "android"
countInstallsnumber

acquisition_signed_up_users

New account creation counts per time bucket.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
countSignupsnumber

acquisition_time_to_first_purchase

Average time from first app session to first purchase, bucketed by when the first purchase occurred.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start (keyed to when the first purchase happened).
appIdstring
avgTimeToFirstPurchaseMsnumberAverage milliseconds elapsed between a customer's first app session and their first purchase.

Retention

retention_repurchase_rate

Cumulative repurchase rate over time. For each bucket date, returns the total count of customers who have ever made at least one purchase up to that date, and the count who have made at least two.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
countTotalCustomersnumberCustomers with ≥1 purchase ever, as of this bucket date.
countRepeatCustomersnumberCustomers with ≥2 purchases ever, as of this bucket date.

retention_session_length

Average session duration and session count per time bucket and OS.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
operatingSystem"ios" | "android"Null OS values are excluded from this metric.
avgSessionDurationMsnumberAverage session length in milliseconds (capped at 1,800,000 ms / 30 min).
countSessionsnumber

retention_sessions_per_user

Average number of sessions per active user per day, broken down by operating system.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
operatingSystem"ios" | "android"Null OS values are excluded from this metric.
avgSessionsPerUsernumber

retention_customer_lifetime_value

Daily customer lifetime value (CLV) snapshots from a pre-materialized model. CLV is calculated using a rolling-year AOV × frequency × expected-lifetime formula.

Requires granularity: No (daily grain is always used)

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the calendar day.
appIdstring
customerLifetimeValuenumberEstimated CLV for the merchant on this date.

retention_dormancy_rate

Active vs. dormant device counts per time bucket. Active = last session within 30 days of the bucket date. Dormant = last session 30–230 days before the bucket date. Lapsed devices (>230 days inactive) are excluded from both counts.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
countDormantDevicesnumberDevices last active 30–230 days before this bucket date.
countActiveDevicesnumberDevices last active within 30 days of this bucket date.

retention_order_frequency

Average orders per customer per time bucket, along with supporting customer and order counts. Guest checkouts (no associated customer ID) are excluded.

Requires granularity: Yes

Record shape:

FieldTypeDescription
granularitystringISO timestamp of the bucket start.
appIdstring
avgOrdersPerCustomernumber
countCustomersnumberDistinct customers who placed at least one order in this bucket.
countOrdersnumberTotal orders in this bucket (excluding guest checkouts).

Customer Journey

customer_journey_conversion_funnel

Single aggregate row showing the conversion funnel from sessions through to purchases for the full date range. Each count represents distinct sessions that reached that funnel stage.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
countSessionsnumberTotal distinct sessions.
countProductViewednumberSessions with at least one product view.
countAddedToCartnumberSessions with at least one add-to-cart.
countPurchaseCompletednumberSessions with at least one completed purchase.

customer_journey_top_viewed_products

Top 10 most viewed products with their view counts and share of total views.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
productIdnumberShopify product ID.
countViewsnumberTotal views for this product.
countTotalnumberTotal product views across all products (same value on every row; use this to compute share of views).

customer_journey_top_wishlisted_products

Top 10 most net wishlisted products (adds minus removes). Products with a net wishlist count of zero or below are excluded.

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
productIdnumberShopify product ID.
countWishlistednumberNet wishlist additions (adds minus removes) for this product.
countTotalnumberSum of all positive net wishlist counts across all products (same value on every row).

customer_journey_top_purchased_products

Top 10 most-purchased products by total items sold (not order count).

Requires granularity: No

Record shape:

FieldTypeDescription
appIdstring
productIdnumberShopify product ID.
countPurchasednumberTotal items purchased for this product.
countTotalnumberTotal items purchased across all products (same value on every row).