PHP Experiments installation
- 1
Install the package
RequiredInstall the PostHog PHP library using Composer:
Terminal - 2
Configure PostHog
RequiredInitialize the PostHog client with your project token and host:
PHP - 3
Implement your experiment
RequiredExperiments run on top of our feature flags. You can define which version of your code runs based on the return value of the feature flag:
Note: Server-side experiment metrics require you to manually send the feature flag information. See this tutorial for more information.
- 4
Run your experiment
RequiredOnce you've implemented the feature flag in your code, you'll enable it for a target audience by creating a new experiment in the PostHog dashboard.
- 5
Next steps
RecommendedNow that you're running experiments, continue with the resources below to learn what else Experiments enables within the PostHog platform.
