PostHog Analytics Skill for Openclaw

A powerful automation tool for programmatically creating, syncing, and exporting PostHog dashboards and insights via the PostHog API.

solomonneas
v1.2.0
Mar 21, 2026
0
753
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install posthog-analytics

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install posthog-analytics using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is PostHog Analytics Skill?

The PostHog Analytics Skill for Openclaw Skills empowers developers to treat their product analytics as code. By leveraging the PostHog Personal API, this skill automates the tedious process of manual dashboard creation, allowing for consistent reporting across different projects or environments.

Whether you need to deploy a standard set of blog metrics or sync complex event filters across multiple insights, this skill provides a robust CLI-driven approach. It ensures your data visualization stays in sync with your configuration files, reducing human error and accelerating the time-to-insight for data-driven teams.

PostHog Analytics Skill Use Cases

  • Automating the deployment of standard analytics dashboards for new product launches.
  • Syncing dashboard configurations across multiple PostHog projects or environments.
  • Version-controlling your analytics setup by storing dashboard definitions as JSON files.
  • Exporting existing PostHog dashboards into portable JSON formats for backup or migration.
  • Bulk updating filters and date ranges across dozens of insights simultaneously.

How PostHog Analytics Skill Works

  1. The user defines a dashboard configuration in a JSON file, specifying names, filters, and desired insight types.
  2. The skill authenticates with the PostHog API using a Personal API Key and targets the current project context.
  3. During the creation phase, the script initializes a new dashboard and maps the project and dashboard IDs back to the local config.
  4. For ongoing maintenance, the sync and update functions compare the local config against the live PostHog environment to add missing insights or modify existing ones.
  5. The tool generates direct UI links, allowing users to jump straight from the terminal to their visual data in the PostHog web interface.

PostHog Analytics Skill Setup

To begin using this skill with Openclaw Skills, ensure you have curl and jq installed on your system.

# Install jq if not present
brew install jq

# Set your PostHog API Key
export POSTHOG_PERSONAL_API_KEY=phx_your_key_here

# Verify connection to your project
curl -s -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  "https://us.i.posthog.com/api/projects/@current/" | jq '{id, name}'

PostHog Analytics Skill Data Schema & Taxonomy

The skill utilizes a structured JSON schema for defining analytics assets. Below is the primary configuration mapping:

Field Type Description
name String The display name of the dashboard in PostHog.
filter Object Event property filters (e.g., source: blog).
insights Array A list of insight objects containing type, math, and display settings.
dashboard_id Integer The unique ID assigned by PostHog, used for syncing and updates.

Insight Type Mappings

  • pageviews_total: Renders as a BoldNumber showing total counts.
  • unique_users: Tracks DAU/MAU trends.
  • traffic_trend: Generates a LineGraph for time-series analysis.

PostHog Analytics Skill Advanced Features

  • Automatic Config Injection: The skill writes the generated dashboard_id back to your source JSON file automatically after creation.
  • Multi-Region Support: Fully compatible with both US and EU PostHog instances via the POSTHOG_HOST environment variable.
  • Granular Insight Control: Customize math aggregations (total, dau, monthly_active) and date ranges per insight.
  • Idempotent Syncing: The sync command identifies existing insights by name to prevent duplicate creation during iterative updates.
  • Seamless Export: Convert any live dashboard into a reusable JSON template with a single CLI command.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*