Skip to content

Instantly share code, notes, and snippets.

@flivni
Created April 1, 2026 01:17
Show Gist options
  • Select an option

  • Save flivni/2549cec29fe1be169c6e7bf0023b483f to your computer and use it in GitHub Desktop.

Select an option

Save flivni/2549cec29fe1be169c6e7bf0023b483f to your computer and use it in GitHub Desktop.
Schedulista PostHog Analytics Schema

PostHog Analytics Schema

Integration Overview

  • PostHog Project Key: phc_tUr6ru3ra8xvPyYhrpqkPxzdKWESzutzwQarijsvepXH
  • API Host: https://us.i.posthog.com
  • Environment: Production only
  • EU Exclusion: Uses geojs.io to detect user country; PostHog is not loaded for EU/EEA/UK users (GDPR). Country is cached in localStorage.
  • Safe wrapper: All event capture calls use posthogCapture() which no-ops if PostHog is not loaded.

Person Properties

Set via posthog.identify() on every page load.

Property Example Notes
email jane@salon.com Provider's email
business_id 42 Foreign key to business
created_at 2025-03-15T10:30:00Z User account creation date (ISO8601)

Distinct ID format: provider_{id} (e.g., provider_123)

Group: Business

Set via posthog.group() on every page load. Group type: business.

Property Example Notes
name Acme Salon Business name
status active_trial Business status (pre_trial, pre_setup, active_trial, active, etc.)
category beauty:hair Business category, may be empty
created_at 2025-01-10T08:00:00Z Business creation date (ISO8601)

Group key format: business_{id} (e.g., business_42)

Super Properties (on every event)

Set via posthog.register() on every page load.

Property Type Notes
source string Business acquisition source (e.g., ad:capterra, referral:word-of-mouth:link)
is_mobile_app boolean true if request has mobile_app_version param
mobile_app_platform string android, ios, or empty string. Detected via user agent.

Setup Wizard Events

Fired from app/assets/javascripts/settings/setup.js. All include wizard_version property.

setup_wizard_started

Fired when the setup wizard page loads.

Property Type Notes
wizard_version integer Current version: 1
resumed_at_step string Step the user is resuming at (if returning to a partially completed wizard)

setup_wizard_step_completed

Fired each time the user clicks "Save" on a wizard step.

Property Type Notes
wizard_version integer Current version: 1
step string One of: time_zone, work_hours, business_category, services

setup_wizard_completed

Fired when the user clicks the final "Continue" to complete the wizard and start their trial.

Property Type Notes
wizard_version integer Current version: 1

Funnel Definition

To build the setup wizard funnel in PostHog:

  1. setup_wizard_started
  2. setup_wizard_step_completed where step = time_zone
  3. setup_wizard_step_completed where step = work_hours
  4. setup_wizard_step_completed where step = business_category
  5. setup_wizard_step_completed where step = services
  6. setup_wizard_completed

Useful breakdowns: source, is_mobile_app, mobile_app_platform, wizard_version

Key Files

File Purpose
app/views/shared/_posthog_tracking.html.erb PostHog init, identify, group, register
app/views/layouts/backend.html.haml Renders the tracking partial
app/assets/javascripts/settings/setup.js Wizard funnel events
app/controllers/settings_controller.rb Passes step names to JS via gon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment