> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/troubleshooting/a-b-tests.md).

# A/B tests

How to keep A/B tests on your website from making BugBug tests flaky: turn them off for BugBug IP addresses, skip the A/B script with a URL parameter, or force one version in the test.

A/B tests on the website you're testing can make your BugBug tests flaky: the website renders differently depending on the browser session and the version that was drawn. This is especially problematic for smoke tests on production.

There are a few ways to prevent this:

1. **Turn off A/B tests for specific IP addresses.** This is probably the easiest solution, but it depends on your A/B testing tool. Some tools can turn A/B tests off for chosen IP addresses. Turn them off for the [cloud runner IP addresses](https://docs.bugbug.io/troubleshooting/ips-list-of-cloud-runners.md) and, for local runs, for your own IP address.
2. **Skip the A/B testing script based on a query string parameter.** A/B tools are often loaded as custom JavaScript through Google Tag Manager. Add a parameter such as `?bugbug=1` to the Go to URL steps in your tests, and don't load the A/B script when this parameter is present.
3. **Force the A or B version in the test.** This requires some development knowledge. A/B testing tools store the drawn version in cookies or local storage. Check in DevTools which cookie or local storage item your tool sets, and set it at the start of your test with [Custom JavaScript](https://docs.bugbug.io/editing-tests/custom-javascript-actions.md#javascript-steps), so the test always gets the same version.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/troubleshooting/a-b-tests.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
