Using Custom Events For A/B Testing

Leverage LogRocket.track to track your experiments

LogRocket custom events are a great way to track which version of your test a user experienced during their session. Call LogRocket.track with your A/B test details so LogRocket can help you understand which versions are performing best. Once these A/B details are associated with your users' sessions, LogRocket's AI will be able to surface trends, create analytics, and provide suggestions related to your test.

An example of how this might look:

LogRocket.track('checkout_version', {
  variant: 'B',
  checkoutType: 'one-click',
});