> ## Documentation Index
> Fetch the complete documentation index at: https://crevio.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get site analytics

> Returns traffic analytics for a site over a date range: pageview/visitor totals, new vs. returning visitors, a default conversion funnel, a per-day time series, and top pages, referrers, and dimensional breakdowns (device, browser, OS, geography, and UTM parameters). Defaults to the last 30 days; the range cannot exceed 366 days.



## OpenAPI

````yaml /developer/api-reference/openapi.json get /sites/{id}/analytics
openapi: 3.1.1
info:
  title: Crevio API V1
  version: 1.0.0
  description: >
    API for the Crevio creator platform — a multi-tenant SaaS for digital
    product sales.

    Uses snake_case keys following Stripe conventions. All resource IDs are
    string IDs (e.g., "prod_abc123").
  contact:
    email: support@crevio.co
    name: Crevio Support
    url: https://crevio.co/docs
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.crevio.co/v1
    description: Production
security:
  - ApiKey: []
tags:
  - name: Account
    description: Current account information
  - name: Analytics
    description: Account-wide business analytics
  - name: BlogCategories
    description: Blog post categories
  - name: BlogPosts
    description: Blog content management
  - name: Carts
    description: Shopping cart management
  - name: CheckoutLinks
    description: Shareable checkout links
  - name: Checkouts
    description: Checkout session management
  - name: Customers
    description: Customer relationship management
  - name: Discounts
    description: Discount code management
  - name: Emails
    description: Email sending
  - name: Experiences
    description: Digital experiences (courses, communities, downloads)
  - name: Files
    description: File uploads and external media management
  - name: FormSubmissions
    description: Form submission management
  - name: FormationDocuments
    description: Documents generated for a formation
  - name: Formations
    description: Whitelabel business formation via doola Partner API
  - name: Forms
  - name: Invoices
    description: Invoice creation, payment, and lifecycle management
  - name: LegalPages
  - name: Me
    description: Current user profile
  - name: OrderItems
    description: Order line items
  - name: Orders
    description: Order history and details
  - name: PriceVariants
    description: Product pricing tiers
  - name: Products
    description: Digital product catalog
  - name: Refunds
    description: Refund management
  - name: Reviews
    description: Product reviews
  - name: Socials
    description: Social media management (accounts, posts, media).
  - name: Subscriptions
    description: Subscription lifecycle management (cancel, pause, resume)
  - name: Tags
    description: Customer tags
  - name: TaskRuns
    description: Individual execution records for AI tasks.
  - name: Tasks
    description: >-
      AI tasks — scheduled or event-triggered agentic work (cron, interval,
      once, immediate, event).
  - name: WebhookEndpoints
    description: Webhook endpoint management
  - name: WebhookEvents
    description: Webhook event delivery history
  - name: Leads
    description: Find, verify and enrich business leads (Hunter.io-backed).
  - name: Ads
    description: >-
      Paid advertising — campaigns, ad groups, ads, audiences, targeting, leads,
      conversions, and reports across Meta, Google, TikTok, LinkedIn, Pinterest,
      and X.
  - name: Domains
    description: Custom web domains for your sites.
  - name: Web
    description: >-
      Web search & scraping (search, read, map, crawl, extract, research),
      backed by Firecrawl.
  - name: Skills
    description: >-
      AI skills marketplace — search the catalog and install or uninstall skills
      for your account's agent.
  - name: Schedules
    description: Reusable availability schedules that back event types.
  - name: EventTypes
    x-displayName: Event Types
    description: Bookable services customers can schedule time on.
  - name: Bookings
    description: Reservations made against event types.
  - name: Connections
    description: Third-party app connections (connect, list, execute)
  - name: Approvals
    description: Human-in-the-loop approvals for gated actions
  - name: Logs
    description: Account activity log
