Discourse Posthog Plugin

AI-generated summary

The Discourse Posthog Plugin, developed by christophdb, integrates Discourse with PostHog to track user events such as pageviews, topic and post creation, and likes. It supports anonymous tracking or user identification via email or SHA256-hashed emails through a custom Discourse endpoint. The plugin is easily installed via the Discourse plugin guide, with minimal configuration required—just set the posthog_api_key and instance URL. Key settings include options for identifying users, disabling surveys or session recordings, and setting cookie expiration. Events are visible in PostHog, with screenshots showing tracking of user actions like pageviews, topic creation, and user identification.

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.

:information_source: Summary Send events from Discourse to Posthog
:hammer_and_wrench: Repository Link https://github.com/christophdb/discourse-posthog
:open_book: Install Guide How to install plugins in Discourse

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://us.i.posthog.com or any proxy)
posthog_ui_host PostHog API UI URL (e.g. https://eu.posthog.com or 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.

Receive the events in PostHog

like identify

or topics created, …

image

4 Likes