Two powerful tools, together

Integrate Segment and Plotly to turn your data into actionable insights.

About Segment

Segment is a customer data hub.


Stitch offers detailed documentation on how to sync all your Segment data today.

Stitch Segment Documentation

About Plotly

Plotly is a cloud-based data visualization toolbox that lets people who work with data create charts and share them on the web. Data scientists, developers, and designers can use Plotly's APIs to build data visualizations, or make charts without coding by connecting with spreadsheet or database data.

Learn more about Plotly

Stitch makes it easy to get data into Plotly.

Follow these three steps:

Data flowing out of Segment

Connect Segment to Stitch

Quickly connect your Segment account to Stitch, choose your data, and replicate on a schedule you define.

Data flowing through Stitch logo

Send your data to the leading warehouses

Stitch delivers your data to the analytics warehouse of your choice. Don't have a warehouse yet? No problem. Stitch can provision one for you.

Data flowing into an analytics warehouse

Connect your warehouse to Plotly

In most cases, it's simply a matter of providing access credentials. Stitch helps you focus on analysis, not data consolidation.

Data flowing into Plotly

Expected Segment data

Here’s a sample of the raw Segment data that Stitch will replicate to your analytics warehouse:

Identify

This table records all user information.

Table name: identify

Track

This table records all event information.

Table name: track

Page

This table records page events, along with any information about page properties.

Table name: page

Screen

This table records screen events, along with any information about screen properties.

Table name: screen

Group

This table records group information, including traits and all additional properties.

Table name: group

View all tables

Jumpstart your Segment analytics with reusable blocks

dbt packages can speed up your work

Once you replicate your Segment data with Stitch, you can use it in many ways. For example, you can use the data modeling and transformation tool dbt to prepare data for reporting, analytics, or machine learning applications.

Dbt has prebuilt packages for many Stitch data sources, including Segment. Here’s a look at code for modeling Segment data. This particular block of code quickly cleans your Segment data and categorizes your web page views.

View the source on GitHub →
                          
                            {% macro segment_web_page_views() %}
    {{ adapter_macro('segment.segment_web_page_views') }}
{% endmacro %}
{% macro default__segment_web_page_views() %}
with source as (
    select * from {{var('segment_page_views_table')}}
),
renamed as (
    select
        id as page_view_id,
        anonymous_id,
        user_id,
        received_at as received_at_tstamp,
        sent_at as sent_at_tstamp,
        timestamp as tstamp,
        url as page_url,
        {{ dbt_utils.get_url_host('url') }} as page_url_host,
        path as page_url_path,
        title as page_title,
        search as page_url_query,
        referrer,
        {{ dbt_utils.get_url_host('referrer') }} as referrer_host,
        context_campaign_source as utm_source,
        context_campaign_medium as utm_medium,
        context_campaign_name as utm_campaign,
        context_campaign_term as utm_term,
        context_campaign_content as utm_content,
        {{ dbt_utils.get_url_parameter('url', 'gclid') }} as gclid,
        context_ip as ip,
        context_user_agent as user_agent,
        case
            when lower(context_user_agent) like '%android%' then 'Android'
            else replace(
                {{ dbt_utils.split_part(dbt_utils.split_part('context_user_agent', "'('", 2), "' '", 1) }},
                ';', '')
        end as device
        {% if var('segment_pass_through_columns') != [] %}
        ,
        {{ var('segment_pass_through_columns') | join (", ")}}
        {% endif %}
    from source
),
final as (
    select
        *,
        case
            when device = 'iPhone' then 'iPhone'
            when device = 'Android' then 'Android'
            when device in ('iPad', 'iPod') then 'Tablet'
            when device in ('Windows', 'Macintosh', 'X11') then 'Desktop'
            else 'Uncategorized'
        end as device_category
    from renamed
)
select * from final
{% endmacro %}
                          
                        

Segment to your data warehouse in minutes

Stitch delivers all your data to the leading data lakes, warehouses, and storage platforms.

Stitch saves us a ton of time. Having a standard process to put the data in the warehouse and then feeding that data to a dashboard gives us more time to dig and uncover the story the data is telling us.

Kristen Allcorn

Data Analyst, NextAfter

Why our customers choose Stitch

Stitch is a simple, powerful ETL service built for developers. Stitch connects to your first-party data sources – from databases like MongoDB and MySQL, to SaaS tools like Salesforce and Zendesk – and replicates that data to your warehouse. With Stitch, developers can provision data for their internal users in minutes, not weeks.

Explore all of Stitch's features
Simple setup
Start replicating data in minutes, and never worry about ETL maintenance.
Own your own data infrastructure
Stitch replicates to your warehouse, meaning you’re always in control.
Mature replication engine
Accurate data from any structure, all the time.
Explore all of Stitch's features

Connect to your ecosystem of data sources

Stitch integrates with leading databases and SaaS products. No API maintenance, ever, while you maintain full control over replication behavior.