Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieve test variation id #5

Open
ziozec-zz opened this issue May 12, 2014 · 1 comment
Open

retrieve test variation id #5

ziozec-zz opened this issue May 12, 2014 · 1 comment

Comments

@ziozec-zz
Copy link

Hi all,
is there a way to retrieve variation id for a test?

$test = new Test('homepage_color', array(
'white' => 1,
'black' => 1,
'yellow' => 1,
));

$test->getVariation(); // black

$test->getVariationId(); // 2

It should be useful in case of multivariation test to obtain a cross test unique id (tracking + analytics purpose).

Thanks,
Fabio

@jangaraev
Copy link

From the source code of \Namshi\AB\Container it's seen that internally it maintains an array of tests by their names as a key. So there are no IDs ready to use.

It's possible to overload the class and implement IDs relatively easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants