Storefront Data Reference
How to read active test and variation data from window.eab_data and cookies on the storefront, for building custom integrations.
Reading Experiment Data on the Storefront
1. Where the data lives
Source
What it holds
2. window.eab_data
window.eab_datawindow.eab_data = {
allTests: { /* keyed by testId — see §3 */ },
selectors: { /* internal CSS/selector config used by our scripts */ },
currencyFormat: "${{amount}}", // store money format string
environment: {
rootUrl: "/",
themeId: 123456789,
themeRole: "main",
activeCurrency: "USD", // current presentment currency
template: { suffix: "", type: "product" },
isThemePreview: false,
customerData: { // present if a customer is logged in
loggedIn: true,
id: 987654321,
ordersCount: 3,
totalSpent: "1500.00",
tags: "vip"
}
}
};3. window.eab_data.allTests
window.eab_data.allTests3.1 allTests[testId].data — test metadata
allTests[testId].data — test metadataField
Meaning
3.2 allTests[testId][variationId] — a variation
allTests[testId][variationId] — a variationField
Meaning
3.3 Finding a test ID and variation ID by name
4. Cookies — which variation is THIS visitor in?
Cookie
Shape
Meaning
5. Notes & caveats
A note on custom-code experiments
Last updated