ThoughtMetric

Performance

Performance data

GET https://thoughtmetric.io/api/v1/performance_data

Blended performance for the whole store: traffic, orders, sales, ad spend and efficiency metrics. This is the endpoint behind the main dashboard overview. Figures cover all traffic, not just ad-attributed traffic.

Example request

curl -G https://thoughtmetric.io/api/v1/performance_data \
  -H "Authorization: Bearer 2019962dcf7a7b1fedc4563b9aaf9fc87426f278" \
  -d projectId=ID-bcd0aa692ce7e6b2 \
  -d startDate=2024-01-01 \
  -d endDate=2024-01-31 \
  -d interval=day

Query parameters

projectId string, required The Project ID of the store you are querying, e.g. ID-bcd0aa692ce7e6b2. Find it under Configure → API in the dashboard. The older numeric project ID is also accepted.
startDate string, required Start of the reporting window, YYYY-MM-DD. Inclusive.
endDate string, required End of the reporting window, YYYY-MM-DD. Inclusive. The window may not exceed six months.
interval string, required Bucket size for the over_time series: day, week, month or year.

Response

total object

Totals for the whole reporting window.

visits number Sessions recorded by the tracking pixel.
total_duration number Combined duration of all sessions, in seconds.
total_pageviews number Pageviews across all sessions.
orders number Orders attributed to this row.
view_contents number Product view events.
add_to_carts number Add-to-cart events.
leads number Lead events.
gross_sales number Sales before discounts are applied.
total_discounts number Discounts applied to attributed orders.
total_refund number Amount refunded on attributed orders.
net_sales number Sales after refunds, excluding shipping and tax.
total_shipping number Shipping charged on attributed orders.
total_tax number Tax collected on attributed orders.
total_sales number Total value of attributed orders.
net_profit number total_sales minus converted_spend.
item_quantity number Units sold across attributed orders.
spend number Ad spend as reported by the ad platform, in the platform's own currency.
converted_spend number Ad spend converted into your project's reporting currency. Use this one for cross-platform comparisons.
aov number Average order value, total_sales divided by orders.
conversion_rate number Orders divided by visits, as a percentage.
cac_blended number Blended customer acquisition cost, converted_spend divided by orders.
mer number Marketing efficiency ratio. Same calculation as roas, named separately on the blended endpoint by convention.
new_customer_orders number Orders placed by first-time customers.
returning_customer_orders number Orders placed by returning customers.
new_customer_total_sales number Sales from first-time customers.
returning_customer_total_sales number Sales from returning customers.
new_customers number Duplicate of new_customer_orders, kept for backwards compatibility.
cost_per_new_customer_order number converted_spend divided by new_customer_orders.
cost_per_returning_customer_order number converted_spend divided by returning_customer_orders.
roas_new_customer number new_customer_total_sales divided by converted_spend.
roas_returning_customer number returning_customer_total_sales divided by converted_spend.
over_time array

One object per interval bucket, oldest first. Each object holds the same metrics as total, plus time. Buckets with no activity come back as zeroes rather than being omitted.

time string Start of the interval bucket, as an ISO 8601 timestamp.

Example response

Abbreviated for readability. Every metric listed above appears on each object.

200 OK
{
  "total": {
    "visits": 48210.0,
    "total_pageviews": 132904.0,
    "orders": 1284.0,
    "total_sales": 142105.44,
    "converted_spend": 45623.25,
    "aov": 110.67,
    "conversion_rate": 2.66,
    "mer": 3.11,
    "new_customer_orders": 902.0,
    "returning_customer_orders": 382.0
  },
  "over_time": [
    {
      "time": "2024-01-01T00:00:00.000Z",
      "visits": 1502.0,
      "orders": 41.0,
      "total_sales": 4530.18,
      "converted_spend": 1482.10,
      "mer": 3.06
    },
    {
      "time": "2024-01-02T00:00:00.000Z",
      "visits": 1690.0,
      "orders": 47.0,
      "total_sales": 5104.92,
      "converted_spend": 1550.44,
      "mer": 3.29
    }
  ]
}