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

Rails AB testing with “split” gem: Negative numbers on non-finished…? #43

Closed
boazadato opened this issue Apr 2, 2012 · 10 comments
Milestone

Comments

@boazadato
Copy link

Usage is quite simple:

some_signin_view_file.erb:

<% signin_mode = ab_test( 'log in style','LogIn_ATest','LogIn_BTest' )%>
.
.
Do something according to signin_mode...
and
some_post_signin_controller_file.rb:

finished("log in style", :reset=> FALSE)
Did one simple test with no problems. However, my second test yield negative numbers on the non-finished columns, and only on the first experiment (marked as control).

How can it be negative...? Am i missing something?

[EDIT: remove a non working workaround that was here...]

see also http://stackoverflow.com/questions/9964357/rails-ab-testing-with-split-gem-negative-numbers-on-non-finished/9972546#9972546

@arcanoid
Copy link

arcanoid commented Apr 6, 2012

What happened to me in this case was that when a user clicked refresh on the page it finalized twice, giving it negative numbers.

As I understand the non-finished is calculated as "finished - participants".

@andrew
Copy link
Member

andrew commented Apr 6, 2012

When you use the :reset => false option there is nothing to stop the user from completing the same conversion again which currently counts towards the totals.

I suspect the desired behaviour when using :reset => false is that the user should not be able to increment the completion counter any more?

@ghost ghost assigned andrew Apr 6, 2012
@arcanoid
Copy link

arcanoid commented Apr 6, 2012

For me yes! That would make sense.

@boazadato
Copy link
Author

+1

@peppyheppy
Copy link

+1

@andrew, I think there should be a new config that specifies if a participant should be counted for multiple conversions. In some cases you would want to be able to see total real conversions, but in many other (funnels for example) I just want to know how many participants got to the goal. Does that make sense?

I might get around to adding this feature if its useful enough.

@andrew
Copy link
Member

andrew commented Apr 22, 2012

@peppyheppy I don't think we need another config option for this, if you are resetting the user then they will be counted for multiple conversions, otherwise they should always receive the same alternative and not increment any counters.

@swards
Copy link

swards commented Jul 31, 2012

Has there been progress on this issue?

@swards
Copy link

swards commented Jul 31, 2012

Looking a little further - even with :reset => true, the following line of code is not executing as expected. Line 31 in Split::Helper.rb

session[:split].delete(experiment_name) if options[:reset]

The session experiment is still there after calling finished('test'). One can work around this by resetting the session manually and the completed counts will no longer increment.

@apsoto
Copy link
Contributor

apsoto commented Aug 29, 2012

Clarififcation: This comment is about the previous comment where reset => true not reseting things
I've looked at the code and I think the root cause is that it's not being consistent when accessing the values in the session and not removing (reseting) the experiment from the session because it's using the wrong key.

In most places, the code access the session using

ab_user[experiment.key]

But in the finished method is using

session['split'].delete[experiment_name]

Therefore easy to miss, but it should at a minimum do

session['split'].delete(experiment.key)

but even better if it was consistent and did

ab_user.delete(experiment.key)

I'll try to put a patch together in the next few hours

@buddhamagnet
Copy link
Contributor

No further response on this, closing for now.

divineforest added a commit to divineforest/split that referenced this issue Jun 6, 2016
This fixes a major bug when negative non-finished numbers appear and simple random exception fired on dashboard.

The problem was with User#cleanup_old_experiments! method because it treats “experimen1:finished” key as a non-found experiment and just deletes it.

Related issues:

splitrb#43

splitrb#103

splitrb#133

splitrb#355

splitrb#294

splitrb#272
divineforest added a commit to procommerz/split that referenced this issue Oct 14, 2016
This fixes a major bug when negative non-finished numbers appear and simple random exception fired on dashboard.

The problem was with User#cleanup_old_experiments! method because it treats “experimen1:finished” key as a non-found experiment and just deletes it.

Related issues:

splitrb#43

splitrb#103

splitrb#133

splitrb#355

splitrb#294

splitrb#272
@andrew andrew removed their assignment Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants