P
P
Pavel Ryabov2015-02-14 00:52:35
Yandex
Pavel Ryabov, 2015-02-14 00:52:35

How to set up Yandex.Metrica for A/B testing?

Good evening.
Has anyone tried using Yandex.Metrica to conduct A/B testing?
Yandex has a modest instruction about this -  help.yandex.ru/metrika/content/visit-params.xml following which I compiled a code similar to the example for 2 landing pages:

<script type="text/javascript">
var yaParams = {ab_test: var_1};
var yaCounter123456 = new Ya.Metrika({id: 123456, params:window.yaParams});
yaCounter123456.params(yaParams);
</script>
where you change only the var_1/var_2 parameter for one and the other pages.
As a result of testing, I received only a common data set for both pages on which the above code was installed.
Does anyone know what could be the problem, why Yandex.Metrica does not sort the received data into two categories of the A/B test?
PS: I don't think the principle of traffic distribution across 2 landing pages is important, but I'll still give it if it can be important
<script "type=text/javascript">var random = Math.random();if (random >= '0.5') {var rand = 1;}else {var rand = 2;};var ab_cookie = getCookie('ab_cookie');switch (ab_cookie) {case 'a':break;case 'b':redirectToB();break;default:if(rand == 1) {setCookie('ab_cookie', 'a', 3);}else {setCookie('ab_cookie', 'b', 3);redirectToB();}}function redirectToB() {window.location = “site.ru/index2.html”;}function setCookie(c_name, value, exdays) {var exdate = new Date();exdate.setDate(exdate.getDate() + exdays);var c_value = encodeURI(value) +((exdays == null) ? "" : ("; expires=" + exdate.toUTCString()));document.cookie = c_name + "=" + c_value;}function getCookie(c_name) {var i, x, y, ARRcookies = document.cookie.split(";");for (i = 0; i < ARRcookies.length; i++) {x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);x = x.replace(/^s+|s+$/g, "");if (x == c_name) {return decodeURI(y);}}}</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Tsyplakov, 2015-02-14
@grimich

Because visit parameters are visit parameters. A universal thing that can be used , including for tests.
View reports either in the "visit parameters" report, or select the traffic where the visit parameters are set through the report constructs.
Or, in metric 2.0, make segments according to the corresponding parameters of visits, and see all the data there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question