> For the complete documentation index, see [llms.txt](https://api-docs.devhub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.devhub.com/logging-and-analytics/analytics.md).

# Analytics

## Site Summary

Summary of all events within a date range for a particular `site_id`

```
GET /api/v2/analytics/?site_id=12345&
    report_type=full_report&
    from_date=2015-07-01&
    to_date=2015-07-05
```

### Parameters

| Name          | Type     | Description                                                                                             |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| `site_id`     | `string` | **required** ID of the `Site` you want to get the report for                                            |
| `report_type` | `string` | **required** Example: `full_report`                                                                     |
| `from_date`   | `string` | **required** `YYYY-MM-DD` formatted date string                                                         |
| `to_date`     | `string` | **required** `YYYY-MM-DD` formatted date string                                                         |
| `events`      | `string` | By default this endpoint returns a standard set of event types. See event types below for more details. |

### Event types

By default, this endpoint returns data for the following events:

* site-page-view
* form-submit
* link-call
* link-outgoing

You can optionally pass an `events` list, which is a comma separated list of "Event names" to report on.

Example: `?events=form-submit,link-facebook,link-call`

Which events that are tracked will depend somewhat on the elements that are present on your template, but a list of all possible events and their "Event name" can be found here:

{% embed url="<https://docs.devhub.com/analytics/what-events-are-tracked-automatically>" %}

### Response

```javascript
{
  "events": {
    "site-page-view": {
      "average": "0.00",
      "timeline": {
        "2015-07-01": 0,
        "2015-07-02": 0,
        "2015-07-03": 0,
        "2015-07-04": 0,
        "2015-07-05": 0
      },
      "total": "0"
    },
    ...
  },
  "meta": {
    "events": [
      "form-submit",
      "link-outgoing",
      "site-page-view",
      ...
    ],
    "series": [
      "2015-07-01",
      "2015-07-02",
      "2015-07-03",
      "2015-07-04",
      "2015-07-05"
    ]
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.devhub.com/logging-and-analytics/analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
