> This page is for Glide Classic.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.glideapps.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.glideapps.com/docs/_mcp/server.

# PostHog

> Track user behavior and product analytics.

[PostHog](https://posthog.com/) is an open-source product analytics platform. With the PostHog integration, you can track custom events and user behavior in your Glide app.

> **Don't see the PostHog integration?**
>
> You may need to upgrade your plan. [Browse Glide's plans and find the right fit for you.](https://www.glideapps.com/pricing)

## Adding and Configuring the Action

To use the PostHog integration, you'll first need to set up a [PostHog account.](https://posthog.com/) Once you have a project API key, you can connect the project in Glide.

#### PostHog - Arcade 1

In **Glide**, click the **Settings** menu.

Find the [Integrations](/docs/automation/integrations) section and select PostHog.

Click **Add.**

You will need your PostHog project's **Project API Key** to track events. You can find it in your PostHog settings.

The **API Host** will default to [https://us.i.posthog.com](https://us.i.posthog.com), but depending on your PostHog region, you may need to change this. Your correct API Host can be found in your settings tab.

Under **Person Profiles**, choose either:

* **Identified Only**: Creates profiles only for users who have been explicitly identified in PostHog
* **Always**: Creates profiles for all visitors, including anonymous ones

## Track Event

The **Track Event** action allows you to send custom events to PostHog when users interact with your app.

The action can be added to a [Component](/docs/essentials/components) that supports Actions (e.g., a [Button component](/docs/essentials/components/button)), added to a workflow in the [Workflow Editor](/docs/getting-started/introduction-to-workflows#the-workflow-editor), or after a [Form](/docs/use-cases/forms) is submitted.

> **Analytics Events Only Work in Live Apps**
>
> Tracking custom events only works in live apps when triggered by a user. Note that when testing in the Glide builder, the action will not track data.

#### Layout Editor

#### PostHog -Arcade 2

Select the component you'd like to add the action to.

In the **General** tab on the right side of the Layout Editor, navigate to the **Actions** section and search for **Track Event** or navigate to **Integrations → PostHog → Track Event.**

* Note that there are other integrations that have a **Track Event** feature. Make sure to pick the correct one.

Name the action.

Choose an icon.

Enter an **Event Name** that describes the action being tracked.

Add values to track.

Click away to exit the configuration.

#### Workflow Editor

#### PostHog - Arcade 3

Select the plus (**+**) sign or the **+ New Workflow** button.

Choose a trigger.

In the **General** tab on the right side of the Layout Editor, navigate to the **Actions** section and search for **Track Event** or navigate to **Integrations → PostHog → Track Event.**

* Note that there are other integrations that have a **Track Event** feature. Make sure to pick the correct one.

Enter an **Event Name** that describes the action being tracked.

Add the values you want to send to PostHog.

Name your Workflow.

Click away to exit the configuration.

To learn more generally about Integrations in Glide, including how they affect your app's usage, check out our [Introduction to Integrations](/docs/automation/integrations).

## Frequently Asked Questions

#### Don't see the PostHog integration?

You may need to upgrade your plan.[ Browse Glide's plans and find the right fit for you](https://www.glideapps.com/pricing).

#### I ran the Track custom event action in the Layout Editor and the Action Editor, but I do not see any events in PostHog. What's wrong?

The Track custom event action will only fire when you open your published app in a browser.