Add hooks for Trial#choose! and Trial#complete! #176
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds two new attributes to Split.configuration,
on_trial_choose and on_trial_complete.
Set these attributes to a method name available in the
same context as the ab_test method. These methods should
accept one argument, a Trial instance.
For example:
The motivation for this is I want to store a user event when a user participates in an experiment, and when a user reaches an experiment's goal. I want to store this info somewhere besides redis, and do cohort analysis later on, where cohorts would be users who participated in a particular experiment alternative. Let me know what you think. I'm pretty new to this gem so there may be a cleaner way to do this that I'm missing.