Install experiments with PostHog

Last updated:

|

Get started with experiments by installing one of the PostHog SDKs.

Since feature flags are not supported yet in our Java and Rust SDKs, to run an experiment using these SDKs see our docs on how to run experiments without feature flags. This also applies to running experiments using our API.

Questions? Ask Max AI.

It's easier than reading through 793 pages of documentation

Community questions

Was this page useful?

Next article

Javascript Web experiments installation

Once PostHog is initialized, you should be able to capture events. For your experiment to be meaningful, we need to capture an event that we want to measure, such as a conversion event. For this tutorial, let's capture a conversion event on a <button id="cta"> click. Use the PostHog SDK to call the experiment flag and change the <button id="cta"> text based on the assigned variant. Now when a user triggers a cta clicked event, PostHog automatically assigns the user to a variant and…

Read next article