Permalink
Browse files

+ Make it a little easier to reach the Goal. (path changed to IN rath…

…er than EQUAL)
  • Loading branch information...
1 parent 89a09df commit 0c2444636db2b00b25a23ad62e4b8ac7e43690bd @johnboxall committed May 19, 2009
Showing with 42 additions and 7 deletions.
  1. +36 −4 README.md
  2. +1 −1 abs.py
  3. +5 −2 models.py
View
@@ -48,13 +48,45 @@ Usage
Test.objects.create(template_name="index_2.html", experiment=exp)
5. Profit.
+
+
+Advanced
+========
+
+ 1. Manually run an A/B test on a view:
+
+ def view(request, template_name="original.html"):
+
+ try:
+ ab_template_name = request.ab.run(template_name)
+ except TemplateDoesNotExist:
+ ab_template_name = template_name
+
+ return render_to_response(template_name)
+
+Tips
+----
+
+Decide ahead of time what you are A/B testing - introductions of new designs are a great time to run your first test. Plan ahead of time and duplicate your templates / css / js / images so you don't have to hunt through version control to find the right ones later.
Notes
-=====
+-----
+
+ 1. The current implementation uses a thread locals to stash the request object for use in places it isn't normally available.
+
+ 2. The current implementation is not compatible with Django's built in caching.
+
+ 3. The current implementation requires you to use Django Sessions.
-1. The current implementation uses a thread locals to stash the request object for use in places it isn't normally available.
-2. The current implementation is not compatible with Django's built in caching.
+ToDo
+----
-3. The current implementation requires you to use Django Sessions.
+ 1. Add A/B aware CacheMiddleware
+ 2. Rethink ab.abs.AB interface.
+ 3. De-couple AB from request/session object? Would be interesting to run it on e-mails etc.
+ 4. Add a way to force the display of specific templates (for designers etc.)
+ 5. What if a browser has disabled cookies? What's the fallback?
+ 6. Add some way to ignore hits and conversions (eg. internal/logged in etc.)
+ 7. Expanded conversion maybe to a regex? or something else that account for variations of pages
View
2 abs.py
@@ -23,7 +23,7 @@ def is_converted(self, exp):
hasn't already been converted.
"""
return self.is_experiment_active(exp) and not self.is_experiment_converted(exp) \
- and self.request.path == exp.goal
+ and exp.goal in self.request.path
def is_experiment_active(self, exp):
"""True if this Experiment is active."""
View
@@ -1,5 +1,6 @@
from django.db import models
+
class Experiment(models.Model):
"""
@@ -22,8 +23,10 @@ class Test(models.Model):
experiment = models.ForeignKey(Experiment)
template_name = models.CharField(max_length=255,
help_text="Example: 'registration/signup_1.html'. The template to be tested.")
- hits = models.IntegerField(blank=True, default=0)
- conversions = models.IntegerField(blank=True, default=0)
+ hits = models.IntegerField(blank=True, default=0,
+ help_text="# uniques that have seen this test.")
+ conversions = models.IntegerField(blank=True, default=0,
+ help_text="# uniques that have reached the goal from this test.")
def __unicode__(self):
return self.template_name

0 comments on commit 0c24446

Please sign in to comment.