Goal conversions endpoint
GET /api/v1/sites/{site}/goals
Returns conversion data for all goals configured on the site. Includes unique conversions, total conversions, and conversion rate. Returns an empty array if no goals are configured.
Example request
curl -H "Authorization: Bearer your-token" "https://pageviews.ai/api/v1/sites/{site_id}/goals?from=2026-03-01&to=2026-03-07"
Response
Each goal item contains:
name— Goal nameuniques— Unique conversionstotal— Total conversionscr— Conversion rate percentage (0–100)
When comparison dates are provided, each metric also includes a comparison direction field (uniqueComparison, totalComparison, crComparison).
Example response
{
"data": {
"goals": [
{ "name": "Newsletter Signup", "uniques": 42, "total": 56, "cr": 5.3 },
{ "name": "Purchase", "uniques": 18, "total": 23, "cr": 2.3 }
]
}
}