---
title: "Get site analytics"
method: GET
path: "/api/analytics/site/{site_name}"
tags: ["Reporting"]
---

# Get site analytics

`GET /api/analytics/site/{site_name}`

## Request

- Base URL: `https://api.duda.co`
- URL: `https://api.duda.co/api/analytics/site/{site_name}`
- Auth: HTTP basic

Get analytics history for a site over a period of time.

If neither `from` nor `to` is provided, the queried period is the past 30 days.
If only `from` is provided, the period is `from` plus 30 days. If only `to` is
provided, the period is the 30 days up to and including `to`.

`result=activities` can't be combined with `dimension`; the request returns an error.

Without `dimension`, the response is a single object of metrics. With `dimension`,
the response is an array with one entry per dimension value, each holding the
dimension and its metrics.

## Path parameters

- `site_name` string, required

## Query parameters

- `from` string, date
- `to` string, date
- `dimension` 'system' | 'geo'
- `result` 'traffic' | 'activities'
- `dateGranularity` 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'

## Response `200`

OK

- union
  - SiteTrafficMetrics: Traffic metrics for the queried period.
    - `VISITS` integer, required: The number of visits to the site.
    - `VISITORS` integer, required: The number of unique visitors to the site.
    - `PAGE_VIEWS` integer, required: The number of page views on the site.
  - SiteActivityMetrics: Visitor action metrics for the queried period.
    - `CLICK_TO_CALLS` integer, required: The number of click-to-call actions on the site.
    - `CLICK_TO_MAPS` integer, required: The number of click-to-map actions on the site.
    - `CLICK_TO_EMAILS` integer, required: The number of click-to-email actions on the site.
    - `FORM_SUBMITS` integer, required: The number of form submissions on the site.
  - SiteTrafficByGeo[]
    - `dimension` object
      - `country` string, required
      - `region` string, required
    - `data` SiteTrafficMetrics: Traffic metrics for the queried period.
      - `VISITS` integer, required: The number of visits to the site.
      - `VISITORS` integer, required: The number of unique visitors to the site.
      - `PAGE_VIEWS` integer, required: The number of page views on the site.
  - SiteTrafficBySystem[]
    - `dimension` object
      - `browser` string, required
      - `os` string, required
    - `data` SiteTrafficMetrics: Traffic metrics for the queried period.
      - `VISITS` integer, required: The number of visits to the site.
      - `VISITORS` integer, required: The number of unique visitors to the site.
      - `PAGE_VIEWS` integer, required: The number of page views on the site.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `429`: Too many requests. The rate limit was exceeded.

---

[API](https://skmtc.dev/duda/apis/duda-partner-api.md) - [All operations](https://skmtc.dev/duda/apis/duda-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/duda/apis/duda-partner-api/revisions/52be4d41cb12?raw)
