Easily import historical data to Segment by uploading a CSV
Segment CSV Importer allows you to import all of your historical data in the form of a CSV file to Segment in a matter of seconds. All you need to do is upload your CSV file to Segment CSV Importer and it will send your data to Segment which in turn sends it to all your integrations, such as Mixpanel or Amplitude.
in a CSV file
Copy Write Key
Paste into importer
Upload CSV & click
You can use this template, and the guide lower on this page, to structure your import CSV. Once your data is filled in on the Google Sheet, export to CSV and use that file to import below.
How to Use The Segment CSV Importer
Our Segment CSV Importer upon loading asks you to enter your segment write key and upload your CSV file.
CAUTION: Use a test account to send data before you try it on your live account.The stuff below is permanent and in most cases can’t be removed. Use extreme caution. Setup a separate test Segment account and test accounts for any integration you use in Segment.
Finding the Write Key
The write key allows our app to connect with your workspace. A workspace is a group of sources, linked together so you can control them together. You can think of the write key as a unique identifier that tells Segment two essential things:
- What is the source that generated the data
- Where the data should be piped to. Which integrations – business tools and apps interlinked via Segment such as Mixpanel or Amplitude, and workspaces should receive it.
Now that you know what the write key is for, follow these steps to find yours:
- Navigate to segment.com
- Log in with your account
- Select your desired workspace. It will take you to your sources.
- Click on the relevant source
- Click Settings
- On the left, click API keys
- Copy the Write Key (see image below)
Now you’ll have the key you that you can paste into our Segment CSV Importer.
Uploading the File
Now that you have your write key and you’ve pasted it in:
- Click on the Choose File button to upload your data in .csv
- After you choose your file, you’ll see a basic format of your file, and the first two records from your CSV file
- Click “Import” at the bottom left of the page
- If everything is OK, you’ll see a message saying “Data sent”.
That’s all. It’s that simple.
CSV Import File Specifications & Template
We’ve made a CSV template for you. Save time by using it to just fill in your data, or to reformat an existing CSV file by following the template. Below are a few main concepts to remember:
- The CSV file should cover some mandatory fields that allow Segment to detect the action you want to perform with your data.
- We combined two Segment import actions – Identify – “who is the customer?”, and Track – “what are they doing?”. For every row in your CSV, we send an Identity Segment action with Traits fields, and then we send a Track event using Event and Properties data from the row. By doing so, we avoid requiring you to split your data into separate lists with Identity data and Track data. You can import one file for both.
- Every row in your CSV should represent an event that the user performed, timestamp of the event, traits that describe the user, and the user properties associated with the event in your taxonomy
In short, your CSV should have the following fields:
- Identity – user ID
- Timestamp – our importer can take a variety of formats