Include metrics when duplicating an experiment
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 222
Description
Feature request
Is your feature request related to a problem?
No
Describe the solution you'd like
A user has requested the ability to create an experiment that can be duplicated and reused by simply changing the feature flag. This would mean duplicating as is currently done, but also duplicating the metrics for the experiment. The intention is to create a template that can be easily reused for multiple experiments in a fast and efficient way.
Describe alternatives you've considered
Adding the metrics and duplicating the metric itself.
Creating shared metrics that can be added to multiple experiments.
Additional context
Implementing templates may be an option as well, but expanding duplication might be a faster solution in the short term.
Debug info
- [x] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing experiment duplication flow and how experiment metrics are associated. Identify the relevant models, API entry points, and tests before deciding whether duplication should include metric definitions or references. Done means a duplicated experiment reliably has the intended metrics and existing duplication behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100