There are few ways to get this information:
- If by “hits” you mean documents that were cited in answers: Yes, you can compute this today via the Conversations API. Each assistant message includes a
citationsarray of IDs; aggregate those per document to find most‑cited vs never‑cited (orphans). - If by “hits” you mean end‑user clicks on citation links: There isn’t a public API endpoint for citation click events. The official “Reports & Analytics” endpoints cover traffic, queries, and conversations—but not per‑citation click metrics, so you’d need to instrument clicks yourself on the frontend (see Workarounds below).
What the API gives you
- Messages (with citations):
- Retrieve messages in a conversation. The response includes messages.data[] items (type PromptHistory ) and, crucially, an integer array citations for each assistant message. That’s your signal that “this message used these document(s).”
- Resolve a citation → document metadata (URL/title):
- For each ID in citations, call Get Citation to receive PageMetadata
{ id, url, title, … }. - List all documents in the agent (to find orphans):
- Call List Pages; this returns every page (Page) the agent has indexed. Comparing this full set to your “ever‑cited” set yields the orphaned docs.
- For each ID in citations, call Get Citation to receive PageMetadata
- (Optional) Segmentation by channel/source:
- Each message includes metadata such as request_source (e.g., web, api, sdk, etc.), which you can use to break out “hits” by channel.
Note on built‑in analytics: The Reports API covers overall traffic, queries, conversations, and graph‑ready time series—handy for totals and trends—but it does not expose doc‑level citation counts.
