# Discourse Posthog Plugin

**URL:** https://meta.discourse.org/t/discourse-posthog-plugin/394116
**Category:** Plugin
**Created:** [January 22, 2026, 4:43pm UTC](https://meta.discourse.org/t/discourse-posthog-plugin/394116 "2026-01-22T16:43:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![christophdb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christophdb/32/352203_2.png) [@christophdb](https://meta.discourse.org/u/christophdb)
#### Post date: [January 22, 2026, 4:43pm UTC](https://meta.discourse.org/t/discourse-posthog-plugin/394116/1 "2026-01-22T16:43:24Z")

</div>

This plugin integrates Discourse with PostHog, sending events like pageviews, topic/post creation, and likes. It supports anonymous tracking, email-based identification, or SHA256-hashed emails via a custom Discourse endpoint.

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Send events from Discourse to Posthog |
| 🛠 | **Repository Link** | [https://github.com/christophdb/discourse-posthog](https://github.com/christophdb/discourse-posthog) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### Features

- **Track Events** : pageview, pageleave, create topic, create post, like/unlike post
- **Identify User** : you decide if you “identify” the user. This is a posthog term and means that you can either send anonymous events or events that are connected to a person in posthog.
- **Privacy levels of the event tracking** : use either anonymous, user email or hashed email

### Configuration

There is no much configuration needed. You have to **activate the plugin** and provide at least your `posthog_api_key` and select your posthog instance.

After the next page load, you will see new events in your PostHog project.

### Settings

| Name | Description |
| --- | --- |
| posthog\_api\_host | PostHog API Host URL (e.g. [https://eu.i.posthog.com](https://eu.i.posthog.com), [https://us.i.posthog.com](https://us.i.posthog.com) or any proxy) |
| posthog\_ui\_host | PostHog API UI URL (e.g. [https://eu.posthog.com](https://eu.posthog.com) or [https://us.posthog.com](https://us.posthog.com)) |
| posthog\_api\_key | PostHog project API key |
| posthog\_identify\_user\_by | User identification in PostHog |
| posthog\_feature\_disable\_surveys | Disable PostHog surveys |
| posthog\_feature\_disable\_session\_recording | Disable PostHog session recording |
| posthog\_cookie\_expiration\_in\_days | Cookie expiration (in days) |
| posthog\_api\_version | PostHog `defaults` value |

### Screenshots

See the events in the browser console. You have to enable `verbose logging`.

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/f/0/2f0602e5c7db09c1f08e204e8861d2bcdabce201.png)

Receive the events in PostHog

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/7/8/278ea81f2c909b999e9bbcc65cdcbac6840c4557.png)

like identify

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/4/6/346001e765f3e6ccf0d6f90850c5392e7b9aecb1.png)

or topics created, …

![image](https://global.discourse-cdn.com/meta/original/4X/1/9/b/19b38feb6bbd1168031f4a1f29f8e17c30148303.png)
