Some CLI commands for when you're building PostHog locally.
Note: The script initially couldn't write to PostHog running on localhost:8000. I commented out # ::1 localhost in /etc/hosts and it worked. Not sure why!
- Create a new experiment through the PostHog web interface. For example, "Daniel Funnel Experiment Nov 12 v2" with a feature flag of "daniel-funnel-experiment-nov-12-v2"
- Send the initial events for the experiment:
daniel-posthog-tools mock-experiment-events funnel daniel-funnel-experiment-nov-12-v2 --send-initial-events - Wait a moment for PostHog to digest the events.
- If you're not quite sure whether the event showed up, copy the unique hash from the distinct ID and search for the user under "People & groups".
- For a funnel experiment, set
$pageviewas the first conversion goal step, and[daniel-funnel-experiment-nov-12-v2] signupas the second conversion goal step. - Launch the experiment, and then set the start date to two weeks prior.
- Run
daniel-posthog-tools mock-experiment-events funnel daniel-funnel-experiment-nov-12-v2to populate some data. It's safe to run multiple times.
Other notes:
- If you run
daniel-posthog-tools mock-data-warehouse-experiment, you'll need to run the temporal server to injest the data warehouse table after you generate all of the events. You'll also need to manually run a sync.