{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Segment Import Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"segment-import-integration","__idx":0},"children":["Segment Import Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://Segment.io"},"children":["Segment.io"]}," is used to get the data from a data source and transfer it to a destination. Treasure Data has native connectivity with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://segment.com/"},"children":["Segment"]}," (formerly ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://Segment.io"},"children":["Segment.io"]},") for ingesting data. The connection is set up in the Segment UI with a Treasure API key. Data ingestion happens every minute, so you can query data almost in real-time."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191010-222002.d10183c799691b002eea0c9cc7182c4a879823d527302faffa15901521a76edf.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-segment-account","__idx":1},"children":["Create a Segment Account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up your Segment account from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://segment.com/signup"},"children":["here"]}," or login to your ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://app.segment.com/login"},"children":["existing Segment account"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-193712.a685754826b27178f95f6e096809ae79c97f251340a788811b3ceeb448ebd479.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-the-source","__idx":2},"children":["Set Up the Source"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need to configure both Source and Destination to import the data from somewhere into Treasure Data. In the example below, the source is a website and the destination is Treasure Data."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log in to Segment."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to your Workspace."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Catalog > Sources"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search and select the JavaScript tile."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-210935.1c708ce4da6297f3c3b356e7c45eab0b611af1d17ec5f23fc1ce49a9b1e7fe25.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Add Source."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211005.2305cde37958760d38c002abbc8875768fb50ae8a019110cbfbd37a5ff15eb70.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Source setup dialog opens. Create a name, add labels and type in the URL for the website where you will install the tag. Select Add Source."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211610.55dab0a0410d1aaae53075a96facef343336422cc22b4a98856df147aa9fd6e3.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Copy Snippet."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211628.4740c48f5684d959c281b87a766864943c37679f7928e7b4f6591102137ed31d.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":8},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the code snippet to your website."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211703.a990a9dd527ec8847a66af0f79bc169c48678876433f170c045cbd4efb4b1a6f.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"import-segment-data-into-treasure-data","__idx":3},"children":["Import Segment Data into Treasure Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After setting up the source, you set up Treasure Data as the Destination."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Destinations"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search and select Treasure Data."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211802.1f6e90e53734ff1c7b8915b5f196785e74bfb044070ec97e35bd75f83579eb03.2d21cf31.png","alt":""},"children":[]}," ","3. Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Configure Treasure Data"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-194042.268ba69e4d002464b746ae22ce8d5d7c694e86ba43b3328bf523f7991cd022c0.2d21cf31.png","alt":""},"children":[]}," ","4. Select the source configuration created in the previous steps."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-211908.a87317a75f6c8976596cae0ed1db9794f07c09ba5c95444ca21a28816b846a7e.2d21cf31.png","alt":""},"children":[]}," ","5. The Treasure Data Settings dialog opens. Get your ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/getting-your-api-keys"},"children":["API write key from the Treasure Console"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212014.6eee0cf27c27c0ff4d8e782fb08dcf3874843affc4fbeb5d61243c3e8b6b6da3.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Paste the API Write Key and type in the name of the database where you want to import the data."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212104.27a77d37a5286ffc9887d522cdf44dbec7f517f9f63e06f4c4690f86f501a31f.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Turn on the setting by selecting the on/off button."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212141.ae8a23049a403f93b8c21515571229c6a54399afa7d6599c257ff61aad6ffb8e.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"check-the-source-and-destination","__idx":4},"children":["Check the Source and Destination"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Visit your website to trigger the tracking code."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212712.df496afe6195a9d9b4b2ef828992d9e44e99d4d03d96c3ae986f7a4958199399.2d21cf31.png","alt":""},"children":[]}," ","2. Go to your Workspace in Segment and navigate to Destinations > Event Delivery."," ","3. Check to see that the tracking tag is sending events to Segment."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212750.e69e7b7fe6b3fe55db01ff3105edbd6bc78b46d9b5b06009def2a47bc0f1e615.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Data Workbench > Databases."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search and select the destination database. The data can be seen in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["pages"]}," table in that database."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optionally, check the import job in Jobs."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200814-212834.7ad18752d67945468b956565af6c451fb492ca79716b8396a2c1d073ef71223d.2d21cf31.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"query-the-events","__idx":5},"children":["Query the Events"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Queries"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a query in to track the events coming in."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["It might take a few minutes before events are logged in Treasure Data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"references","__idx":6},"children":["References"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://blog.treasuredata.com/blog/2016/02/08/raw-sql-access-to-segment-com-data/"},"children":["Raw SQL Access to Segment.com Data in Real-time"]}]}]}]},"headings":[{"value":"Segment Import Integration","id":"segment-import-integration","depth":1},{"value":"Create a Segment Account","id":"create-a-segment-account","depth":2},{"value":"Set Up the Source","id":"set-up-the-source","depth":2},{"value":"Import Segment Data into Treasure Data","id":"import-segment-data-into-treasure-data","depth":2},{"value":"Check the Source and Destination","id":"check-the-source-and-destination","depth":2},{"value":"Query the Events","id":"query-the-events","depth":2},{"value":"References","id":"references","depth":2}],"frontmatter":{"seo":{"title":"Segment Import Integration"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/segment-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}