Ruby Gem - Storyberg/Docs GitHub Wiki

Comprehensive documentation of the Storyberg gem can be found in the Storyberg gem readme file

1. Install the Storyberg Gem

gem install storyberg

2. Initialize Storyberg

Storyberg::init YOUR_STORYBERG_API_TOKEN

3. Identify logged in users

Storyberg.identify(
  current_user.id, # TODO  Output the current logged in users ID 
  {
    email: current_user.email,  # TODO  Output the current logged in users email address 
    name: current_user.full_name, # TODO Output the current logged in users name
    sign_up_date: current_user.created_at.to_i # TODO Output the current logged in sign up date as a Unix timestamp
  }
)

4. Tag when a user 'sees' a new feature or experiment

Storyberg.identify(
  current_user.id, # TODO  Output the current logged in users ID 
  {
    tag: 'EXPERIMENT TAG' # TODO Update with the experiment tag
  }
)

5. Record when a user does a key activity (event)

To record when a user does an activity, execute one the following calls.

a. Record key activity

Storyberg.record(current_user.id)

b. Record paid event

Storyberg.paid(current_user.id)

c. Record custom event

Storyberg.event(
  current_user.id, # TODO  Output the current logged in users ID 
  {
    name: 'EVENT NAME' # TODO Update with an event name (no spaces)
  }
)