# Source: https://docs.intelligems.io/analytics/custom-events/using-custom-events-in-experiment-analytics.md

# Using custom events in experiment analytics

Custom events can be used in two ways in experiments analytics:

1. To measure the % and number of visitors who triggered the event during the experiment
2. To filter to visitors and sessions who triggered the event during the experiment

In either case, to use a custom event in an experiment, you need to add that event as a "Custom Metric" in experiment setup, during the "Configure Analytics" step. As long as the event was created before the experiment started, you can also do this even after an experiment started. "Page visit" type events can be added at any time, they can even be created after an experiment has started (see more on this distinction [here](https://docs.intelligems.io/analytics/custom-events/overview)).

To add an event to an experiment as a custom metric, go to the "Configure Analytics" step, and click "Add Custom Metric":

<figure><img src="https://2052204893-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2SvefuMLsJyJPAcVXeWc%2Fuploads%2Fgit-blob-d96c460c59acea3bf4cabe741102299c41514358%2Fcustom_metric_experiment.png?alt=media" alt=""><figcaption></figcaption></figure>