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

# Analytics (PostHog)

> Pull your website visitor data from PostHog — users, pageviews, sessions, sources, and devices.

Get your website analytics from **PostHog**. These endpoints power the Traffic dashboard's **Analytics** tab when PostHog is your connected provider — users, pageviews, sessions, traffic sources, top pages, and device breakdowns.

<Note>
  You need a **PostHog** integration connected to your team. Connect it from **Settings → Integrations → Analytics & Performance**. Using **Google Analytics 4** instead? See [Analytics (Google Analytics 4)](/docs/api-reference/endpoints/ga-traffic).
</Note>

### Filters Parameter

The `filters` query parameter accepts URL-encoded JSON with dimensions and their selected values:

```
filters=[{"dimension":"channel","values":["Organic Search","Direct"]}]
```

Call `GET /integrations/posthog/filter-values` for the available dimension values.

***

## Filter Values

`GET /integrations/posthog/filter-values`

Get the available values for a given filter dimension (used to populate filter dropdowns). Pass `dimension` as a query parameter — one of `channel`, `referrer`, `campaign`, `deviceCategory`, `browser`, `os`, `page`.

***

## Traffic Chart

`GET /integrations/posthog/chart`

Get daily users, pageviews, sessions, and bounce rate for the selected date range — used to power the main trend chart.

***

## Top Pages

`GET /integrations/posthog/pages`

Get your most-viewed pages with visitor and engagement metrics.

***

## Page Counts

`GET /integrations/posthog/analytics`

Get page-level visitor counts across your site.

***

## Traffic Sources

`GET /integrations/posthog/sources`

Get your traffic sources — external referrers and their sessions and users.

***

## Traffic Channels

`GET /integrations/posthog/channels`

Get your traffic grouped into canonical channels (Direct, Organic Search, Referral, and more).

***

## Traffic by Country

`GET /integrations/posthog/countries`

See where your visitors are located geographically.

***

## Traffic by Device

`GET /integrations/posthog/devices`

See the device categories your visitors use.

***

## Traffic by Browser

`GET /integrations/posthog/browsers`

Break your visitors down by browser.

***

## Traffic by Operating System

`GET /integrations/posthog/os`

Break your visitors down by operating system.

***

## Campaigns

`GET /integrations/posthog/campaigns`

Get performance for your UTM-tagged marketing campaigns.

***

## Average Session Duration

`GET /integrations/posthog/avg-duration`

Get the average session duration with period-over-period comparison.

***

## New vs Returning Visitors

`GET /integrations/posthog/user-type`

See the split between new and returning visitors.


## OpenAPI

````yaml GET /v3/integrations/posthog/chart/
openapi: 3.0.0
info:
  title: SnowSEO API
  description: API documentation for SnowSEO
  version: 1.0.0
servers:
  - url: https://api.snowseo.com
    description: Production server
security: []
tags:
  - name: Keywords
    description: Keyword research and suggestion end-points
  - name: Onboarding
    description: Brand onboarding and strategy end-points
  - name: Brands
    description: Brand management end-points
  - name: Organizations
    description: Organization and member end-points
  - name: Integrations
    description: Google Search Console and other integrations
  - name: Utilities
    description: Common utility end-points like screenshots and uploads
externalDocs:
  url: https://snowseo.com/docs
  description: Find more info here
paths:
  /v3/integrations/posthog/chart/:
    get:
      tags:
        - PostHog
      summary: Get PostHog chart data
      description: >-
        Returns PostHog pageview analytics chart data (sessions, users,
        pageviews) per day.
      operationId: getPosthogChart
      parameters:
        - schema:
            type: string
          in: query
          name: teamId
          required: true
          description: Team ID
        - schema:
            type: string
          in: query
          name: days
          required: false
          description: Number of days to look back
        - schema:
            type: string
          in: query
          name: startDate
          required: false
          description: Start date (YYYY-MM-DD)
        - schema:
            type: string
          in: query
          name: endDate
          required: false
          description: End date (YYYY-MM-DD)
        - schema:
            type: string
          in: query
          name: country
          required: false
          description: Country filter
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          in: query
          name: filters
          required: false
          description: Additional PostHog property filters
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - chartData
                properties:
                  chartData:
                    type: array
                    items:
                      type: object
                      required:
                        - date
                        - sessions
                        - users
                        - pageviews
                      properties:
                        date:
                          type: string
                        sessions:
                          type: number
                        users:
                          type: number
                        pageviews:
                          type: number
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string

````