Getting started
Welcome
Welcome to the Onboarding data tutorial series!
In this series we'll work on getting your data into the Platform and some of the things you can then do with it. After working your way through this series, you'll be familiar with the tasks and actions that can be done on the Platform itself.
What we'll be covering
In this tutorial, we won't be covering any product-related features, but will be focusing on the tasks that you can do outside of any specific Intercom product. However, all of the actions we look at here can be used in conjunction with any of the Intercom products, so later tutorials will build on these core skills to execute more feature-rich and complex actions.
For now though, we will focus on getting your data into the Platform and then what you can do with it:
Tutorial 1: Creating and Managing Users
First, we'll create individual users with some basic user data. We'll then perform some basic operations, such as searching for users, followed by ways we can import larger numbers of users into Intercom via a CSV file.
Tutorial 2: Making use of Tags
Once you have some basic data imported into Intercom, we'll learn how to tag your users to make it easier to identify and group your users.
Tutorial 3: Custom and Standard Attributes
You may have some specific data that you want to add to your users - you can do this via custom attributes. In this section we'll look at ways in which we can easily add both standard and custom data to your users.
Tutorial 4: Working with Leads
Unfortunately, not all your visitors will sign up to your product or login to your website, but once a visitor starts a conversation with you they become a lead in Intercom. This section will show you how to create leads and then turn these leads into users.
Tutorial 5: Managing Companies
Another way to group your users is by associating them with companies. Here we'll cover how to create companies and assign your users to these companies.
Tutorial 6: Deleting Users
You may have test data in your system or data relating to users that you no longer need. We'll show you ways to create a custom delete function to delete all your users or groups of users based on tags.
Tutorial 7: Working With Events
Events help you understand and monitor your users' behavior as they navigate through your product or website, so we'll look at how to create and track events.
Tutorial 8: Using Segments
Segments are another way to group your users - this tutorial will show you how.
Tutorial 9: Webhooks
Webhooks are a very powerful feature of the Intercom Platform and can be used in many different ways to realize value for your business. In this tutorial we'll go through how to setup webhooks and use them to be notified when certain important events occur, so you can see where you can apply webhooks to your own app.
Tutorial 10: Putting It All Together
In this last tutorial we'll use some of the code we've worked with throughout the series to create a tool that allows you to import user data, custom attributes, standard attributes, tags and events in one go. We'll explain how you can use it to import data into your test app or to import real customer data to your main Intercom app.
Coding ability
You'll get the most from this series if you have some basic coding knowledge - for example, an understanding of an object-oriented language such as Ruby, Python or Java would be helpful. However, it is not a prerequisite for the series and we have designed it so that all the code is available and should be usable by most people regardless of coding ability.
Setup steps
For the purposes of this tutorial we will be using the Intercom Ruby SDK to interact with the Intercom Platform.
- Install the intercom-ruby SDK
Please install this SDK. There are steps on how to install this in the README file. - Setup Interactive Ruby (IRB)
We'll be using the Ruby interactive editor to step through the example code so here is some information on that if you haven't used it before. If you need to upgrade your Ruby version then RVM is a cmd line tool that allows you to easily install, manage or upgrade different Ruby versions. - Use the Example Code
You can find the example code we use in this tutorial in GitHub:
For now, you can just have this close by so you can look at the code as we step through it. There's not much code here so you can simply copy and paste it in as needed during the tutorials.
Alternatively, use our Docker image
If you don't want to mess around with Ruby versions and gems and all that jazz, then you can use our Docker image. This will allow you to simply run a PRY Ruby interactive shell with the code for this tutorial available. To use the docker image you'll need to:
1/ Install Docker
Go to the Docker start page above and choose either the Mac, Linux or Windows installation and follow the steps to install Docker and verify that it's running.
2/ Run the Intercom-Ruby Image
Simply replace PUT_NAME_HERE with any text to identify this image and then run the below command.
docker run -it --name PUT_NAME_HERE cathalhoran/intercom-ruby:v2
This will download the image if it does not exist locally. Once it runs it should take you into an interactive Ruby shell called Pry where you can start running some code.
A Note on PRY
PRY is a really useful tool - in case you're not aware of all of its features, here are some examples of quick things you can do to check out what it can do.
pry(main)> .ls -lrt
total 68
-rw-rw-r-- 1 root root 78 Jun 2 14:31 Gemfile
-rw-rw-r-- 1 root root 758 Jun 2 14:35 Gemfile.lock
-rw-rw-r-- 1 root root 867 Jun 2 14:57 Dockerfile
-rw-r--r-- 1 root root 756 Jun 2 15:45 webhooks_server.rb
-rw-r--r-- 1 root root 2107 Jun 2 15:45 webhook_tasks.rb
-rw-r--r-- 1 root root 3345 Jun 2 15:45 user_tasks.rb
-rw-r--r-- 1 root root 251 Jun 2 15:45 test.csv
-rw-r--r-- 1 root root 596 Jun 2 15:45 tag_tasks.rb
-rw-r--r-- 1 root root 738 Jun 2 15:45 segment_tasks.rb
-rw-r--r-- 1 root root 2878 Jun 2 15:45 lead_tasks.rb
-rw-r--r-- 1 root root 238 Jun 2 15:45 intercom_client.rb
-rw-r--r-- 1 root root 1150 Jun 2 15:45 event_tasks.rb
-rw-r--r-- 1 root root 1912 Jun 2 15:45 company_tasks.rb
-rw-r--r-- 1 root root 33 Jun 2 15:45 README.md
-rw-r--r-- 1 root root 11357 Jun 2 15:45 LICENSE
pry(main)> .cat intercom_client.rb
require 'intercom'
class IntercomClient
#First lets setup the client with your App ID and App Key
def initialize(token)
@@intercom = Intercom::Client.new(token: your_token)
end
end
pry(main)> .pwd
/app
pry(main)> history -n
history -n
.ls
.ls -lrt
.cat intercom_client.rb
[2] pry(main)> .ls -lrt
total 76
-rw-rw-r--. 1 root root 78 Jun 2 14:31 Gemfile
-rw-rw-r--. 1 root root 758 Jun 2 14:35 Gemfile.lock
-rw-rw-r--. 1 root root 996 Jun 3 13:01 Dockerfile
-rw-r--r--. 1 root root 756 Jun 3 13:11 webhooks_server.rb
-rw-r--r--. 1 root root 2107 Jun 3 13:11 webhook_tasks.rb
-rw-r--r--. 1 root root 3345 Jun 3 13:11 user_tasks.rb
-rw-r--r--. 1 root root 251 Jun 3 13:11 test.csv
-rw-r--r--. 1 root root 596 Jun 3 13:11 tag_tasks.rb
-rw-r--r--. 1 root root 738 Jun 3 13:11 segment_tasks.rb
-rw-r--r--. 1 root root 1826 Jun 3 13:11 sample_data.rb
-rw-r--r--. 1 root root 3696 Jun 3 13:11 sample_data.csv
-rw-r--r--. 1 root root 2878 Jun 3 13:11 lead_tasks.rb
-rw-r--r--. 1 root root 238 Jun 3 13:11 intercom_client.rb
-rw-r--r--. 1 root root 1150 Jun 3 13:11 event_tasks.rb
-rw-r--r--. 1 root root 1912 Jun 3 13:11 company_tasks.rb
-rw-r--r--. 1 root root 33 Jun 3 13:11 README.md
-rw-r--r--. 1 root root 11357 Jun 3 13:11 LICENSE
[3] pry(main)> .ruby --version
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
[4] pry(main)> .vim file.rb
[5] pry(main)> .ls -lrt
total 80
-rw-rw-r--. 1 root root 78 Jun 2 14:31 Gemfile
-rw-rw-r--. 1 root root 758 Jun 2 14:35 Gemfile.lock
-rw-rw-r--. 1 root root 996 Jun 3 13:01 Dockerfile
-rw-r--r--. 1 root root 756 Jun 3 13:11 webhooks_server.rb
-rw-r--r--. 1 root root 2107 Jun 3 13:11 webhook_tasks.rb
-rw-r--r--. 1 root root 3345 Jun 3 13:11 user_tasks.rb
-rw-r--r--. 1 root root 251 Jun 3 13:11 test.csv
-rw-r--r--. 1 root root 596 Jun 3 13:11 tag_tasks.rb
-rw-r--r--. 1 root root 738 Jun 3 13:11 segment_tasks.rb
-rw-r--r--. 1 root root 1826 Jun 3 13:11 sample_data.rb
-rw-r--r--. 1 root root 3696 Jun 3 13:11 sample_data.csv
-rw-r--r--. 1 root root 2878 Jun 3 13:11 lead_tasks.rb
-rw-r--r--. 1 root root 238 Jun 3 13:11 intercom_client.rb
-rw-r--r--. 1 root root 1150 Jun 3 13:11 event_tasks.rb
-rw-r--r--. 1 root root 1912 Jun 3 13:11 company_tasks.rb
-rw-r--r--. 1 root root 33 Jun 3 13:11 README.md
-rw-r--r--. 1 root root 11357 Jun 3 13:11 LICENSE
-rw-r--r--. 1 root root 13 Jun 3 13:19 file.rb
[6] pry(main)> .cat file.rb
puts 'hello'
[7] pry(main)> .ruby file.rb
hello
[8] pry(main)> .ruby file.rb
hello
Right, let's get started! The first tutorial will show you how to create users.
Updated over 6 years ago