Maxim Chechenev
Maxim Chechenev

Reputation: 120

JavaScript A/B testing with Google Analytics

I want to start A/B testing on some pages on my site. I will change some elements (buttons, text, images, etc.) by JavaScript code - so I don't want to create duplicates of every pages with changes. It is clear, but next I have a problem with measuring this tests - how I can see in Google Analytics which users have a one variant of test and which see another? I want to see all next actions of this users. Should I use custom variables in GA? I know, that, for example, https://www.optimizely.com/ can do all this things, but I just want to know how I can develop this by myself.

Upvotes: 1

Views: 761

Answers (1)

Philip Walton
Philip Walton

Reputation: 30461

It sounds like what you want is a Google Analytics feature called Content Experiments.

This article explains how to set this up on the client side using JavaScript:
https://developers.google.com/analytics/solutions/experiments-client-side

Upvotes: 1

Related Questions