assaf / vanity

Experiment Driven Development for Ruby
http://vanity.labnotes.org
MIT License
1.55k stars 269 forks source link

separate experiments report in dashboard #322

Open conquering-lion opened 7 years ago

conquering-lion commented 7 years ago

Hi,

first at all , thanks for this wonderfull gem !!

I use vanity to split test several landing page formulas and I would like to be able to separate results based on prefix experiments with a select where choose is made between existing experiments

my experiments and corresponding metrics are named like this

cp1.rb <=> :cp1_metric.rb
cp2.rb <=> :cp2_metric.rb

My controller

      render :file=>Vanity.template("_report"),:content_type=>Mime::HTML, :locals=>{
        :experiments=>Vanity.playground.experiments, # <= this is where I try to add constrains to keep only cp1% experiment
        :experiments_persisted=>Vanity.playground.experiments_persisted?,
        :metrics=>Vanity.playground.metrics
      }, :layout => false

thanks for your help :+1:

phillbaker commented 7 years ago

Hi @conquering-lion thanks for using vanity, glad it's been helping.

I'm not sure I understand the question, perhaps you could explaining it in a bit more detail or give some example data to show what you're currently seeing and what you're looking for?

conquering-lion commented 7 years ago

Hello,

thanks for your reply.

I can run many experiments named with prefix cp_n where n is the campaign number I have in my experiments folder files like cp_1.rb, cp_2.rb, cp_3.rb, ... I also can have cp_1_title.rb, cp_2_subheadline.rb, .. when ab testing different parts of a landing page

every corresponding metrics are also named with the same convention

I would like to be able in my report view to select only experiments and metrics related to one campaign and show only ab test from that campaign. In other words, I want to add a filter on vanity report to display experiment from one campaign that I choose (distinct by his prefix cp_n)

conquering-lion commented 7 years ago

Hi there,

i'm actually trying to make a custom dashboard by selecting my displayed experiments based on the experiment_id

Vanity::Adapters::ActiveRecordAdapter::VanityExperiment.all.each do |experiment| puts experiment if experiment.experiment_id.include?("campaign_1") end is working nice to separates my experiments, but I did'nt find how to do the same in the controller in order to get only experiment with experiment_id containing "campaign_1"

I will update when finding my answers :)