paths:
  /sites/{id}/analytics:
    get:
      tags:
        - Sites
      summary: Get site analytics
      description: >-
        Returns traffic analytics for a site over a date range: pageview/visitor
        totals, new vs. returning visitors, a default conversion funnel, a
        per-day time series, and top pages, referrers, and dimensional
        breakdowns (device, browser, OS, geography, and UTM parameters).
        Defaults to the last 30 days; the range cannot exceed 366 days.
      operationId: getSiteAnalytics
      parameters:
        - $ref: '#/components/parameters/Id'
        - name: start_date
          in: query
          description: >-
            Start of the date range (inclusive), as an ISO-8601 date
            (YYYY-MM-DD). Defaults to 30 days before end_date.
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: >-
            End of the date range (inclusive), as an ISO-8601 date (YYYY-MM-DD).
            Defaults to today.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Site analytics for the requested period
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - site_analytics
                  site_id:
                    type: string
                    description: Prefix id of the site (e.g. site_abc123).
                  period:
                    type: object
                    description: The resolved date range the metrics cover.
                    properties:
                      start_date:
                        type: string
                        format: date
                      end_date:
                        type: string
                        format: date
                    required:
                      - start_date
                      - end_date
                  totals:
                    type: object
                    description: Aggregate pageviews and unique visitors over the period.
                    properties:
                      pageviews:
                        type: integer
                      visitors:
                        type: integer
                  new_vs_returning:
                    type: object
                    description: >-
                      Visitors active in the period split by whether their
                      first-ever visit was before the period started.
                    properties:
                      new_visitors:
                        type: integer
                      returning_visitors:
                        type: integer
                  funnel:
                    type: array
                    description: >-
                      Ordered conversion funnel; each stage counts visitors who
                      reached it within 24h of the first stage.
                    items:
                      type: object
                      properties:
                        label:
                          type: string
                        visitors:
                          type: integer
                  by_day:
                    type: array
                    description: Per-day pageviews and visitors time series.
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          format: date
                        pageviews:
                          type: integer
                        visitors:
                          type: integer
                  top_pages:
                    type: array
                    description: Top 20 pages by pageviews.
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        pageviews:
                          type: integer
                        visitors:
                          type: integer
                  top_referrers:
                    type: array
                    description: Top 20 referrer hosts by visitors.
                    items:
                      type: object
                      properties:
                        source:
                          type: string
                        pageviews:
                          type: integer
                        visitors:
                          type: integer
                  custom_events:
                    type: array
                    description: >-
                      Top 20 custom events by hit count, with unique visitors
                      and any associated revenue.
                    items:
                      type: object
                      properties:
                        event_name:
                          type: string
                        hits:
                          type: integer
                        visitors:
                          type: integer
                        revenue:
                          type: number
                  by_device:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_browser:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_os:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_country:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_region:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_city:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_utm_source:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_utm_medium:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                  by_utm_campaign:
                    $ref: '#/components/schemas/SiteAnalyticsDimension'
                required:
                  - object
                  - site_id
                  - period
                  - totals
                example:
                  object: site_analytics
                  site_id: site_ExD8Y6PWw0xJrfD9QKVgvnRZ
                  period:
                    start_date: '2026-05-05'
                    end_date: '2026-06-04'
                  totals:
                    pageviews: 1820
                    visitors: 642
                  new_vs_returning:
                    new_visitors: 511
                    returning_visitors: 131
                  funnel:
                    - label: Landing
                      visitors: 642
                    - label: Product view
                      visitors: 188
                    - label: Checkout
                      visitors: 54
                    - label: Purchase
                      visitors: 21
                  by_day:
                    - date: '2026-06-04'
                      pageviews: 96
                      visitors: 38
                  top_pages:
                    - path: /
                      pageviews: 820
                      visitors: 410
                  top_referrers:
                    - source: google.com
                      pageviews: 240
                      visitors: 180
                  custom_events:
                    - event_name: purchase
                      hits: 21
                      visitors: 21
                      revenue: 1049.79
                  by_device:
                    - value: mobile
                      pageviews: 1100
                      visitors: 402
                  by_country:
                    - value: US
                      pageviews: 900
                      visitors: 360
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Crevio } from "@crevio/sdk";

            const crevio = new Crevio({
              apiKey: process.env["CREVIO_API_KEY"] ?? "",
            });

            async function run() {
              const result = await crevio.sites.analytics({
                id: "<id>",
              });

              console.log(result);
            }

            run();
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      description: The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
      schema:
        type: string
  schemas:
    SiteAnalyticsDimension:
      type: array
      description: >-
        Top 20 values for a single analytics dimension, ranked by unique
        visitors.
      items:
        type: object
        properties:
          value:
            type: string
          pageviews:
            type: integer
          visitors:
            type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - invalid_request_error
                - validation_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            errors:
              type: object
          required:
            - type
            - message
      required:
        - error
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: bad_request
              message: The request was malformed or contained invalid parameters
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: authentication_required
              message: You did not provide an API key.
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: resource_missing
              message: The requested resource was not found
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in the format: Bearer {api_token}'

````