What is the _gaexp cookie?
_gaexp is an HTTP cookie set by Google Optimize, Google's tool for A/B testing and content personalization, usually deployed through Google Analytics (gtag.js) or Google Tag Manager. It is placed by the provider's script rather than by the site itself, but appears on the visited site's domain (a first-party cookie from the browser's perspective).
The cookie appears whenever an active Optimize container runs on the site, typically as soon as the page loads and the experiment script executes, regardless of whether the visitor interacts with the page.
What data it stores
_gaexp stores information about the active experiment (A/B test) for that visitor: an experiment identifier, the assigned variant (for example the original or one of the tested variations), and the inclusion/exclusion status for that experiment. The exact value format may vary and is not publicly documented in detail by Google.
The data is sent to Google's servers, where it is linked to the Google Analytics identifiers used to report each variant's performance.
What it is used for
The purpose of _gaexp is purely statistical: it ensures a visitor sees the same experiment variant across multiple visits for as long as the cookie is valid, and it lets Google Optimize calculate test results (conversion rates, behavior) based on this consistent assignment.
For the site owner, this cookie underpins decisions about optimizing content or design — without it, A/B tests would produce inconsistent or unmeasurable results.
Does it require consent?
- Category: statistics (analytics), per CookieFix classification.
- Since it is not strictly necessary for the site to function, _gaexp falls under Article 5(3) of the ePrivacy Directive (2002/58/EC) and the GDPR — it requires the visitor's prior, informed and freely given consent before being set.
- The site owner must disclose this cookie in the cookie policy, classify it correctly under the „statistics” category in the consent banner, and ensure the Google Optimize script does not fire before consent is given.
How to block or delete _gaexp
A visitor can delete or block _gaexp through their browser's cookie settings (Chrome, Firefox, Edge, Safari), including selectively removing cookies for the domain in question, or by enabling a tracking blocker. Anti-analytics browser extensions can also prevent the Optimize script from loading in the first place.
For the site owner, blocking needs to happen technically, not just on paper: a CMP like CookieFix can automatically stop the Google Optimize script from executing until the visitor consents to the „statistics” category, preventing the _gaexp cookie from being set prematurely.
Frequently asked questions
It's a cookie set by Google Optimize to remember which variant of an A/B test a visitor is assigned to, so the experience stays consistent throughout the test.
It typically lasts 90 days, though this can vary depending on the experiment's configuration.
Yes, since it's a statistics/analytics cookie used for testing, it requires the visitor's prior consent under the ePrivacy Directive and GDPR.
By configuring a CMP that stops the Google Optimize/gtag.js script from running until the statistics category is accepted, rather than just listing it in the cookie policy.