Paginated visit/session feed
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Inclusive window start (YYYY-MM-DD). Parsed with parseDateRangeParams; when either startDate or endDate is missing/invalid the route falls back to a rolling default window (30 days for events/visits/attribution, 7 days for growth).
Inclusive window end (YYYY-MM-DD). See startDate for fallback behavior.
Responses
Section titled “Responses”Paginated visit feed. Two code paths produce the SAME field set. Primary path reads D1 visit_attributions. If that returns total === 0, the service falls back to Analytics Engine visit rows; in that fallback id is the synthetic “ae:ip/userAgent/shortLink are always null, deviceType defaults to “UNKNOWN”, clickIds is at most a single-entry map, and createdAt is the ClickHouse datetime string “YYYY-MM-DD HH:MM:SS”. On the D1 path createdAt is normalizeUtcTimestamp(…) of the stored value (ISO-8601 UTC) with the raw stored string as fallback, and userAgent is hardcoded null in both paths. clickIds keys are ad-platform click-ID parameter names (gclid, fbclid, bd_vid, …) — an open-ended map of string→string.
object
object
Empty string when unknown
Empty string when unknown (D1 path)
Empty string when unknown
Map of ad-platform click-ID parameter name → value; keys are open-ended.
Always null (not persisted / not selected)
D1 path: ISO-8601 UTC (normalized), raw stored string as fallback. AE fallback path: “YYYY-MM-DD HH:MM:SS”.
Always null on the AE fallback path.
object
object
object
Total matching visits (D1 COUNT, or filtered AE row count on the fallback path).