This project is not covered by Drupal’s security advisory policy.
This module is part of the Analyze module ecosystem and included in DXPR CMS.
Your Analytics Data Belongs Next to Your Content, Not in Another Tab
You're editing a page. How many visitors did it get this month? Is traffic growing or declining? Right now you'd switch to PostHog, find the URL, and read a dashboard. With this module, that data lives on the Analyze tab: every entity, every metric, zero context switching.

You need Analyze PostHog if
- You use PostHog for product analytics (cloud or self-hosted) and want traffic data per page inside Drupal
- Your content team needs pageview, visitor, and session counts without leaving the CMS
- You want period-over-period comparison to spot trends at a glance
- You need to break down traffic by referrer, country, device, or browser for targeted content decisions
- You are building a marketing CMS and need analytics integrated directly into the editorial workflow
What You Get
-
Pageviews, visitors, sessions, and bounce rate per page
Every content entity shows its PostHog performance in the Analyze tab, with change vs the previous period (e.g., "113 pageviews, up 17.7%") so you see trends, not just numbers.
-
Dimension breakdowns
Drill into the full report to see where your traffic comes from and how it behaves:
- Referrer: which sites and campaigns send visitors to this page
- Country: geographic distribution of your audience
- Device: desktop vs mobile vs tablet breakdown
- Browser: Chrome, Firefox, Safari, and others

-
Flexible filters and date ranges
Switch between 7, 14, 28, or 90 day windows. Filter by status (new, up, down, lost), country, and text search to zero in on the data that matters.
-
Conversion attribution
Connect page visits to business outcomes. Define conversion goals (signups, purchases, form submissions) and see which pages drive the most conversions, with revenue tracking and period-over-period comparison.
-
Session replay link
Jump directly from the Analyze tab to PostHog's session replay, pre-filtered to the current page, and watch real users interact with your content.
-
Drush commands
Query analytics for any URL, view sitewide reports, check connection status, and clear the cache from the command line.
Getting Started
- Install with Composer:
composer require drupal/analyze_posthog - Enable the module and the Key module
- Create a PostHog personal API key with read access
- Store the API key at /admin/config/system/keys and configure your PostHog host and project ID at /admin/config/analyze/posthog
- Enable the analyzer per content type at /admin/config/content/analyze-settings
Prefer a turnkey demo site?
Spin up DXPR CMS: Drupal pre-configured with DXPR Builder, DXPR Theme, the full Analyze suite including PostHog integration, and security best practices out of the box.
Additional requirements
This module requires:
- Analyze module (>=1.1.0)
- Key module for secure API key storage
- A PostHog account (cloud or self-hosted) with a personal API key
Related Modules
- Analyze - Required parent framework that provides the Analyze tab and plugin system this module extends
- Key - Required for secure storage of the PostHog API key used by this module
- Analyze Search Console - Sibling Analyze plugin that adds Google Search Console data to the same Analyze tab
- Analyze Broken Links - Sibling Analyze plugin for broken link detection in the Analyze tab
Analyze PostHog is part of the Analyze suite included in DXPR CMS, a turnkey marketing CMS for Drupal that combines content analysis, a premium Drupal theme, and a drag-and-drop layout builder. See getting started or explore pricing.
| Attachment | Size |
|---|---|
| posthog_overview.jpg | 75.27 KB |
| posthog_referrers.jpg | 62.77 KB |
Project information
- Project categories: Integrations
- Ecosystem: Analyze, Posthog Analytics integration
2 sites report using this module
- Created by jurriaanroelofs on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Conversion attribution, plus fixes for HogQL escaping, multilingual/subdirectory URLs, and Analyze tab crash

