Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Multi metric support for ab tests (using redis) #318

Closed
wants to merge 5 commits into from

Conversation

sdhull
Copy link
Contributor

@sdhull sdhull commented Nov 30, 2016

This is really a WIP PR because I only implemented the support for redis adapter. I have neither the time nor the inclination to get this working for mongo & AR, though I was careful not to break those adapters.

You can feel free to drag this across the finish line, as I am allowing edits from vanity maintainers. This also may be useful for others who are struggling with similar problems (eg, tracking funnel conversion with experiments).

Improvements:

  • track each metric conversion separately for a given ab test [redis only]
  • show conversions per metric on the dashboard [redis only]
  • show unique & "total" conversion counters on dashboard ("total" previously completely hidden & unused afaict)
  • make the dashboard full width
  • fixes "total" conversion tracking to respect the implicit param (eg, if you are tracking "dollars added to cart", this is being tracked in current vanity release regardless of whether or not that conversion was done by a participant in your experiment)

This makes it so the "total conversion count" (as opposed to unique converted participant count) will only be tallied for participants (or implicit conversions), thus making it behave similarly to how unique participant conversions are tallied.
Coincidentally, also fixes active record conversion counting (previously it treated conversions as implicit even though the argument defaults to false).
@phillbaker
Copy link
Collaborator

phillbaker commented Dec 1, 2016

@sdhull thanks for the PR, it'll take me a couple of days to review, but this is awesome! It's good work toward a solution for #230.

This doesn't actually provide real multi-metric support for mongo & ar adapters, but does allow them to continue to be used as they always were previously.

Also update abstract_adapter to better reflect how things are passed around.
Copy link
Collaborator

@phillbaker phillbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hard work on this, sorry for the slow response. In order to get this merged, a few things would make it easier for other consumers of vanity to adopt:

  • backwards compatibility
  • for new functionality, just raising an error in the adapters that don't have support yet (ie don't override the error returned from AbstractAdapter)
  • update the failing tests to account for any changes
  • covering the new functionality with reasonable tests

I'll try to put some time towards this over the holidays, but leaving the PR open is great so that if other folks come along and can help they can pick up wherever it's left.

@@ -16,3 +16,4 @@ html
.rvmrc
.ruby-version
.ruby-gemset
tags
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, if you're generating ctags via an editor plugin, what do you think about putting this in a global gitignore in your home directory instead of per project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang sad I only just saw this suggestion -- it's brilliant

@@ -48,72 +48,81 @@ def destroy_metric(metric)

# -- Experiments --

def experiment_persisted?(experiment)
def experiment_persisted?(experiment_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this would be a breaking, non-backward compatible change, can we pull this change into a separate PR? When these changes are made, we also should be included backward compatible code, for example, see #317. What do you think about keeping these methods accepting experiment for this PR?

@@ -1,3 +1,5 @@
.vanity { width: 90%; margin: 2em auto; font-family: "Helvetica Neue", "Helvetica", "Verdana", sans-serif }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to almost-full width and other style changes would also be great to pull into a separate PR.

# Keep in mind that "converted" is unique conversions while "conversions" is a total tally (or
# you could set it up to track dollar sales or something like that)
# only really supported for redis adapter
def ab_counts_by_metric(experiment, alternative)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this new method to doc/adapters.textile? We wouldn't need to include which adapters support it there.

@@ -122,23 +131,23 @@ def ab_assigned(experiment, identity)
# true, add particpant if not already recorded for this experiment. If
# implicit is false (default), only add conversion is participant
# previously recorded as participating in this experiment.
def ab_add_conversion(experiment, alternative, identity, count = 1, implicit = false)
def ab_add_conversion(experiment_id, alternative, identity, options={})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to condense these into a options parameter, but we'll probably have to make this change in a backwards compatible manner as well, see #317 for an example of that.

@phillbaker phillbaker mentioned this pull request Oct 13, 2018
@bensheldon
Copy link
Collaborator

Closing this for inactivity. Please comment/reopen if you'd like to pick it back up.

@bensheldon bensheldon closed this Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants