ThoughtMetric

Customers

Customer LTV by channel

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

Average total spend of customers whose orders are attributed to each channel. Useful for comparing the long-run value of the customers different channels bring in.

Example request

curl -G https://thoughtmetric.io/api/v1/customer_ltv_by_channel \
  -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.
model string, optional Attribution model: first, last, position, linearNonDirect or linearPaid. Defaults to the model configured on the project.

Response

total array

One object per channel.

channel string Marketing channel the customers are attributed to.
ltv number Average lifetime spend of customers attributed to this channel.

Example response

200 OK
{
  "total": [
    { "channel": "facebookad", "ltv": 210.44 },
    { "channel": "googlead", "ltv": 188.10 },
    { "channel": "organic", "ltv": 241.85 }
  ],
  "total_last_period": [],
  "over_time": [],
  "over_time_last_period": []
}

Notes

  • This endpoint looks at customers converting in the 30 days up to endDate. startDate is required by the API but does not affect the result.
  • Customers attributed to more than one channel are counted once per channel.