This article helps you:
Understand what variant jumping is, and what you can do about it
Variant jumping occurs when a user is exposed to two or more variants for a single flag or experiment. Variant jumping above a certain threshold may be cause for concern around the trustworthiness of an analysis.
Some types of variant jumping are normal, in that they're somewhat common and usually explainable. Other types are more difficult to track down.
The best way to debug variant jumping is to identify a user who has jumped variants, and analyze their user timeline. If you're using remote evaluation, check the Assignment
event to identify assignment vs exposure discrepancies.
To find a user who has jumped variants, follow these steps:
It's often helpful to only show assignment and exposure events in the user timeline.
When debugging a user timeline, keep these things in mind:
Normal variant jumping may occur due to:
Taking the following actions may cause a user to jump variants:
Enabling sticky bucketing before making targeting changes prevents variant jumping. However, sticky bucketing may cause a sample ratio mismatch (SRM).
The way Amplitude handles anonymous users can sometimes lead to variant jumping. Specifically, Amplitude merges anonymous IDs with the correct existing user IDs (if one exists) as soon as it has enough information to do so. This may happen if a user uses your app on different devices without logging in, or if the device ID regenerates upon logout.
Learn more about Amplitude's identity resolution and merging users.
To identify this type of variant jumping, look for the assignment event where the user jumped between variants. Then compare the value of the Amplitude ID for both events. If it's different for both events, it's probably the result of anonymous identity merging.
To avoid this type of variant jumping, consider bucketing by user ID if you're only targeting logged-in users who have user IDs, or by device ID if you're only targeting anonymous users (you might do this for a sign-up experiment).
Imagine you have some user IDs in the inclusion list. You call fetch()
and pass the user ID in to the call. This returns the control experience, per the inclusion list. But the next time you call fetch()
, you don't pass in the user ID. Now the user doesn't meet the inclusion list criteria, so Amplitude hashes the bucketing key, and the user may see a different variant instead. The same thing can happen if you include device IDs.
In this example, the user has a user ID. They match the inclusion list and get the signin-up-new_design
experience.
In this example, there is no user ID. The user doesn't match the inclusion list, is included in the "all other users" segment, and gets the signin-up-original-view
experience instead.
Instances of abnormal variant jumping don't fit with any of the normal explanations. They can be difficult to track down. However, the most frequent cause is some form of identity mismatch, specifically when the user identity differs between assignment and exposure tracking. This is almost always due to an implementation inconsistency.
Here are some examples of abnormal variant jumping. It's not an exhaustive list, but it should get you thinking about how best to use identity in your systems and Amplitude Experiment.
Consider this timeline for a person with multiple user accounts (U1 and U2), for your app on a single device.
treatment
for experiment-1
.experiment-1
variant treatment
for U1.experiment-1
variant treatment
for U2.control
for experiment-1
.experiment-1
variant control
for U2.In this case, user U2 has jumped variants, from treatment
to control
due to being exposed to U1's stored variant. To avoid this, either wait for the fetch to resolve before rendering the user experience, or call the SDK's clear()
method on logout to clear all stored variants from the SDK. Clearing variants wipes the SDK's variant storage, and ensures that the user isn't exposed to cached variants. It doesn't protect the user from viewing a fallback experience before the fetch request resolves.
If you keep a consistent device ID across logins, you can easily check for this type of variant jumping by searching for different users with the same device ID.
In Amplitude, the user ID and device ID properties are essential to identify your user and resolve their Amplitude ID. If the device ID or user ID used to fetch and evaluate assignments is different from the device ID and user ID used to track the exposure event, you may see variant jumping, SRMs, and inconsistent or unexpected bucketing behavior.
For example, you may be sending events through a proxy or CDP that masks IDs before sending to Amplitude. In this case, the identity used to fetch variants would be different from the identity included in the exposure events.
Another common case is simple overlooked implementation error. For example, the following cases have caused variant jumping:
15a4f7e9-db4e-4c57-82c7-e57a2995803a
"15a4f7e9-db4e-4c57-82c7-e57a2995803a"
15a4f7e9-db4e-4c57-82c7-e57a2995803a
15A4F7E9-DB4E-4C57-82C7-E57A2995803A
As you analyze results, be careful when you remove data, as you may introduce bias in your results. It's better to understand the cause of variant jumping and fix any implementation bugs, so this doesn't happen again in future experiments. If you feel that removing users who jumped variants is the best course of action, click All Exposed Users and enable Exclude users who variant jumped.
Thanks for your feedback!
July 1st, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.