No description, website, or topics provided.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
outbound.gemspec

README.md

Outbound

A simple interface to integrate with http://outbound.io

Installation

Add this line to your application's Gemfile:

gem 'outbound'

And then execute:

$ bundle

Or install it yourself as:

$ gem install outbound

Usage

Easy and simple to use.

  # Create the object
  ob = Outbound::API.new("your_api_key")

  # identify a user
  ob.identify(user_id, traits)

  # track a user
  ob.track(user_id, event, payload)

Here is an example in sinatra.

  require 'sinatra'
  require 'outbound'
  require 'multi_json'

  before "/*" do
    @ob ||= Outbound::API.new("your_api_key")
  end

  post '/identify' do
    content_type :json
    traits = {
      first_name: params[:first_name],
      last_name: params[:last_name],
      email: params[:email]
    }
    MultiJson.dump(@ob.identify("SOME_UNIQUE_ID", traits))
  end

  post '/track' do
    content_type :json
    payload = {
      item: params[:item]
    }
    MultiJson.dump(@ob.track("SOME_UNIQUE_ID", "purchased an item", payload))
  end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request