# PostHog

> Sessions, pages, acquisition, events, and conversions from a connected PostHog project. Free.

Source: https://docs.indexzero.site/tools/posthog



These three tools read a PostHog project connected to the IndexZero project, by running HogQL over its sessions and events tables. They are **free** and read-only. They are the PostHog counterparts of the Google Analytics tools; use whichever the project has connected. Connecting is done in the dashboard with a personal API key; see [Integrations](/guides/integrations).

## Shared arguments [#shared-arguments]

| Argument               | Type                      | Required | Default          | Meaning                                                          |
| ---------------------- | ------------------------- | -------- | ---------------- | ---------------------------------------------------------------- |
| `projectId`            | string                    | yes      |                  |                                                                  |
| `channel`              | `organic_search` or `all` | no       | `organic_search` | Sessions PostHog attributes to organic search, or every channel. |
| `days`                 | integer, 1 to 365         | no       | 28               | Trailing window.                                                 |
| `startDate`, `endDate` | `YYYY-MM-DD`              | no       |                  | Explicit window.                                                 |

## `get_posthog_overview` [#get_posthog_overview]

Sessions, visitors, pageviews, bounce rate, and average session duration for the window, with the previous equal-length window for comparison and a daily trend.

Arguments: the shared set.

## `get_posthog_report` [#get_posthog_report]

Run one report.

| Argument               | Type                                                                                                    | Required                  | Default       | Meaning                                                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `kind`                 | `entry_pages`, `top_pages`, `exit_pages`, `traffic_acquisition`, `events`, `conversions`, or `audience` | yes                       |               | `entry_pages` is landing pages by session, `top_pages` by pageview.                                                              |
| `acquisitionBreakdown` | `channel`, `referring_domain`, `utm_source`, `utm_medium`, or `utm_campaign`                            | no                        | `channel`     | For `traffic_acquisition`.                                                                                                       |
| `audienceBreakdown`    | `device_type`, `country`, `browser`, or `os`                                                            | no                        | `device_type` | For `audience`.                                                                                                                  |
| `eventName`            | string, 1 to 200 chars                                                                                  | required by `conversions` |               | The PostHog event that counts as a conversion, for example `signup_completed`. Run the `events` report first to find real names. |
| `pathPrefix`           | string, up to 200 chars                                                                                 | no                        |               | Restrict to paths starting with this, for example `/blog`.                                                                       |
| `host`                 | string, up to 253 chars                                                                                 | no                        | every host    | Restrict to one hostname. Useful when the PostHog project has also seen localhost or staging traffic.                            |
| `limit`                | integer, 1 to 500                                                                                       | no                        | 100           |                                                                                                                                  |

Plus the shared arguments.

## `get_posthog_search_opportunities` [#get_posthog_search_opportunities]

Joins Search Console against PostHog to find pages that attract search traffic but under-convert, and queries with impressions that are not landing clicks. Requires Search Console and PostHog both connected.

| Argument    | Type              | Required | Default | Meaning                                                                                                                              |
| ----------- | ----------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `projectId` | string            | yes      |         |                                                                                                                                      |
| `eventName` | string            | no       |         | The conversion event. With it, under-performance means "ranks but never converts"; without it, the report falls back to bounce rate. |
| `days`      | integer, 1 to 365 | no       | 28      |                                                                                                                                      |
