Customer Support Chat Room for Small Teams, Done Right!

Conference Badge
Conference Badge
Published in
2 min readMay 14, 2013

At Conference Badge, we love support. We want our customers to be HAPPY. And nothing beats a live conversation. No surprise our preferred tool is our help chat.

We use an HipChat public room for this. Free and easy to setup.

But the thing is, when you’re a small team, you aren’t always around to help. Sometimes the support room is empty, your team is off… you know, sleeping? For a customer with questions or problems there is nothing worst than an EMPTY CHAT ROOM!

No chat room is better than an empty one. Customers shouldn’t waste time asking questions with nobody listening. When we are off, they should be directed to an asynchronous support method (email, Twitter, help desk, FAQ, etc.)

We’ve fixed this problem with the awesome HipChat API. Basically, we run a job every 10 minutes to check if at least one of our team members is online. Here’s the code:

desc 'Update Chat Status'
namespace :scheduler do
task :update_chat_status => :environment do
begin
# Connect to HipChat
hc = HipChat::API.new(HIPCHAT_API_KEY)

# Fetch your support chat room id
room_id = hc.rooms_list['rooms'].find{|r| r['name'] =~ /conferencebadge\.com/i}['room_id']
# Fetch users in room
users_in_room = hc.rooms_show(room_id)['room']['participants'].map{|p| p['user_id']}
# Get your team user ids
help_staff_ids = hc.users_list['users'].map{|u|u['user_id']}

# Update a boolean variable, somewhere, we use an Option table in our database.
set_status (users_in_room & help_staff_ids).any?
rescue
set_status false
raise
end
end
end

def set_status(value)
Option.find_or_create_by_name(:chat_status).update_attribute(:value, value ? 'true' : 'false')
end

gistfile1.rb hosted with ❤ by GitHub — View raw

With this “chat_status” boolean flag, our web app knows when to direct our needing customer to the chat room or not. No more customers hitting an empty room!

Authored by Philippe-Antoine Lehoux — Follow him @plehoux

--

--

Conference Badge
Conference Badge

Design name badges online for your next event and get them shipped right to you!