clever-raincoat-59796
04/22/2026, 2:18 PMastonishing-engineer-93454
04/22/2026, 8:05 PMclever-raincoat-59796
04/23/2026, 6:45 AMastonishing-engineer-93454
04/23/2026, 8:07 AMclever-raincoat-59796
04/23/2026, 8:36 AMclever-raincoat-59796
04/23/2026, 8:36 AMastonishing-engineer-93454
04/23/2026, 10:58 AMastonishing-engineer-93454
04/23/2026, 11:06 AMclever-raincoat-59796
04/23/2026, 2:46 PMclever-raincoat-59796
04/23/2026, 2:46 PMclever-raincoat-59796
04/23/2026, 2:47 PMastonishing-engineer-93454
04/23/2026, 5:25 PMcart_is_open = true and instantly trigger your experiment code.
How to explain it to the client/developer
You don't need to write the code yourself. Just tell their developer this:
> "The experiment targets an attribute that changes after the page loads (when the cart opens). Can you trigger growthbook.setAttributes inside the cart-toggle function so the SDK re-evaluates the rules when the state changes?"
Once the developer adds that "poke," you just need to make sure your experiment settings look like this:
⢠Targeting: Set it to run on "All Pages" (since the cart can appear anywhere).
⢠Condition: Add a rule where isCartOpen (or whatever the attribute is named) equals true.
Why this works:
Imagine GrowthBook is a security guard checking IDs at the front door (page load). If someone puts on a hat (opens the cart) inside the building, the guard won't notice. This fix tells the guard to look at the person again every time they touch their hat.
Does the client have a developer available to add that one line of code to the cart component?astonishing-engineer-93454
04/23/2026, 5:44 PMgrowthbook.setAttributes({...growthbook.getAttributes(), cart_open: true});