简体   繁体   中英

What's the best way to A/B test Email Subject Lines in Rails?

I'm sending out a lot of emails in my latest rails app. I want to A/B test subject lines in the emails that go out. ideally i can capture two things.

1- open rate 2- whether the call to action in the email is clicked

any ideas on how to do this? i don't think (the great) 7 minute abs ( http://github.com/paulmars/seven_minute_abs/tree/master ) will do this because @subject is set in the model, while the ab test param for the querystring is assigned in the view, and the test versions will likely be different.

thanks!

The Vanity gem also includes A/B testing support for emails, see the documentation . It has built in support for splitting content and measuring results via tracking pixels (images).

For example, creating the experiment:

ab_test "Invite subject" do
  description "Optimize invite subject line"
  alternatives "Join now!", "You're invited to an exclusive event."
  metrics :open
end

Splitting users in the email:

class UserMailer < ActionMailer::Base 
  def invite_email(user)
    use_vanity_mailer user
    mail :to => user.email, :subject =>ab_test(:invite_subject)
  end
end

And measuring the result via a tracking pixel:

  <html>
    <body>
      <h1>Hey Joseph</h1>
      <p>
        <%= vanity_tracking_image(Vanity.context.vanity_identity, :open, :host => "127.0.0.1:3000") %>
      </p>
    </body>
  </html>

[Disclaimer: I do help maintain the Vanity gem.]

Could you sendout a custom signup link that had a querystring on the end eg example.com/signup?one or example.com/signup?two then check for that query string at signup?

I know this isn't Ruby on Rails but it might be worth looking at and seeing how they plan to do it.

http://www.campaignmonitor.com/blog/post/2782/ab-testing/

I've been looking at this as well. 7 minute abs is a nice A/B solution, but I think for emails you can do it yourself relatively easily. If you have either a dedicated image (say an invisible "bug" image) that you use for open detection, or just an image that is always included, you can put a param on that, or rather, just alias it in your web server, or not alias it for that matter, and just copy the image, eg "open_a.gif" and "open_b.gif" and watch your Analytics or web logs to track which gets opened more. If you don't need to associate it with the email recipient, then you can simply send half the emails using the A image, and half with B, etc. Same goes for the URL in the email for case #2 as you mention, that one can probably be a simple URL parameter or path, and you just let Analytics track that for you.

The Campaign Monitor solution, and Campaign Monitor in general, is excellent, if it can work for you. We use Campaign Monitor for our newsletter emails, but can't for all the personalized email we send. If you are sending the same email to all users, then by all means, I'd go with Campaign Monitor, but if each mail is personalized you'll probably need to roll your own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM