AI Traffic (GA4)GA4 Key Events Timeline

GA4 key events timeline

Daily GA4 key events (conversions) from AI-referred traffic, split by event name and by LLM source.

curl --request GET \
  --url 'https://api.aiclicks.io/api/v1/ga4/key-events-timeline?domain_id=8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3&days=30' \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "items": [
      {
        "date": "2026-11-02",
        "by_event": {
          "signup": { "chatgpt": 4, "perplexity": 1 },
          "purchase": { "chatgpt": 1 }
        }
      },
      {
        "date": "2026-11-03",
        "by_event": {
          "signup": { "chatgpt": 2, "gemini": 1 }
        }
      }
    ]
  },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "start_date": null,
  "end_date": null,
  "generated_at": "2026-11-09T10:00:11.218Z"
}

This endpoint returns the daily trend of GA4 key events (conversions) from AI-referred traffic. Each day splits the counts by event name, and each event splits the counts by LLM source.

Use it to see when AI-referred visitors converted, and which assistant sent them. For the window totals, use GET /api/v1/ga4/key-events.

The connected GA4 property sets which events are key events. The event names here are the names in that property.

The domain_id query parameter is required. To find the domains that your key can access, use GET /api/v1/domains.

If the domain has no connected GA4 property, the endpoint returns 200 with an empty items list. Days without key events do not appear in the list.

Authorizations

header
Authorizationstring
Required

Your API key formatted as Bearer ak_live_<your-key>. Create one in the dashboard under Settings → Developers.

header
X-Request-Idstring

Optional UUID for log correlation. If you do not send one, the server makes one and returns it in the response.

Query parameters

query
domain_idstring
Required

UUID of the domain. Find domains with GET /api/v1/domains. If you do not send it, the endpoint returns 400.

query
daysinteger

Trailing look-back window in days, 1–365. Defaults to 30. The server uses the exact value. For example, days=95 returns the last 95 days.

query
start_datestring

Start of a fixed window, YYYY-MM-DD. Send it with end_date. A fixed window overrides days.

query
end_datestring

End of a fixed window, YYYY-MM-DD, inclusive. Send it with start_date.

query
llm_sourcestring

Optional. One AI referral source: chatgpt, perplexity, claude, gemini, copilot, … If you send it, the counts include only that source.

query
freshboolean

If true, the server ignores the cached result and calculates a new result. The new result replaces the cached result. Defaults to false.

Response

dataobject
Required

The timeline payload.

itemsarray
Required

One entry for each day with at least one key event, in date order.

domain_idstring
Required

Echo of the requested domain.

daysinteger
Required

Echo of the requested window.

llm_sourcestring

Echo of the llm_source filter. null when you do not send it.

start_datestring

Echo of start_date. null when you do not send it.

end_datestring

Echo of end_date. null when you do not send it.

generated_atstring
Required

ISO-8601 timestamp of when the server made (or cached) this response.

Response headers

HeaderDescription
X-CacheHIT, MISS, or REFRESH (when fresh=true). Tells you if the response came from cache.
X-Request-IdUnique request id. Echoes your id if you send one.
X-RateLimit-LimitMaximum requests per minute for this key.
X-RateLimit-RemainingRequests that remain in the current minute.
X-RateLimit-ResetUnix epoch seconds when the window resets.

Caching

The server keeps the result in cache for 1 hour for each (domain_id, days, llm_source, start_date, end_date). New GA4 data shows after the cache expires. To get a new result, send fresh=true.

Errors

400 Bad Requesterror

The domain_id is missing.

401 Unauthorizederror

The API key is missing, not valid, or revoked.

403 Forbiddenerror

The team's developer_access flag is off. Or the domain is not in the scope of your API key.

404 Not Founderror

The domain_id is not valid or does not exist. Or your user is not a member of the domain's team.

429 Too Many Requestserror

You sent too many requests. The Retry-After header tells you how long to wait.

Empty result

{
  "data": { "items": [] },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "start_date": null,
  "end_date": null,
  "generated_at": "2026-11-09T10:00:11.218Z"
}