Problem
A product team assigns users to A/B variants inside its own application. Google Analytics only receives raw events, so it cannot split clicks and visits by variant. The team then cannot compare conversion between the old and new design or say how large the effect is. Trendyol faced this on its TrendyolAds seller panel, where up to three tests ran at the same time.
Example from the article: two versions of the "create new ad" button on the advert listing page, compared over one month using daily Google Analytics exports.
Solution in brief
The app stores the assignment as a string TestName_RandomValue in the session. Google Tag Manager (GTM) reads it with custom JavaScript variables, turns the random value into a named variant and sends it to Google Analytics as a custom dimension. Daily sessions and clicks per variant are then exported, and a 95% confidence interval is put on the relative lift in conversion.
Questions this case answers
- How to attribute product analytics events to experiment variants when assignment happens in the application and the analytics tool only sees raw events
- How to estimate the relative lift of a UI variant and its uncertainty from daily per-variant session and click counts
- How to see which A/B variant each user belongs to inside Google Analytics when assignment is made in the app?
- How to turn a random bucket value stored in the session into a named variant with Google Tag Manager?
Tools and methods
- A/B test — old and new button design compared on click conversion
- Google Tag Manager — custom JavaScript variables that read the assignment from the session and name the variant
- Google Analytics (Analytics 360) — custom dimensions and custom reports filtered by variant
- Firebase Cloud Messaging — mobile apps: send events with custom dimensions, no GTM needed
- Microsoft Excel — daily table with conversion, lift and the 95% confidence interval
Google or a one-time email code. No password.