Add PostHog to Joomla

See where visitors drop off and what they do before they leave by adding PostHog product analytics to Joomla, using one HTML snippet.

Add PostHog to Joomla

Your page view counter says 400 people visited your pricing page yesterday, and that's all it can tell you. You still don't know where visitors gave up in your signup flow, which button visitors ignore, or what someone did right before leaving. PostHog answers those questions with funnels, session recordings and heatmaps. You can add PostHog to Joomla with one HTML snippet in Code Snippets.

Get your snippet

You need a PostHog account, on PostHog Cloud or your own server.

  1. Sign in to PostHog, or create an account and a project.
  2. Open your project settings.
  3. Copy the web snippet. It already holds your project token and your host, like https://us.i.posthog.com or https://eu.i.posthog.com.

The snippet code

Use the snippet exactly as PostHog gives it. It's one long script that ends with posthog.init('...', { api_host: '...' }). In the Site Header location it lands in the <head> of every page, and PostHog starts counting page views.

How to add this snippet

  1. Install Code Snippets if it isn't installed already.
  2. Log into your Joomla backend.
  3. Go to Components → Tassos Code Snippets.
  4. Click New.
  5. Enter a title, for example PostHog.
  6. Set Code Type to HTML.
  7. Set Insertion Method to Auto-Insert Locations.
  8. Set Location to Site Header.
  9. Paste your PostHog snippet into the editor.
  10. Click Save & Close.

Track a custom event

To count a specific action, like a completed signup, add a second snippet that runs only on the page visitors see afterwards:

posthog.capture('signup_completed', {
    plan: 'pro'
});
  1. Click New.
  2. Enter a title, for example PostHog signup event.
  3. Set Code Type to JavaScript.
  4. Set Insertion Method to Auto-Insert Locations.
  5. Set Location to Site Footer.
  6. Paste the code above into the editor.
  7. Change signup_completed and its properties to suit your event.
  8. Open the Conditional Logic tab:

    • Set Display on to Selected Pages.
    • Click New Condition Set.
    • Click Select Condition and choose URL - Query String.
    • In URL, enter a part of your thank you page's address, for example thank-you.
  9. Click Save & Close.

Check that it works

  1. Open your site in a normal browser window with no ad blocker.
  2. In PostHog, open Activity.

Your page view shows up within seconds, and your custom event when you reach that page. If nothing arrives, check that the snippet is published and that its host matches your project's region. PostHog skips visits from bots and automated browsers.

For free session recordings and heatmaps, see Add Microsoft Clarity to Joomla. To learn more, read the HTML snippet docs and the JavaScript snippet docs.

Last updated on Oct 15th 2026 18:10