Announcing our new API documentation!
Check it out here

Per-resource analytics and API access

Per-redirect and per-QR analytics in the UI, and how to pull the same data from the SiteDetour API.

On this page:

Overview

Every redirect, Smart Link, and Landing Page has its own analytics view showing traffic scoped to just that resource. The same data is available through the SiteDetour REST API for custom dashboards, warehouse export, or alerting integrations.

Per-resource UI

Open any redirect or Smart Link. Click View Realtime Analytics. The analytics page mirrors the organization dashboard but filtered:

  • Total traffic time series.
  • Top countries (25).
  • Top referring domains.
  • Referrer source breakdown.
  • Device type breakdown.
  • Request protocol (HTTP vs HTTPS) breakdown.

Date range picker at the top applies to the whole view.

API endpoints

All analytics endpoints are under /api/analytics/. Authenticate with a Bearer token (see Generating your API token). Key endpoints:

  • GET /api/analytics/hit-counter/{resourceId} — time series of hits.
  • GET /api/analytics/countries/{resourceId} — country breakdown.
  • GET /api/analytics/referring-domains/{resourceId} — referring domain list.
  • GET /api/analytics/referrer-types/{resourceId} — source classification.
  • GET /api/analytics/device-types/{resourceId} — device breakdown.
  • GET /api/analytics/http-schemes/{resourceId} — HTTP vs HTTPS breakdown.

Every endpoint accepts from and to query parameters as ISO 8601 timestamps. For time-series endpoints, pass a granularity parameter (hour, day, week, month).

Example: daily hits for the last 30 days

curl -H "Authorization: Bearer $TOKEN" \
 "https://sitedetour.com/api/analytics/hit-counter/{redirectId}?from=2024-03-01T00:00:00Z&to=2024-03-31T23:59:59Z&granularity=day"

Response:

{"data": [{"timestamp": "2024-03-01T00:00:00Z", "count": 142}, ...]}

Organization-level endpoints

To query across every redirect, use the org-level analytics endpoint: GET /api/analytics/date-histogram. Accepts the same from/to/granularity parameters.

Rate limits

The global API rate limit is 240 requests per minute per access token. Analytics endpoints are included in that budget. For warehouse export, batch by resource and stagger requests.

Data retention

Hit-level analytics are retained based on your plan. Higher tiers keep longer histories; lower tiers aggregate older data or truncate at the plan's retention window. Check Billing for the specific window.

Privacy

SiteDetour never persists visitor IPs in plaintext. Geo-IP lookups happen against a pseudonymized value; only the resolved country/continent/coordinates are stored.

Next steps