Giter Site home page Giter Site logo

devise_marketable's Introduction

Marketable for Devise

If this person turns out to be our best customer, we want to know where they came from.

Mike McDerment, CEO of FreshBooks

Marketable lets Devise users easily store where your user came from and where they were going in your Rails app.

Background

Mike McDerment is part of that small handful of entrepreneurs who have tremendously inspired my work. He started a web app, and even past 30 years old, was cranking away at in his parents' basement for 3 years. Plenty of smart people told him what he was working on was stupid and would fail. And, yet, he continued. Today, FreshBooks is a very successful company.

Mike is a huge proponent of tracking where your customers came from and where they were going. With this data, you can figure out what kind of marketing is working and what's not.

By "marketing", I'm referring to everything related to getting customers, not just spending money on advertising. If you get an influx of new users, wouldn't you want to know if they came from a blog post you wrote, or someone mentioned you on Reddit? If you found out Reddit is your best source of new paying customers, then you've figured out where to best allocate your resources to get even more customers.

It's super easy to capture this data, but most of us don't, because it's even more friction to getting features done for our customers. Or we rely on 3rd party analytics tools. Some are great, but what happens when you want to switch analytics tools or do something custom they can't do.

I created Marketable to automatically track the most basic and important marketing data we should be tracking alongside our User data (using Devise) in our own database. (And so that I could add it to Draft, a tool I've created to help people write better.)

Installation

  1. Add 'devise_marketable' to your Gemfile.
source "https://rubygems.pkg.github.com/excid3" do
  gem "devise_marketable", "~> 1.0"
end

Or from the master branch:

gem 'devise_marketable', git: 'https://github.com/excid3/devise_marketable'
  1. Run bundle install
  2. Add the marketing fields to your user table:
rails g devise_marketable YOUR_USER_MODEL

YOUR_USER_MODEL is probably User. It's what you attach Devise to. (e.g. User, Admin, Account)

rails g devise_marketable User
  1. Run your migration
rake db:migrate
  1. Restart your server

Devise will now automatically create 2 cookies for your users, the referring_url (where they came from) and the landing_url (where they were going). When the user registers with your application, the values in those cookies are stored alongside your user data.

That's it. You now have some very powerful data: where your best customers come from, what traffic sources are your most lucrative, what on your website converts the best, what people are most interested in, etc.


Feedback

Source code available on Github. Feedback and pull requests are greatly appreciated. Let me know if I can improve this.


Here's a great short presentation from Mike on tracking user metrics.

devise_marketable's People

Contributors

excid3 avatar kawamoto avatar n8 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.